[Toolserver-l] MySQL-CLI and comments
DaB.
WP at daniel.baur4.info
Mon Aug 22 20:52:12 UTC 2011
Hello all,
the following message is only interesting for people who uses the MySQL-CLI
(the "mysql"-command on the command-line) or the "sql"-script. It doesn't
matter if you use php, perl, phyton, java or other languages.
The problem is that the mysql-cli strips out comments by default (see
bugreport [1]). That is bad for us, because it strips all SLOW_OK or LIMIT:
too; so if you add a SLOW_OK at the mysql-cli it will stript out and the
query-killer will kill it sooner. To prevent this, I changed the mysql-config
in a way that comments will NOT be stripted yesterday [2] .
In the last hour a user told me, that this has a problematic side-effect: if
you use /* foobar */ in a mysql-file OUTSIDE of a query, the file will fail; the
user was angry because I changed the default without telling.
I still think that the mysql-default (to strip comments) is stupid (because in
my eyes the user doesn't expect that comments he/she inserts will be removed).
So here is my plan: I will revert my changes for now (so the mysql-cli will
strip comments again). And I hereby announce that I'm going to change the
default at wednesday, the 31. August, in a way that comments will NOT the
striped out.
You what that means for you:
-If you don't use comments at the mysql-cli: nothing.
-If you use comments at the mysql-cli: You have to add the following lines to
,your .my.cnf-file (you can find this hidden file in your home – please notice
the "." at the start):
--snip--
[mysql]
comments
--snap--
-If you need the default of the mysql-cli after the 31. August, you have to
add the following lines to your .my.cnf:
--snip--
[mysql]
skip-comments
--snap--
My revert will not affect the "sql"-script (our recommend way to uise myql on
the command-line): It will still not strip the comments.
Please feel free to discuss this and ask for details on the mailinglist.
Sincerly,
DaB.
[1] http://bugs.mysql.com/bug.php?id=26215
[2] https://jira.toolserver.org/browse/MNT-1072
--
Userpage: [[:w:de:User:DaB.]] — PGP: 2B255885
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://lists.wikimedia.org/pipermail/toolserver-l/attachments/20110822/577d78d1/attachment.pgp
More information about the Toolserver-l
mailing list