Bug #53470 DELIMITER doesn't recognize delimiters with \
Submitted: 6 May 2010 20:58 Modified: 7 Jun 2010 6:48
Reporter: Alfredo Kojima Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S4 (Feature request)
Version:5.2 OS:Any
Assigned to: CPU Architecture:Any

[6 May 2010 20:58] Alfredo Kojima
Description:
In SQL editor, DELIMITER with \ don't work, although it works with other characters.
\g somehow seems to be used in some scripts (its supported in cmdline client), so it would
be nice if it worked.

How to repeat:
DELIMITER \g
SELECT 1\g
SELECT 2\g

Get error.

Suggested fix:
-
[7 May 2010 3:21] Valeriy Kravchuk
On Mac, for example, mysql command line client also produces error:

mysql> delimiter \g
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delimiter' at line 1
[7 May 2010 6:48] Valeriy Kravchuk
Actually, \g does not work in mysql client on Windows also:

C:\Program Files\MySQL\MySQL Server 5.1\bin>mysql -uroot -proot -P3310 test
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 27
Server version: 5.1.46-community MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> delimiter \g
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'delim
iter' at line 1

So, my question is: why should WB support this combination of characters as a delimiter and what script sets it explicitly? It is just a short version of "go" command in mysql command line client:

...
go        (\g) Send command to mysql server.
help      (\h) Display this help.
notee     (\t) Don't write into outfile.
print     (\p) Print current command.
prompt    (\R) Change your mysql prompt.
quit      (\q) Quit mysql.
rehash    (\#) Rebuild completion hash.
source    (\.) Execute an SQL script file. Takes a file name as an argument.
status    (\s) Get status information from the server.
tee       (\T) Set outfile [to_outfile]. Append everything into given outfile.
use       (\u) Use another database. Takes database name as argument.
charset   (\C) Switch to another charset. Might be needed for processing binlog
with multi-byte charsets.
warnings  (\W) Show warnings after every statement.
nowarning (\w) Don't show warnings after every statement.

For server side help, type 'help contents'

mysql> select 1\g
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.00 sec)
[7 Jun 2010 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".