[MDEV-27988] Unknown commands in the mariadb client do not terminate input processing Created: 2022-03-03  Updated: 2022-03-03

Status: Open
Project: MariaDB Server
Component/s: Scripts & Clients
Affects Version/s: 10.6.7
Fix Version/s: None

Type: Bug Priority: Major
Reporter: markus makela Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

All unknown characters, including multi-byte unicode ones, after the initial backslash appear to not interrupt the input processing like known commands do.

MariaDB [test]> \a
ERROR: Unknown command '\a'.
    -> \s
--------------
mysql  Ver 15.1 Distrib 10.6.7-MariaDB, for Linux (x86_64) using  EditLine wrapper
 
Connection id:		23
Current database:	test
Current user:		maxuser@127.0.0.1
SSL:			Not in use
Current pager:		stdout
Using outfile:		''
Using delimiter:	;
Server:			MariaDB
Server version:		10.6.5-MariaDB-1:10.6.5+maria~focal-log mariadb.org binary distribution
Protocol version:	10
Connection:		127.0.0.1 via TCP/IP
Server characterset:	utf8mb4
Db     characterset:	utf8mb4
Client characterset:	utf8mb3
Conn.  characterset:	utf8mb3
TCP port:		3000
Uptime:			21 min 7 sec
 
Threads: 7  Questions: 1042  Slow queries: 0  Opens: 39  Open tables: 33  Queries per second avg: 0.822
--------------
 
    -> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '\a' at line 1

Even more interestingly, it seems to keep both collecting the result as well as parse it for any new commands:

MariaDB [test]> \a
ERROR: Unknown command '\a'.
    -> \p
--------------
\a
--------------
 
    -> \p
--------------
\a
 
--------------
 
    -> \p
--------------
\a
 
 
--------------
 
    -> \p
--------------
\a
 
 
 
--------------
 
    -> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '\a' at line 1

This results in some confusing situations where you don't know why the client expects more input when normally it would stop after a backslash command.


Generated at Thu Feb 08 09:57:12 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.