Bug #117833 Incorrect parse the query
Submitted: 30 Mar 15:29 Modified: 1 Apr 10:34
Reporter: Anilton Neto Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:9.2.0 OS:Ubuntu
Assigned to: CPU Architecture:Any

[30 Mar 15:29] Anilton Neto
Description:
Hello guys,

Hope you are well.

I'm seeding this report to tell that i found a situation where mysql terminal misbehave the statement.

At the beginning i was expect that the parser would return an error in order to interpret correctly the statement instead it runs que query and return an error.

I'm using mysql 9.2.0 version from docker container.

How to repeat:
creates a book table, insert data and then execute query bellow.

select * from books \G limit 100;

As a result I have:

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 'limit 100' at line 1

Suggested fix:
Since the parser misbehave the real meaning of \G and the end of the statements I would suggest to return an error before even execute.
[31 Mar 9:01] MySQL Verification Team
This is not a bug.  \G and  \g and; are  statement terminators in the mysql client.  It is working as expected. "limit 100" is not a valid SQL statement.
[31 Mar 9:03] MySQL Verification Team
mysql> select 1 \G limit 1;
*************************** 1. row ***************************
1: 1
1 row in set (0.00 sec)

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 'limit 1' at line 1
mysql> select 1 \G select 2;
*************************** 1. row ***************************
1: 1
1 row in set (0.00 sec)

+---+
| 2 |
+---+
| 2 |
+---+
1 row in set (0.00 sec)

mysql>
mysql>
[1 Apr 10:34] Anilton Neto
Okey, you're saying that I can have multiple query using using \G or \g at the same time? 

Can you please provide any detail about that?