>Description:
        mysql-utilities mysqlcheck and mysql_convert_table don't quote
        table names and so fail in converting/checking/repairing
        specially named tables.
        
>How-To-Repeat:
        create e.g. a table `A-22bd` and run mysqlcheck on it:
        
        # mysqlcheck test
        mysqlcheck: Got error: 1064: You have an error in your SQL syntax near '-22bd 
' at line 1 when executing 'CHECK TABLE ... 
        
        The same problem exists in mysql_convert_table.
        When quoting the table name, everything works fine from the mysql
        monitor.
        
>Fix:
        Changing line 72 in mysql_convert_table from
         if (!$dbh->do("ALTER TABLE $table type=$opt_type"))
        to
         if (!$dbh->do("ALTER TABLE \`$table\` type=$opt_type"))
        fixes the problem for mysql_convert_table.

        It would also a nice idea to include '--quote-names' as a default
        in mysqldump since without this option above mentioned tables
        aren't dumpable.

>Submitter-Id:  <submitter ID>
>Originator:    Anders Henke
>Organization:  Schlund+Partner AG
>MySQL support: none
>Synopsis:      mysqlcheck and mysql_convert_table don't quote table names
>Severity:      serious
>Priority:      low
>Category:      mysql
>Class:         sw-bug
>Release:       mysql-3.23.43 (Source distribution)
>Server: /usr/bin/mysqladmin  Ver 8.21 Distrib 3.23.43, for pc-linux-gnu on i686
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Server version          3.23.43-Max-log
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /var/run/mysqld/mysqld.sock
Uptime:                 9 hours 37 min 2 sec

Threads: 6  Questions: 1516479  Slow queries: 234  Opens: 239639  Flush tables: 2  
Open tables: 64 Queries per second avg: 43.801
>Environment:
System: Linux rdb6 2.4.10 #1 SMP Thu Oct 4 14:29:57 CEST 2001 i686 unknown
Architecture: i686

Some paths:  /usr/bin/perl /usr/bin/make /usr/bin/gcc /usr/bin/cc
GCC: Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs
gcc version 2.95.2 20000220 (Debian GNU/Linux)
Compilation info: CC='gcc'  CFLAGS='-O6 -fomit-frame-pointer'  CXX='gcc'  
CXXFLAGS='-O6 -fomit-frame-pointer -felide-constructors  -fno-exceptions -fno-rtti'  
LDFLAGS='-static'
LIBC: 
lrwxrwxrwx    1 root     root           13 Jun  7 19:47 /lib/libc.so.6 -> libc-2.1.3.so
-rwxr-xr-x    1 root     root       888192 Jun  9 17:39 /lib/libc-2.1.3.so
-rw-r--r--    1 root     root      2090160 Jun  9 17:40 /usr/lib/libc.a
-rw-r--r--    1 root     root          178 Jun  9 17:40 /usr/lib/libc.so
Configure command: ./configure  --prefix=/usr --libexecdir=/usr/sbin 
--localstatedir=/var/mysql/data --enable-shared --without-perl --without-readline 
--without-docs --without-bench --with-mysqld-user=mysql --with-extra-charsets=all 
--enable-assembler --with-raid --with-mysqld-ldflags=-all-static 
--with-client-ldflags=-all-static --with-charset=latin1 --with-bench
Perl: This is perl, version 5.005_03 built for i386-linux

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to