Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.4(EOL), 10.5, 10.6, 10.11, 11.0(EOL), 11.1(EOL), 11.2, 11.4, 11.5(EOL)
Description
--exec $MYSQL test -e '\C cp1256 ; DROP TABLE IF EXISTS `t`'
|
--echo # Success |
10.5 3d4174762 |
ERROR 1064 (42000) at line 1: 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 '`t' at line 1
|
mysqltest: At line 1: exec of '/10.5/client//mariadb --defaults-file=/10.5/mysql-test/var/my.cnf test -e '\C cp1256 ; DROP TABLE IF EXISTS `t`'' failed, error: 256, status: 1, errno: 11
|
The general log reveals that the server didn't receive the second backtick:
4 Connect root@localhost on test using Socket |
4 Query SET NAMES cp1256 |
4 Query DROP TABLE IF EXISTS `t |
4 Quit
|
I couldn't achieve the same effect by replacing the client \C command with SET NAMES.
The issue is not limited to the intentional explicit use of the command. The test case originates from mysqlbinlog output which I tried to replay:
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; |
/*!\C cp1256 *//*!*/; |
SET @@session.character_set_client=cp1256,@@session.collation_connection=57,@@session.collation_server=57/*!*/; |
...
|
DROP TABLE IF EXISTS `t001` /* generated by server */ |
which ended with a syntax error.
Reproducible with all existing versions, also with (at least) MySQL 8.0.35.