MySQL table check fails in ANSI mode

Bug #310211 reported by DonQuichote
6
Affects Status Importance Assigned to Milestone
mysql-dfsg-5.0 (Ubuntu)
Fix Released
Undecided
Dustin Kirkland 

Bug Description

Binary package hint: mysql-server-5.0

Due to non-standard escaping in /usr/share/mysql/debian-start.inc.sh the sanity check fails if MySQL is running in ANSI mode. Text strings should be enclosed in single quotes, as double quotes can mean strings (non-standard mode) or identifiers (ANSI standard mode). Fixed that in uploaded file (replacement for /usr/share/mysql/debian-start.inc.sh).

What happens is a bit hard to tell exactly, as it will only show during startup and I searched the logs for 2 hours and could not find any log entry. However, the querylog (which is on on my system) clearly showed the wrong quotation.
(snippet from the log)
                      6 Query select concat("select count(*) into @discard from `",
                    TABLE_SCHEMA, "`.`", TABLE_NAME, "`")
      from information_schema.TABLES where ENGINE="MyISAM"
(end snippet)
All the double quotes in this snippet should have been single quotes.

Revision history for this message
DonQuichote (xubuntu-w-p) wrote :
Revision history for this message
Andreas Olsson (andol) wrote :

I can confirm this problem in Intrepid.

The changes done in the attached debian-start.inc.sh does seem to solve the problem.

Changed in mysql-dfsg-5.0:
status: New → Confirmed
Revision history for this message
Andreas Olsson (andol) wrote :

I'm attaching a debdiff which applies DonQuichotes modifications to debian-start.inc.sh. Above mentioned SQL query is the only thing being modified.

It works well both with and without the ANSI sql mode. Just to be on the safe side I've also tested the new query against these sql modes: DB2, MAXDB, MSSQL, MYSQL323, MYSQL40, ORACLE, POSTGRESQL and TRADITIONAL.

Revision history for this message
Andreas Olsson (andol) wrote :

Understood that patches should foremost be submitted to the development release of Ubuntu. Hence, here is a debdiff to Jaunty.

I've run the same sql-mode tests mentioned above on a Jaunty system.

Changed in mysql-dfsg-5.0:
assignee: nobody → kirkland
status: Confirmed → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mysql-dfsg-5.0 - 5.1.30really5.0.75-0ubuntu6

---------------
mysql-dfsg-5.0 (5.1.30really5.0.75-0ubuntu6) jaunty; urgency=low

  [ Andreas Olsson <email address hidden> ]
  * Modifies debian-start.inc.sh to support ANSI mode (LP: #310211)

 -- Dustin Kirkland <email address hidden> Thu, 12 Feb 2009 14:39:04 -0600

Changed in mysql-dfsg-5.0:
status: In Progress → Fix Released
Revision history for this message
nairbv (nairbv) wrote :

This affects more than just ansi mode... I'm having essentially the same issue when setting sql-mode="ONLY_FULL_GROUP_BY" in my.cnf, running ubuntu 8.10.

bvaughan@dev1:/etc/mysql$ uname -a
Linux dev1 2.6.27-11-generic #1 SMP Wed Apr 1 20:53:41 UTC 2009 x86_64 GNU/Linux
bvaughan@dev1:/etc/mysql$ cat /proc/version
Linux version 2.6.27-11-generic (buildd@yellow) (gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu11) ) #1 SMP Wed Apr 1 20:53:41 UTC 2009
bvaughan@dev1:/etc/mysql$ mysql --version
mysql Ver 14.12 Distrib 5.0.67, for debian-linux-gnu (x86_64) using readline 5.2

bvaughan@dev1:/etc/mysql$ sudo ./debian-start
Checking for corrupt, not cleanly closed and upgrade needing tables.
bvaughan@dev1:/etc/mysql$ ERROR 1140 (42000) at line 1: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause

(that /etc/mysql/debian-start file is called when I run /etc/init.d/mysql start)

Will the fix also fix the group by queries, or is this fix only fixing the non-standard quotes?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.