Bug #10947 mysqlshow wildcard failure on Windows
Submitted: 30 May 2005 0:32 Modified: 10 Jun 2005 19:19
Reporter: Paul Dubois Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.0, perhaps earlier version OS:Microsoft Windows (Windows)
Assigned to: Reggie Burnett CPU Architecture:Any

[30 May 2005 0:32] Paul Dubois
Description:
mysqlshow is supposed to interpret *, %, _ and ? in its
last argument as a wildcard.  This works on Unix if
the last argument is a database or table name. On Windows,
this works if the last argument is a database name, but fails
if the last argument is a table name.

Works for database name last argument:

C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqlshow
+--------------------+
|     Databases      |
+--------------------+
| information_schema |
| mysql              |
| test               |
| world              |
+--------------------+

C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqlshow "w%"
Wildcard: w%
+-----------+
| Databases |
+-----------+
| world     |
+-----------+

C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqlshow "w*"
Wildcard: w%
+-----------+
| Databases |
+-----------+
| world     |
+-----------+

Fails for table name last argument:

C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqlshow world "C%"
mysqlshow: Cannot list tables in world: You have an error in your SQL syntax;
ch
eck the manual that corresponds to your MySQL server version for the right
synta
x to use near 'C%\0\0\0\'' at line 1

C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqlshow world "C*"
mysqlshow: Cannot list tables in world: You have an error in your SQL syntax;
ch
eck the manual that corresponds to your MySQL server version for the right
synta
x to use near 'C%\0\0\0\'' at line 1

How to repeat:
See above.
[30 May 2005 6:18] Jorge del Conde
I was able to reproduce this bug with 5.0.4:

C:\my>mysqlshow -uroot mysql "u*"
mysqlshow: Cannot list tables in mysql: You have an error in your SQL syntax; ch
eck the manual that corresponds to your MySQL server version for the right synta
x to use near ''u%\0\0\0◄\0\0Z\0@(4\0ê(4\0╨(4\0°(4\0@)4\0h)4\0á)4\0╚)4\0α)4\0sho
w tables lik' at line 1
[9 Jun 2005 17:09] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/25824
[9 Jun 2005 22:48] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/25837
[10 Jun 2005 14:45] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/25870
[10 Jun 2005 19:05] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/25885
[10 Jun 2005 19:14] Reggie Burnett
Fixed in 5.0.8
[10 Jun 2005 19:19] Paul Dubois
Noted in 5.0.8 changelog.