1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-28651 quote(NULL) returns incorrect result in view ('NU' instead of 'NULL')

Item_func_quote did not calculate its max_length correctly for nullable
arguments.

Fix:

In case if the argument is nullable, reserve at least 4 characters
so the string "NULL" fits.
This commit is contained in:
Alexander Barkov
2024-01-23 13:22:58 +04:00
parent 5ce6a352b6
commit 81d01855fe
3 changed files with 52 additions and 0 deletions

View File

@ -2329,3 +2329,25 @@ SELECT DECODE(NULL, NULL, NULL);
--echo #
--echo # End of 10.4 tests
--echo #
--echo #
--echo # Start of 10.5 tests
--echo #
--echo #
--echo # MDEV-28651 quote(NULL) returns incorrect result in view ('NU' instead of 'NULL')
--echo #
CREATE VIEW v1 AS SELECT quote(NULL);
SELECT * FROM v1;
DESCRIBE v1;
CREATE TABLE t1 AS SELECT * FROM v1;
SHOW CREATE TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
DROP VIEW v1;
--echo #
--echo # End of 10.5 tests
--echo #