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

MDEV-5655 Server crashes on NAME_CONST containing AND/OR expressions

fix the NAME_CONST check to only allow literals, negated literals, and literals with
the explicit collation.
This commit is contained in:
Sergei Golubchik
2014-02-12 21:17:28 +01:00
parent 16e0cae0cc
commit 52f038c5c3
3 changed files with 38 additions and 10 deletions

View File

@ -265,3 +265,10 @@ SELECT '1' IN ('1', INET_NTOA(0));
'1' IN ('1', INET_NTOA(0))
1
End of tests
SELECT NAME_CONST('a', -(1 OR 2)) OR 1;
ERROR HY000: Incorrect arguments to NAME_CONST
SELECT NAME_CONST('a', -(1 AND 2)) AND 1;
ERROR HY000: Incorrect arguments to NAME_CONST
SELECT NAME_CONST('a', -(1)) OR 1;
NAME_CONST('a', -(1)) OR 1
1