#8 0x0000560b79aa0d58 in Diagnostics_area::set_error_status (this=this@entry=0x14a9bb01ab88, sql_errno=sql_errno@entry=1931, message=message@entry=0x14a9ddda0880 "Query execution was interrupted. The query examined at least 1 rows, which exceeds LIMIT ROWS EXAMINED (0). The query result may be incomplete", sqlstate=sqlstate@entry=0x560b7a77ea08 "HY000", ucid=..., error_condition=0x0) at /test/10.5_dbg/sql/sql_error.cc:445
#9 0x0000560b79a832e2 in THD::raise_condition (this=this@entry=0x14a9bb015088, sql_errno=sql_errno@entry=1931, sqlstate=0x560b7a77ea08 "HY000", sqlstate@entry=0x0, level=<optimized out>, level@entry=Sql_state_errno_level::WARN_LEVEL_WARN, ucid=..., msg=msg@entry=0x14a9ddda0880 "Query execution was interrupted. The query examined at least 1 rows, which exceeds LIMIT ROWS EXAMINED (0). The query result may be incomplete") at /test/10.5_dbg/sql/sql_class.cc:1132
#10 0x0000560b79aa1c9f in THD::raise_condition (msg=0x14a9ddda0880 "Query execution was interrupted. The query examined at least 1 rows, which exceeds LIMIT ROWS EXAMINED (0). The query result may be incomplete", level=Sql_state_errno_level::WARN_LEVEL_WARN, sqlstate=0x0, sql_errno=1931, this=0x14a9bb015088) at /test/10.5_dbg/sql/sql_class.h:4498
#11 push_warning (thd=thd@entry=0x14a9bb015088, level=level@entry=Sql_state_errno_level::WARN_LEVEL_WARN, code=code@entry=1931, msg=msg@entry=0x14a9ddda0880 "Query execution was interrupted. The query examined at least 1 rows, which exceeds LIMIT ROWS EXAMINED (0). The query result may be incomplete") at /test/10.5_dbg/sql/sql_error.cc:715
#12 0x0000560b79aa1ee8 in push_warning_printf (thd=thd@entry=0x14a9bb015088, level=level@entry=Sql_state_errno_level::WARN_LEVEL_WARN, code=code@entry=1931, format=0x560b7a8e1758 "Query execution was interrupted. The query examined at least %llu rows, which exceeds LIMIT ROWS EXAMINED (%llu). The query result may be incomplete") at /test/10.5_dbg/sql/sql_error.cc:750
#13 0x0000560b79b66f55 in handle_select (thd=thd@entry=0x14a9bb015088, lex=lex@entry=0x14a9bb018fd0, result=result@entry=0x14a9bb075ed8, setup_tables_done_option=setup_tables_done_option@entry=1073741824) at /test/10.5_dbg/sql/sql_select.cc:442
#14 0x0000560b79aec9f8 in mysql_execute_command (thd=thd@entry=0x14a9bb015088) at /test/10.5_dbg/sql/sql_parse.cc:4661
#15 0x0000560b79af7804 in mysql_parse (thd=thd@entry=0x14a9bb015088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14a9ddda13e0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:7957
#16 0x0000560b79ae3ffd in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14a9bb015088, packet=packet@entry=0x14a9bb067089 "INSERT INTO t SELECT a FROM t LIMIT ROWS EXAMINED 0", packet_length=packet_length@entry=51, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:1839
#17 0x0000560b79ae28cc in do_command (thd=0x14a9bb015088) at /test/10.5_dbg/sql/sql_parse.cc:1358
#18 0x0000560b79c3c99d in do_handle_one_connection (connect=<optimized out>, connect@entry=0x14a9bcc433a8, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1411
#19 0x0000560b79c3d0b9 in handle_one_connection (arg=arg@entry=0x14a9bcc433a8) at /test/10.5_dbg/sql/sql_connect.cc:1313
#20 0x0000560b7a09b10a in pfs_spawn_thread (arg=0x14a9db845888) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
#21 0x000014a9dd1c96db in start_thread (arg=0x14a9ddda2700) at pthread_create.c:463
#22 0x000014a9dc5c788f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Roel Van de Paar
added a comment - - edited
USE test;
CREATE TABLE t(a INT);
INSERT INTO t VALUES(0);
INSERT INTO t SELECT a FROM t LIMIT ROWS EXAMINED 0;
Leads to:
10.5.3 cfe5ee90c8e4b9dfa98a41fcd299197a59261be7
mysqld: /test/10.5_dbg/sql/sql_error.cc:445: void Diagnostics_area::set_error_status(uint, const char*, const char*, const Sql_user_condition_identity&, const Sql_condition*): Assertion `! is_set() || m_can_overwrite_status' failed.
10.5.3 cfe5ee90c8e4b9dfa98a41fcd299197a59261be7
Core was generated by `/test/MD110520-mariadb-10.5.3-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
Program terminated with signal SIGABRT, Aborted.
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
[Current thread is 1 (Thread 0x14a9ddda2700 (LWP 276420))]
(gdb) bt
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
#1 0x0000560b7a5eec11 in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:518
#2 0x0000560b79d93f8d in handle_fatal_signal (sig=6) at /test/10.5_dbg/sql/signal_handler.cc:329
#3 <signal handler called>
#4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#5 0x000014a9dc4e6801 in __GI_abort () at abort.c:79
#6 0x000014a9dc4d639a in __assert_fail_base (fmt=0x14a9dc65d7d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x560b7a75d150 "! is_set() || m_can_overwrite_status", file=file@entry=0x560b7a75d0c0 "/test/10.5_dbg/sql/sql_error.cc", line=line@entry=445, function=function@entry=0x560b7a75db60 <Diagnostics_area::set_error_status(unsigned int, char const*, char const*, Sql_user_condition_identity const&, Sql_condition const*)::__PRETTY_FUNCTION__> "void Diagnostics_area::set_error_status(uint, const char*, const char*, const Sql_user_condition_identity&, const Sql_condition*)") at assert.c:92
#7 0x000014a9dc4d6412 in __GI___assert_fail (assertion=assertion@entry=0x560b7a75d150 "! is_set() || m_can_overwrite_status", file=file@entry=0x560b7a75d0c0 "/test/10.5_dbg/sql/sql_error.cc", line=line@entry=445, function=function@entry=0x560b7a75db60 <Diagnostics_area::set_error_status(unsigned int, char const*, char const*, Sql_user_condition_identity const&, Sql_condition const*)::__PRETTY_FUNCTION__> "void Diagnostics_area::set_error_status(uint, const char*, const char*, const Sql_user_condition_identity&, const Sql_condition*)") at assert.c:101
#8 0x0000560b79aa0d58 in Diagnostics_area::set_error_status (this=this@entry=0x14a9bb01ab88, sql_errno=sql_errno@entry=1931, message=message@entry=0x14a9ddda0880 "Query execution was interrupted. The query examined at least 1 rows, which exceeds LIMIT ROWS EXAMINED (0). The query result may be incomplete", sqlstate=sqlstate@entry=0x560b7a77ea08 "HY000", ucid=..., error_condition=0x0) at /test/10.5_dbg/sql/sql_error.cc:445
#9 0x0000560b79a832e2 in THD::raise_condition (this=this@entry=0x14a9bb015088, sql_errno=sql_errno@entry=1931, sqlstate=0x560b7a77ea08 "HY000", sqlstate@entry=0x0, level=<optimized out>, level@entry=Sql_state_errno_level::WARN_LEVEL_WARN, ucid=..., msg=msg@entry=0x14a9ddda0880 "Query execution was interrupted. The query examined at least 1 rows, which exceeds LIMIT ROWS EXAMINED (0). The query result may be incomplete") at /test/10.5_dbg/sql/sql_class.cc:1132
#10 0x0000560b79aa1c9f in THD::raise_condition (msg=0x14a9ddda0880 "Query execution was interrupted. The query examined at least 1 rows, which exceeds LIMIT ROWS EXAMINED (0). The query result may be incomplete", level=Sql_state_errno_level::WARN_LEVEL_WARN, sqlstate=0x0, sql_errno=1931, this=0x14a9bb015088) at /test/10.5_dbg/sql/sql_class.h:4498
#11 push_warning (thd=thd@entry=0x14a9bb015088, level=level@entry=Sql_state_errno_level::WARN_LEVEL_WARN, code=code@entry=1931, msg=msg@entry=0x14a9ddda0880 "Query execution was interrupted. The query examined at least 1 rows, which exceeds LIMIT ROWS EXAMINED (0). The query result may be incomplete") at /test/10.5_dbg/sql/sql_error.cc:715
#12 0x0000560b79aa1ee8 in push_warning_printf (thd=thd@entry=0x14a9bb015088, level=level@entry=Sql_state_errno_level::WARN_LEVEL_WARN, code=code@entry=1931, format=0x560b7a8e1758 "Query execution was interrupted. The query examined at least %llu rows, which exceeds LIMIT ROWS EXAMINED (%llu). The query result may be incomplete") at /test/10.5_dbg/sql/sql_error.cc:750
#13 0x0000560b79b66f55 in handle_select (thd=thd@entry=0x14a9bb015088, lex=lex@entry=0x14a9bb018fd0, result=result@entry=0x14a9bb075ed8, setup_tables_done_option=setup_tables_done_option@entry=1073741824) at /test/10.5_dbg/sql/sql_select.cc:442
#14 0x0000560b79aec9f8 in mysql_execute_command (thd=thd@entry=0x14a9bb015088) at /test/10.5_dbg/sql/sql_parse.cc:4661
#15 0x0000560b79af7804 in mysql_parse (thd=thd@entry=0x14a9bb015088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14a9ddda13e0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:7957
#16 0x0000560b79ae3ffd in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14a9bb015088, packet=packet@entry=0x14a9bb067089 "INSERT INTO t SELECT a FROM t LIMIT ROWS EXAMINED 0", packet_length=packet_length@entry=51, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:1839
#17 0x0000560b79ae28cc in do_command (thd=0x14a9bb015088) at /test/10.5_dbg/sql/sql_parse.cc:1358
#18 0x0000560b79c3c99d in do_handle_one_connection (connect=<optimized out>, connect@entry=0x14a9bcc433a8, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1411
#19 0x0000560b79c3d0b9 in handle_one_connection (arg=arg@entry=0x14a9bcc433a8) at /test/10.5_dbg/sql/sql_connect.cc:1313
#20 0x0000560b7a09b10a in pfs_spawn_thread (arg=0x14a9db845888) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
#21 0x000014a9dd1c96db in start_thread (arg=0x14a9ddda2700) at pthread_create.c:463
#22 0x000014a9dc5c788f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Bug confirmed present in:
MariaDB: 10.2.32 (dbg), 10.3.23 (dbg), 10.4.13 (dbg), 10.5.2 (dbg), 10.5.3 (dbg), 10.5.4 (dbg)
Bug confirmed not present in:
MariaDB: 10.1.45 (dbg), 10.1.45 (opt), 10.2.32 (opt), 10.3.23 (opt), 10.4.13 (opt), 10.5.2 (opt), 10.5.3 (opt), 10.5.4 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.47 (dbg), 5.6.47 (opt), 5.7.29 (dbg), 5.7.29 (opt), 8.0.19 (dbg), 8.0.19 (opt)
Message: Query execution was interrupted. The query examined at least 2 rows, which exceeds LIMIT ROWS EXAMINED (0). The query result may be incomplete.
1 row in set (0.00 sec)
Roel Van de Paar
added a comment - - edited MariaDB 10.1.45 (debug) works correctly, or differently;
10.1.45>INSERT INTO t SELECT a FROM t LIMIT ROWS EXAMINED 0;
Query OK, 0 rows affected, 1 warning (0.00 sec)
Records: 0 Duplicates: 0 Warnings: 0
10.1.45>show warnings\G
*************************** 1. row ***************************
Level: Warning
Code: 1931
Message: Query execution was interrupted. The query examined at least 2 rows, which exceeds LIMIT ROWS EXAMINED (0). The query result may be incomplete.
1 row in set (0.00 sec)
Rucha Deodhar
added a comment - - edited Updated Patch according to review:
https://github.com/MariaDB/server/commit/93a6e37b52ca33637e15abd65ab801ff726e851c
USE test;
CREATE TABLE t(a INT);
INSERT INTO t VALUES(0);
INSERT INTO t SELECT a FROM t LIMIT ROWS EXAMINED 0;
Leads to:
10.5.3 cfe5ee90c8e4b9dfa98a41fcd299197a59261be7
mysqld: /test/10.5_dbg/sql/sql_error.cc:445: void Diagnostics_area::set_error_status(uint, const char*, const char*, const Sql_user_condition_identity&, const Sql_condition*): Assertion `! is_set() || m_can_overwrite_status' failed.
10.5.3 cfe5ee90c8e4b9dfa98a41fcd299197a59261be7
Core was generated by `/test/MD110520-mariadb-10.5.3-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
Program terminated with signal SIGABRT, Aborted.
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
[Current thread is 1 (Thread 0x14a9ddda2700 (LWP 276420))]
(gdb) bt
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
#1 0x0000560b7a5eec11 in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:518
#2 0x0000560b79d93f8d in handle_fatal_signal (sig=6) at /test/10.5_dbg/sql/signal_handler.cc:329
#3 <signal handler called>
#4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#5 0x000014a9dc4e6801 in __GI_abort () at abort.c:79
#6 0x000014a9dc4d639a in __assert_fail_base (fmt=0x14a9dc65d7d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x560b7a75d150 "! is_set() || m_can_overwrite_status", file=file@entry=0x560b7a75d0c0 "/test/10.5_dbg/sql/sql_error.cc", line=line@entry=445, function=function@entry=0x560b7a75db60 <Diagnostics_area::set_error_status(unsigned int, char const*, char const*, Sql_user_condition_identity const&, Sql_condition const*)::__PRETTY_FUNCTION__> "void Diagnostics_area::set_error_status(uint, const char*, const char*, const Sql_user_condition_identity&, const Sql_condition*)") at assert.c:92
#7 0x000014a9dc4d6412 in __GI___assert_fail (assertion=assertion@entry=0x560b7a75d150 "! is_set() || m_can_overwrite_status", file=file@entry=0x560b7a75d0c0 "/test/10.5_dbg/sql/sql_error.cc", line=line@entry=445, function=function@entry=0x560b7a75db60 <Diagnostics_area::set_error_status(unsigned int, char const*, char const*, Sql_user_condition_identity const&, Sql_condition const*)::__PRETTY_FUNCTION__> "void Diagnostics_area::set_error_status(uint, const char*, const char*, const Sql_user_condition_identity&, const Sql_condition*)") at assert.c:101
#8 0x0000560b79aa0d58 in Diagnostics_area::set_error_status (this=this@entry=0x14a9bb01ab88, sql_errno=sql_errno@entry=1931, message=message@entry=0x14a9ddda0880 "Query execution was interrupted. The query examined at least 1 rows, which exceeds LIMIT ROWS EXAMINED (0). The query result may be incomplete", sqlstate=sqlstate@entry=0x560b7a77ea08 "HY000", ucid=..., error_condition=0x0) at /test/10.5_dbg/sql/sql_error.cc:445
#9 0x0000560b79a832e2 in THD::raise_condition (this=this@entry=0x14a9bb015088, sql_errno=sql_errno@entry=1931, sqlstate=0x560b7a77ea08 "HY000", sqlstate@entry=0x0, level=<optimized out>, level@entry=Sql_state_errno_level::WARN_LEVEL_WARN, ucid=..., msg=msg@entry=0x14a9ddda0880 "Query execution was interrupted. The query examined at least 1 rows, which exceeds LIMIT ROWS EXAMINED (0). The query result may be incomplete") at /test/10.5_dbg/sql/sql_class.cc:1132
#10 0x0000560b79aa1c9f in THD::raise_condition (msg=0x14a9ddda0880 "Query execution was interrupted. The query examined at least 1 rows, which exceeds LIMIT ROWS EXAMINED (0). The query result may be incomplete", level=Sql_state_errno_level::WARN_LEVEL_WARN, sqlstate=0x0, sql_errno=1931, this=0x14a9bb015088) at /test/10.5_dbg/sql/sql_class.h:4498
#11 push_warning (thd=thd@entry=0x14a9bb015088, level=level@entry=Sql_state_errno_level::WARN_LEVEL_WARN, code=code@entry=1931, msg=msg@entry=0x14a9ddda0880 "Query execution was interrupted. The query examined at least 1 rows, which exceeds LIMIT ROWS EXAMINED (0). The query result may be incomplete") at /test/10.5_dbg/sql/sql_error.cc:715
#12 0x0000560b79aa1ee8 in push_warning_printf (thd=thd@entry=0x14a9bb015088, level=level@entry=Sql_state_errno_level::WARN_LEVEL_WARN, code=code@entry=1931, format=0x560b7a8e1758 "Query execution was interrupted. The query examined at least %llu rows, which exceeds LIMIT ROWS EXAMINED (%llu). The query result may be incomplete") at /test/10.5_dbg/sql/sql_error.cc:750
#13 0x0000560b79b66f55 in handle_select (thd=thd@entry=0x14a9bb015088, lex=lex@entry=0x14a9bb018fd0, result=result@entry=0x14a9bb075ed8, setup_tables_done_option=setup_tables_done_option@entry=1073741824) at /test/10.5_dbg/sql/sql_select.cc:442
#14 0x0000560b79aec9f8 in mysql_execute_command (thd=thd@entry=0x14a9bb015088) at /test/10.5_dbg/sql/sql_parse.cc:4661
#15 0x0000560b79af7804 in mysql_parse (thd=thd@entry=0x14a9bb015088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14a9ddda13e0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:7957
#16 0x0000560b79ae3ffd in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14a9bb015088, packet=packet@entry=0x14a9bb067089 "INSERT INTO t SELECT a FROM t LIMIT ROWS EXAMINED 0", packet_length=packet_length@entry=51, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:1839
#17 0x0000560b79ae28cc in do_command (thd=0x14a9bb015088) at /test/10.5_dbg/sql/sql_parse.cc:1358
#18 0x0000560b79c3c99d in do_handle_one_connection (connect=<optimized out>, connect@entry=0x14a9bcc433a8, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1411
#19 0x0000560b79c3d0b9 in handle_one_connection (arg=arg@entry=0x14a9bcc433a8) at /test/10.5_dbg/sql/sql_connect.cc:1313
#20 0x0000560b7a09b10a in pfs_spawn_thread (arg=0x14a9db845888) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
#21 0x000014a9dd1c96db in start_thread (arg=0x14a9ddda2700) at pthread_create.c:463
#22 0x000014a9dc5c788f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Bug confirmed present in:
MariaDB: 10.2.32 (dbg), 10.3.23 (dbg), 10.4.13 (dbg), 10.5.2 (dbg), 10.5.3 (dbg), 10.5.4 (dbg)
Bug confirmed not present in:
MariaDB: 10.1.45 (dbg), 10.1.45 (opt), 10.2.32 (opt), 10.3.23 (opt), 10.4.13 (opt), 10.5.2 (opt), 10.5.3 (opt), 10.5.4 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.47 (dbg), 5.6.47 (opt), 5.7.29 (dbg), 5.7.29 (opt), 8.0.19 (dbg), 8.0.19 (opt)