[MDEV-18769] Assertion `fixed == 1' failed in Item_cond_or::val_int Created: 2019-02-28  Updated: 2019-04-08  Resolved: 2019-04-04

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 10.4
Fix Version/s: 10.4.4

Type: Bug Priority: Major
Reporter: Alice Sherepa Assignee: Galina Shalygina (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
PartOf
includes MDEV-18675 Server crashes in COND_EQUAL::copy Closed
includes MDEV-18937 Wrong result caused by equality pushd... Closed
includes MDEV-19025 No 'Impossible WHERE' message after p... Closed
includes MDEV-19048 Assertion `ctx.compare_type_handler()... Closed
Relates
relates to MDEV-19012 Server crashes in st_select_lex_unit:... Closed

 Description   

Reproducible on 10.4 with Innodb, not with MyIsam.

--source include/have_innodb.inc
CREATE TABLE t1 ( pk int NOT NULL PRIMARY KEY, v1 varchar(1)) ENGINE=InnoDB;
CREATE TABLE t2 ( pk int NOT NULL PRIMARY KEY, v1 varchar(1)) ENGINE=InnoDB;
 
SELECT t2.v1 FROM t2 JOIN t1 ON (t1.pk = t2.pk)
WHERE t2.v1 = 'n'
GROUP BY t2.v1 
HAVING (t2.v1 = 'd' OR t2.v1 > 's');

10.4 9bd47835d0fcdcf2f041da39

/10.4/sql/item_cmpfunc.cc:5291: virtual longlong Item_cond_or::val_int(): Assertion `fixed == 1' failed.
 
assert/assert.c:92(__assert_fail_base)[0x7f3044fd7bd7]
/lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7f3044fd7c82]
/10.4/sql/mysqld(_ZN12Item_cond_or7val_intEv+0x13c)[0x559a76703634]
sql/item_cmpfunc.cc:5292(Item_cond_or::val_int())[0x559a75c6d390]
/10.4/sql/mysqld(_ZN14Item_cache_int11cache_valueEv+0x11b)[0x559a766b89e3]
/10.4/sql/mysqld(_ZN10Item_cache9has_valueEv+0xaa)[0x559a763970ee]
sql/item.h:1499(Item::val_int_result())[0x559a766b8d2e]
sql/item.cc:9700(Item_cache_int::cache_value())[0x559a75fb43cb]
sql/item.h:6520(Item_cache::has_value())[0x559a75f745bd]
sql/item.cc:9733(Item_cache_int::val_int())[0x559a75f71cd0]
sql/sql_select.cc:11030(make_join_select(JOIN*, SQL_SELECT*, Item*))[0x559a75f6bc2f]
sql/sql_select.cc:2441(JOIN::optimize_stage2())[0x559a75f88ca1]
sql/sql_select.cc:2193(JOIN::optimize_inner())[0x559a75f5fdc0]
sql/sql_select.cc:1551(JOIN::optimize())[0x559a75ee485d]
sql/sql_select.cc:4564(mysql_select(THD*, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*))[0x559a75ed160f]
sql/sql_select.cc:424(handle_select(THD*, LEX*, select_result*, unsigned long))[0x559a75eecd3b]
sql/sql_parse.cc:6604(execute_sqlcom_select(THD*, TABLE_LIST*))[0x559a75ec57e8]
sql/sql_parse.cc:3841(mysql_execute_command(THD*))[0x559a75ec26e3]
sql/sql_parse.cc:8157(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x559a76236abe]
sql/sql_parse.cc:1831(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x559a76236488]
sql/sql_parse.cc:1358(do_command(THD*))[0x559a775f3151]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f3045e206ba]
x86_64/clone.S:111(clone)[0x7f30450b141d]
 
Query (0x62b00007e288): SELECT t2.v1 FROM t2 JOIN t1 ON (t1.pk = t2.pk) WHERE t2.v1 = 'n' GROUP BY t2.v1  HAVING (t2.v1 = 'd' OR t2.v1 > 's')



 Comments   
Comment by Igor Babaev [ 2019-03-31 ]

Ok to push into 10.4

Comment by Galina Shalygina (Inactive) [ 2019-04-04 ]

Pushed in 10.4

Generated at Thu Feb 08 08:46:35 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.