Hi!
This is not a big issue,
but it should be corrected one day.
Jan
>Description:
The mysql client thinks that quotes and apostrophes
within comments delimit a string literal,
but that is not necessarily true.
>How-To-Repeat:
mysql> /* Let us see - this is o.k. */
-> select version();
+--------------------+
| version() |
+--------------------+
| 3.23.12c-alpha-log |
+--------------------+
1 row in set (0.04 sec)
mysql>
mysql> /* Let's see - this will fail */
'> select version();
'>
The apostrophe in the comment is not ignored.
Instead, the client thinks we're within a string literal.
mysql> /* My 19" monitor is a nice one - this will also fail */
"> select version();
">
So the quote misbehaves similarly.
>Fix:
Reverse the priorities:
First handle comments, then literal string delimiters.
However, the current behavior is o.k. for the /*!version sql_chunk */ .
(I currently don't have the time to look at it myself, sorry.)
>Submitter-Id: jan.dvorak@stripped
>Originator: Jan Dvorak
>Organization:
MathAn Praha, Ltd., CZ.
>MySQL support: none
>Synopsis: Apostrophes and quotes within a comment confuse the mysql client
>Severity: non-critical
>Priority: medium
>Category: mysql
>Class: sw-bug
>Release: mysql-3.23.12c-alpha (Source distribution)
>Server: /usr/bin/mysqladmin Ver 8.0 Distrib 3.23.12c-alpha, for pc-linux-gnu on i686
TCX Datakonsult AB, by Monty
Server version 3.23.12c-alpha-log
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/lib/mysql/mysql.sock
Uptime: 1 day 1 hour 32 min 33 sec
Threads: 3 Questions: 545 Slow queries: 25 Opens: 343 Flush tables: 1 Open tables: 8
>Environment:
System: Linux medved.mathan.cz 2.2.13 #2 SMP Thu Dec 16 09:47:45 CET 1999 i686 unknown
Architecture: i686
Some paths: /usr/bin/perl /usr/bin/make /usr/bin/gmake /usr/bin/gcc /usr/bin/cc
GCC: Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
Compilation info: CC='gcc' CFLAGS='' CXX='c++' CXXFLAGS='' LDFLAGS=''
LIBC:
lrwxrwxrwx 1 root root 13 Jun 9 1999 /lib/libc.so.6 -> libc-2.1.1.so
-rwxr-xr-x 1 root root 4016683 Apr 17 1999 /lib/libc-2.1.1.so
-rw-r--r-- 1 root root 19533408 Apr 17 1999 /usr/lib/libc.a
-rw-r--r-- 1 root root 178 Apr 17 1999 /usr/lib/libc.so
Configure command: ./configure --disable-shared --with-mysqld-ldflags=-all-static
--with-client-ldflags=-all-static --enable-assembler --with-mysqld-user=mysql
--with-unix-socket-path=/var/lib/mysql/mysql.sock --prefix=/ --exec-prefix=/usr
--libexecdir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share
--localstatedir=/var/lib/mysql --infodir=/usr/info --includedir=/usr/include
--mandir=/usr/man --with-charset=czech
Perl: This is perl, version 5.005_03 built for i386-linux