mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
BUG#965872: Server crashes in embedding_sjm on a simple 1-table select with AND and OR
- This is a regession introduced by fix for BUG#951937 - The problem was that there were scenarios where check_simple_equality() would create an Item_equal object but would not call item_equal->set_context_field() on it. - The fix was to add the missing calls.
This commit is contained in:
@ -1044,6 +1044,15 @@ y y
|
|||||||
DROP VIEW v1;
|
DROP VIEW v1;
|
||||||
DROP TABLE t1, t2;
|
DROP TABLE t1, t2;
|
||||||
#
|
#
|
||||||
|
# BUG#965872: Server crashes in embedding_sjm on a simple 1-table select with AND and OR
|
||||||
|
# (this is a regression caused by the fix for BUG#951937)
|
||||||
|
CREATE TABLE t1 ( a INT, b INT, c INT, d INT );
|
||||||
|
INSERT INTO t1 VALUES (4,2,8,9),(4,2,7,8);
|
||||||
|
SELECT * FROM t1
|
||||||
|
WHERE a = d AND ( b = 50 AND b = d OR a = c );
|
||||||
|
a b c d
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
# BUG#951283: Wrong result (missing rows) with semijoin+firstmatch, IN/ANY subquery
|
# BUG#951283: Wrong result (missing rows) with semijoin+firstmatch, IN/ANY subquery
|
||||||
#
|
#
|
||||||
set @tmp_951283=@@optimizer_prune_level;
|
set @tmp_951283=@@optimizer_prune_level;
|
||||||
|
@ -1058,6 +1058,15 @@ y y
|
|||||||
DROP VIEW v1;
|
DROP VIEW v1;
|
||||||
DROP TABLE t1, t2;
|
DROP TABLE t1, t2;
|
||||||
#
|
#
|
||||||
|
# BUG#965872: Server crashes in embedding_sjm on a simple 1-table select with AND and OR
|
||||||
|
# (this is a regression caused by the fix for BUG#951937)
|
||||||
|
CREATE TABLE t1 ( a INT, b INT, c INT, d INT );
|
||||||
|
INSERT INTO t1 VALUES (4,2,8,9),(4,2,7,8);
|
||||||
|
SELECT * FROM t1
|
||||||
|
WHERE a = d AND ( b = 50 AND b = d OR a = c );
|
||||||
|
a b c d
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
# BUG#951283: Wrong result (missing rows) with semijoin+firstmatch, IN/ANY subquery
|
# BUG#951283: Wrong result (missing rows) with semijoin+firstmatch, IN/ANY subquery
|
||||||
#
|
#
|
||||||
set @tmp_951283=@@optimizer_prune_level;
|
set @tmp_951283=@@optimizer_prune_level;
|
||||||
|
@ -1046,6 +1046,15 @@ y y
|
|||||||
DROP VIEW v1;
|
DROP VIEW v1;
|
||||||
DROP TABLE t1, t2;
|
DROP TABLE t1, t2;
|
||||||
#
|
#
|
||||||
|
# BUG#965872: Server crashes in embedding_sjm on a simple 1-table select with AND and OR
|
||||||
|
# (this is a regression caused by the fix for BUG#951937)
|
||||||
|
CREATE TABLE t1 ( a INT, b INT, c INT, d INT );
|
||||||
|
INSERT INTO t1 VALUES (4,2,8,9),(4,2,7,8);
|
||||||
|
SELECT * FROM t1
|
||||||
|
WHERE a = d AND ( b = 50 AND b = d OR a = c );
|
||||||
|
a b c d
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
# BUG#951283: Wrong result (missing rows) with semijoin+firstmatch, IN/ANY subquery
|
# BUG#951283: Wrong result (missing rows) with semijoin+firstmatch, IN/ANY subquery
|
||||||
#
|
#
|
||||||
set @tmp_951283=@@optimizer_prune_level;
|
set @tmp_951283=@@optimizer_prune_level;
|
||||||
|
@ -1175,6 +1175,16 @@ SELECT * FROM t2
|
|||||||
DROP VIEW v1;
|
DROP VIEW v1;
|
||||||
DROP TABLE t1, t2;
|
DROP TABLE t1, t2;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # BUG#965872: Server crashes in embedding_sjm on a simple 1-table select with AND and OR
|
||||||
|
--echo # (this is a regression caused by the fix for BUG#951937)
|
||||||
|
CREATE TABLE t1 ( a INT, b INT, c INT, d INT );
|
||||||
|
INSERT INTO t1 VALUES (4,2,8,9),(4,2,7,8);
|
||||||
|
|
||||||
|
SELECT * FROM t1
|
||||||
|
WHERE a = d AND ( b = 50 AND b = d OR a = c );
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # BUG#951283: Wrong result (missing rows) with semijoin+firstmatch, IN/ANY subquery
|
--echo # BUG#951283: Wrong result (missing rows) with semijoin+firstmatch, IN/ANY subquery
|
||||||
--echo #
|
--echo #
|
||||||
|
@ -10788,6 +10788,7 @@ static bool check_simple_equality(Item *left_item, Item *right_item,
|
|||||||
Item_equal *item_equal= new Item_equal(orig_left_item,
|
Item_equal *item_equal= new Item_equal(orig_left_item,
|
||||||
orig_right_item,
|
orig_right_item,
|
||||||
FALSE);
|
FALSE);
|
||||||
|
item_equal->set_context_field((Item_field*)left_item);
|
||||||
cond_equal->current_level.push_back(item_equal);
|
cond_equal->current_level.push_back(item_equal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -10858,6 +10859,7 @@ static bool check_simple_equality(Item *left_item, Item *right_item,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
item_equal= new Item_equal(const_item, orig_field_item, TRUE);
|
item_equal= new Item_equal(const_item, orig_field_item, TRUE);
|
||||||
|
item_equal->set_context_field(field_item);
|
||||||
cond_equal->current_level.push_back(item_equal);
|
cond_equal->current_level.push_back(item_equal);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
Reference in New Issue
Block a user