[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 18:20:49 UTC 2009


Please ignore the previous patch. I was ignoring the relevance of 
escaping tables and columns with ` ` for "bad" names.

This next one takes name escaping into account:

--- debian-start.inc.sh.orig    2009-01-06 14:51:44.000000000 +0000
+++ debian-start.inc.sh.ansi    2009-01-06 18:08:06.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