Description:
From manual: "delimiter (\d) Set statement delimiter. NOTE: Takes the rest of the line as new delimiter."
When delimiter contains space, only first word is used.
Example: "delimiter $$ $$" sets the delimiter to "$$". But "delimiter $$ $$" sets the delimiter to "$$ $$" - this is correct (TAB used here).
How to repeat:
Use the following script to reproduce the problem (notice that TAB character is used in first case):
status
delimiter $$ $$
select user from mysql.user$$ $$
delimiter $$ $$
select user from mysql.user$$ $$
mysql command line client output:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 17
Server version: 5.0.45-community-nt-log MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
localhost>status
--------------
mysql Ver 14.12 Distrib 5.0.45, for Win32 (ia32)
Connection id: 17
Current database: test
Current user: root@localhost
SSL: Not in use
Using delimiter: ;
Server version: 5.0.45-community-nt-log MySQL Community Edition (GPL)
Protocol version: 10
Connection: Shared memory: MYSQL
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
TCP port: 3306
Uptime: 1 hour 21 min 45 sec
Threads: 8 Questions: 230 Slow queries: 0 Opens: 47 Flush tables: 1 Open tables: 1 Queries per second avg: 0.047
--------------
localhost>delimiter $$ $$
localhost>select user from mysql.user$$ $$
+------+
| user |
+------+
| root |
| root |
| root |
| root |
+------+
4 rows in set (0.00 sec)
localhost>delimiter $$ $$
localhost>select user from mysql.user$$ $$
+------+
| user |
+------+
| root |
| root |
| root |
| root |
+------+
4 rows in set (0.00 sec)
ERROR:
No query specified
localhost>