Commit c18054de authored by Alexander Barkov's avatar Alexander Barkov

MDEV-10347 mysqld got signal 11

parent 554c60ab
...@@ -1572,6 +1572,23 @@ SELECT * FROM t1 WHERE NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(N ...@@ -1572,6 +1572,23 @@ SELECT * FROM t1 WHERE NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(N
i i
DROP TABLE t1; DROP TABLE t1;
# #
# MDEV-10347 mysqld got signal 11
#
CREATE TABLE t1 (f1 VARCHAR(10), f2 VARCHAR(40));
CREATE TABLE t2 (f3 VARCHAR(20));
PREPARE stmt FROM "
SELECT (
SELECT IFNULL(f3,4) FROM t2
WHERE IFNULL(NULLIF(f1,''),1)
) AS sq
FROM t1
GROUP BY f2
";
EXECUTE stmt;
sq
DEALLOCATE PREPARE stmt;
DROP TABLE t2,t1;
#
# MDEV-10236 Where expression with NOT function gives incorrect result # MDEV-10236 Where expression with NOT function gives incorrect result
# #
CREATE TABLE t1 (c1 INT); CREATE TABLE t1 (c1 INT);
......
...@@ -1006,6 +1006,23 @@ INSERT INTO t1 VALUES (1),(2); ...@@ -1006,6 +1006,23 @@ INSERT INTO t1 VALUES (1),(2);
SELECT * FROM t1 WHERE NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(i = ROUND(0), 14), 13), 12), 11), 10), 9), 8), 7), 6), 5), 4), 3), 2), 1); SELECT * FROM t1 WHERE NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(i = ROUND(0), 14), 13), 12), 11), 10), 9), 8), 7), 6), 5), 4), 3), 2), 1);
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # MDEV-10347 mysqld got signal 11
--echo #
CREATE TABLE t1 (f1 VARCHAR(10), f2 VARCHAR(40));
CREATE TABLE t2 (f3 VARCHAR(20));
PREPARE stmt FROM "
SELECT (
SELECT IFNULL(f3,4) FROM t2
WHERE IFNULL(NULLIF(f1,''),1)
) AS sq
FROM t1
GROUP BY f2
";
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
DROP TABLE t2,t1;
--echo # --echo #
--echo # MDEV-10236 Where expression with NOT function gives incorrect result --echo # MDEV-10236 Where expression with NOT function gives incorrect result
......
...@@ -1022,6 +1022,11 @@ class Item_func_nullif :public Item_func_hybrid_field_type ...@@ -1022,6 +1022,11 @@ class Item_func_nullif :public Item_func_hybrid_field_type
Item_func_hybrid_field_type(thd, a, b, a), Item_func_hybrid_field_type(thd, a, b, a),
m_cache(NULL) m_cache(NULL)
{ arg_count--; } { arg_count--; }
void cleanup()
{
Item_func_hybrid_field_type::cleanup();
arg_count= 2; // See the comment to the constructor
}
bool date_op(MYSQL_TIME *ltime, uint fuzzydate); bool date_op(MYSQL_TIME *ltime, uint fuzzydate);
double real_op(); double real_op();
longlong int_op(); longlong int_op();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment