|
Updated versions. Also new stacks observed with this testcase.
New UniqueID's added:
UBSAN|signed integer overflow: X * Y cannot be represented in type 'long long int'|sql/sql_analyse.h|field_longlong::std|analyse::end_of_records|end_send|do_select
|
UBSAN|signed integer overflow: X * Y cannot be represented in type 'long long int'|sql/sql_analyse.h|field_longlong::std|analyse::end_of_records|end_send|sub_select
|
SET sql_mode='';
|
CREATE TABLE t (a INT) ENGINE=InnoDB;
|
INSERT INTO t VALUES ('10000000000000'),('10000000000000');
|
SELECT * FROM t PROCEDURE ANALYSE();
|
Leads to:
|
10.11.0 fe1f8f2c6b6f3b8e3383168225f9ae7853028947 (Debug)
|
/test/10.11_dbg_san/sql/sql_analyse.h:270:37: runtime error: signed integer overflow: 4294967294 * 4294967294 cannot be represented in type 'long long int'
|
|
10.11.0 fe1f8f2c6b6f3b8e3383168225f9ae7853028947 (Debug)
|
#0 0x55d9194a208b in field_longlong::std(String*, unsigned long long) /test/10.11_dbg_san/sql/sql_analyse.h:270
|
#1 0x55d919484e50 in analyse::end_of_records() /test/10.11_dbg_san/sql/sql_analyse.cc:720
|
#2 0x55d916e9de12 in end_send /test/10.11_dbg_san/sql/sql_select.cc:22963
|
#3 0x55d916dcc1ed in sub_select(JOIN*, st_join_table*, bool) /test/10.11_dbg_san/sql/sql_select.cc:21708
|
#4 0x55d916faa96c in do_select /test/10.11_dbg_san/sql/sql_select.cc:21310
|
#5 0x55d916faa96c in JOIN::exec_inner() /test/10.11_dbg_san/sql/sql_select.cc:4812
|
#6 0x55d916fac1c6 in JOIN::exec() /test/10.11_dbg_san/sql/sql_select.cc:4590
|
#7 0x55d916f99bec in mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /test/10.11_dbg_san/sql/sql_select.cc:5070
|
#8 0x55d916f9e3bd in handle_select(THD*, LEX*, select_result*, unsigned long) /test/10.11_dbg_san/sql/sql_select.cc:581
|
#9 0x55d916b22b58 in execute_sqlcom_select /test/10.11_dbg_san/sql/sql_parse.cc:6261
|
#10 0x55d916b83352 in mysql_execute_command(THD*, bool) /test/10.11_dbg_san/sql/sql_parse.cc:3945
|
#11 0x55d916af0c88 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /test/10.11_dbg_san/sql/sql_parse.cc:8035
|
#12 0x55d916b5d85f in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /test/10.11_dbg_san/sql/sql_parse.cc:1894
|
#13 0x55d916b6fa70 in do_command(THD*, bool) /test/10.11_dbg_san/sql/sql_parse.cc:1407
|
#14 0x55d9175e0b41 in do_handle_one_connection(CONNECT*, bool) /test/10.11_dbg_san/sql/sql_connect.cc:1418
|
#15 0x55d9175e332c in handle_one_connection /test/10.11_dbg_san/sql/sql_connect.cc:1312
|
#16 0x150e8eb3c608 in start_thread /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477
|
#17 0x150e8ddb1132 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x11f132)
|
Bug confirmed present in:
MariaDB: 10.3.37 (dbg), 10.3.37 (opt), 10.4.27 (dbg), 10.4.27 (opt), 10.5.18 (dbg), 10.5.18 (opt), 10.6.10 (dbg), 10.6.10 (opt), 10.7.6 (dbg), 10.7.6 (opt), 10.8.5 (dbg), 10.8.5 (opt), 10.9.2 (dbg), 10.9.2 (opt), 10.10.2 (dbg), 10.10.2 (opt), 10.11.0 (dbg), 10.11.0 (opt)
|
|
Slightly different outcome with this testcase
SET sql_mode='';
|
CREATE TABLE t (a INT,KEY a USING BTREE (a));
|
INSERT INTO t VALUES (0),('1'),('1'),('1'),('1'),('00010101'),('99991231'),('00101000000'),('691231000000'),('700101000000'),('991231235959'),('10000101000000'),('99991231235959'),('20030100000000'),('20030000000000');
|
SELECT * FROM t PROCEDURE ANALYSE();
|
Results in (note the addition of the first message):
|
10.11.0 fe1f8f2c6b6f3b8e3383168225f9ae7853028947 (Debug)
|
/test/10.11_dbg_san/sql/sql_analyse.cc:596:13: runtime error: signed integer overflow: 4631885260511346175 + 4611686014132420609 cannot be represented in type 'long long int'
|
/test/10.11_dbg_san/sql/sql_analyse.h:270:37: runtime error: signed integer overflow: 15233386865 * 15233386865 cannot be represented in type 'long long int'
|
Added
UBSAN|signed integer overflow: X + Y cannot be represented in type 'long long int'|sql/sql_analyse.cc|field_longlong::add|analyse::send_row|end_send|evaluate_join_record
|
|