1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-12846 sql_mode=ORACLE: using Oracle-style placeholders in direct query execution makes the server crash

This commit is contained in:
Alexander Barkov
2017-11-15 14:18:46 +04:00
parent 765452dbef
commit b8f906dd4b
3 changed files with 39 additions and 0 deletions

View File

@ -247,3 +247,18 @@ DROP PROCEDURE p1;
#
# End of MDEV-10866 Extend PREPARE and EXECUTE IMMEDIATE to understand expressions
#
#
# MDEV-12846 sql_mode=ORACLE: using Oracle-style placeholders in direct query execution makes the server crash
#
SELECT ? FROM DUAL;
ERROR 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 '? FROM DUAL' at line 1
SELECT :a FROM DUAL;
ERROR 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 FROM DUAL' at line 1
SELECT :1 FROM DUAL;
ERROR 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 ':1 FROM DUAL' at line 1
SELECT 1+? FROM DUAL;
ERROR 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 '? FROM DUAL' at line 1
SELECT 1+:a FROM DUAL;
ERROR 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 FROM DUAL' at line 1
SELECT 1+:1 FROM DUAL;
ERROR 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 ':1 FROM DUAL' at line 1

View File

@ -264,3 +264,22 @@ DROP PROCEDURE p1;
--echo #
--echo # End of MDEV-10866 Extend PREPARE and EXECUTE IMMEDIATE to understand expressions
--echo #
--echo #
--echo # MDEV-12846 sql_mode=ORACLE: using Oracle-style placeholders in direct query execution makes the server crash
--echo #
--error ER_PARSE_ERROR
SELECT ? FROM DUAL;
--error ER_PARSE_ERROR
SELECT :a FROM DUAL;
--error ER_PARSE_ERROR
SELECT :1 FROM DUAL;
--error ER_PARSE_ERROR
SELECT 1+? FROM DUAL;
--error ER_PARSE_ERROR
SELECT 1+:a FROM DUAL;
--error ER_PARSE_ERROR
SELECT 1+:1 FROM DUAL;