Details
Description
mysqlcheck encloses dots in a table in backticks, this doesn't make sense though as never expects to see a db.table combination (database and table names are passed in as separate parameters)
This breaks mysqlcheck, and indirectly mysql_upgrade, for tables with a dot in their name
test case:
CREATE TABLE test.`foo.bar`(id int primary key); |
then run
mysqlcheck test foo.bar
|
or
mysql_upgrade --force
|
This was introduced in revision 1810.3494.1 ( http://bazaar.launchpad.net/~mysql/mysql-server/5.6/revision/1810.3494.1 ) as part of a fix for http://bugs.mysql.com/bug.php?id=30654
proposed fix:
=== modified file 'client/mysqlcheck.c'
--- client/mysqlcheck.c 2013-05-07 11:05:09 +0000
+++ client/mysqlcheck.c 2014-04-17 12:57:31 +0000
@@ -513,8 +513,6 @@
{
if (*p == '`')
extra_length++;
- else if (*p == '.')
- extra_length+= 2;
}
DBUG_RETURN((uint) ((p - name) + extra_length));
@@ -529,11 +527,6 @@
for (; *src; src++)
{
switch (*src) {
- case '.': /* add backticks around '.' */
- *dest++= '`';
- *dest++= '.';
- *dest++= '`';
- break;
case '`': /* escape backtick character */
*dest++= '`';
/* fall through */