[debian-mysql] Bug#507049: mysql-server-5.0: /usr/share/mysql/debian-start.inc.sh fails with 'Unknown, column' when sql-mode="ansi-quotes"

Renato Alves simpledark at gmail.com
Tue Jan 6 17:28:38 UTC 2009


I had the same problem when activating sql-mode="ansi"

However since the patch attached is a quite cryptic on the ' " ` 
escapes, I wrote a cleaner version of it.
Should work the same way both with and without "ansi-quotes".

--- debian-start.inc.sh.orig    2009-01-06 14:51:44.000000000 +0000
+++ debian-start.inc.sh 2009-01-06 14:49:33.000000000 +0000
@@ -18,10 +18,10 @@
   tempfile=`tempfile`
   # We have to use xargs in this case, because a for loop barfs on the
   # spaces in the thing to be looped over.
-  LC_ALL=C $MYSQL --skip-column-names --batch -e  '
-      select concat("select count(*) into @discard from `",
-                    TABLE_SCHEMA, "`.`", TABLE_NAME, "`")
-      from information_schema.TABLES where ENGINE="MyISAM"' | \
+  LC_ALL=C $MYSQL --skip-column-names --batch -e  "
+      select concat('select count(*) into @discard from ',
+                    TABLE_SCHEMA, '.', TABLE_NAME, '')
+      from information_schema.TABLES where ENGINE='MyISAM'" | \
     xargs -i $MYSQL --skip-column-names --silent --batch \
                     --force -e "{}" >$tempfile
   if [ -s $tempfile ]; then






More information about the pkg-mysql-maint mailing list