mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
BUG#17047: CHAR() and IN() can return NULL without signaling NULL result
The problem was that some functions (namely IN() starting with 4.1, and CHAR() starting with 5.0) were returning NULL in certain conditions, while they didn't set their maybe_null flag. Because of that there could be some problems with 'IS NULL' check, and statements that depend on the function value domain, like CREATE TABLE t1 SELECT 1 IN (2, NULL);. The fix is to set maybe_null correctly.
This commit is contained in:
@ -202,3 +202,11 @@ select count(*) from t1 where id not in (1,2);
|
||||
count(*)
|
||||
1
|
||||
drop table t1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 SELECT 1 IN (2, NULL);
|
||||
SELECT should return NULL.
|
||||
SELECT * FROM t1;
|
||||
1 IN (2, NULL)
|
||||
NULL
|
||||
DROP TABLE t1;
|
||||
End of 4.1 tests
|
||||
|
Reference in New Issue
Block a user