mysqlcheck small bug

mysqlcheck small bug

am 14.02.2002 15:55:27 von Guy Cohen

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

How-To-Repeat: run mysqlcheck when table name like 'table-name'

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
info@uadm.com | 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 bugs-thread12999@lists.mysql.com
To unsubscribe, e-mail

Re: mysqlcheck small bug

am 15.11.2002 18:32:25 von Sinisa Milivojevic

Guy Cohen writes:
> 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 ...
>
> How-To-Repeat: run mysqlcheck when table name like 'table-name'
>
> 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
>
>

Thank you for your report.

A patch quite somilar to the above one was applied to all trees quite
recently.

--
Regards,
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer
/_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus
<___/ www.mysql.com


------------------------------------------------------------ ---------
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 bugs-thread13000@lists.mysql.com
To unsubscribe, e-mail