Skip to content

Commit 417f183

Browse files
committed
Bug#21383714: Assertion failed: !thd->is_error() in select_lex::prepare()
The problem is caused by a missing error check after calling fix_length_and_dec() in Item_sum_hybrid::fix_fields().
1 parent 5967ab5 commit 417f183

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

mysql-test/suite/gis/r/gis_bugs_crashes.result

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6508,3 +6508,8 @@ ST_GeomFromText('MULTIPOLYGON(((-40.314872143936725 -85.6567579487603,-53.147364
65086508
'-41.29168745244485 -90.56754012573627,-40.314872143936725 -85.6567579487603)), '
65096509

65106510
1
6511+
# BUG#21383714: Assertion failed: !thd->is_error() in select_lex::prepare
6512+
CREATE TABLE t(a INTEGER);
6513+
SELECT 1 FROM t WHERE 1 > SOME (SELECT POINT(1,1) FROM t);
6514+
ERROR HY000: Incorrect arguments to min(
6515+
DROP TABLE t;

mysql-test/suite/gis/t/gis_bugs_crashes.test

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6333,3 +6333,11 @@ SELECT ST_IsValid(
63336333
'((-2.6035109435630504 -13.058121512403435,26.839412016794036 43.97610638055074, '
63346334
'26.974733141577826 43.72289807427111,26.97470368529088 43.722907009738066, '
63356335
'-2.6035109435630504 -13.058121512403435)))'));
6336+
6337+
--echo # BUG#21383714: Assertion failed: !thd->is_error() in select_lex::prepare
6338+
6339+
CREATE TABLE t(a INTEGER);
6340+
--error ER_WRONG_ARGUMENTS
6341+
SELECT 1 FROM t WHERE 1 > SOME (SELECT POINT(1,1) FROM t);
6342+
DROP TABLE t;
6343+

sql/item_sum.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,6 +1326,8 @@ Item_sum_hybrid::fix_fields(THD *thd, Item **ref)
13261326
result_field=0;
13271327
null_value=1;
13281328
fix_length_and_dec();
1329+
if (thd->is_error())
1330+
return true;
13291331
item= item->real_item();
13301332
if (item->type() == Item::FIELD_ITEM)
13311333
hybrid_field_type= ((Item_field*) item)->field->type();

0 commit comments

Comments
 (0)