Hi,

When trying to check/repair/analaiz a table with a name like 'table-name'
mysqlcheck (from source package 3.23.53) fails with:
mysqlcheck: Got error: 1064: You have an error in your SQL syntax near '-name'
at line 1 when executing 'CHECK TABLE ...

Here's the patch for it:

--- mysqlcheck.old      Sat Oct 26 11:37:49 2002
+++ mysqlcheck.c        Sat Oct 26 11:35:12 2002
@@ -521,7 +521,7 @@

   if (!(query =(char *) my_malloc((sizeof(char)*(length+110)), MYF(MY_WME))))
     return 1;
-  sprintf(query, "%s TABLE %s %s", op, tables, options);
+  sprintf(query, "%s TABLE `%s` %s", op, tables, options);
   if (mysql_query(sock, query))
   {
     sprintf(message, "when executing '%s TABLE ... %s", op, options);

HTH.
  Guy


-- 
http://www.uadm.com         |   Local and Remote Unix/Linux
[EMAIL PROTECTED]               |   Administration. No outsourcing.
Phone: +972 3 6201373       |   Security, Installations, Support
http://www.uadm.com/pgp.key |   Upgrades and Maintenance.

---------------------------------------------------------------------
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