[MDEV-13923] Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed upon altering table with geometry field Created: 2017-09-27  Updated: 2020-05-05  Resolved: 2017-10-11

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Alter Table, GIS, Storage Engine - InnoDB
Affects Version/s: 10.2.6, 10.2
Fix Version/s: 10.2.10

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Alexey Botchkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-13900 Testing for MDEV-11369 (instant ADD C... Closed
Duplicate
is duplicated by MDEV-14125 [Draft] Assertion `!is_set() || (m_st... Closed
Relates
relates to MDEV-13847 Allow ALTER TABLE…ADD SPATIAL INDEX…A... Closed
Sprint: 10.2.10

 Description   

10.2 fd2c5d19d0f0ee

mysqld: /data/src/10.2/sql/sql_error.cc:380: void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*): Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed.
170927 20:55:07 [ERROR] mysqld got signal 6 ;
 
#7  0x00007ff1de955ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#8  0x000055658e504d83 in Diagnostics_area::set_ok_status (this=0x7ff184005bd0, affected_rows=0, last_insert_id=0, message=0x7ff1d05a6290 "Records: 0  Duplicates: 0  Warnings: 2") at /data/src/10.2/sql/sql_error.cc:380
#9  0x000055658e4b7d39 in my_ok (thd=0x7ff184000b00, affected_rows=0, id=0, message=0x7ff1d05a6290 "Records: 0  Duplicates: 0  Warnings: 2") at /data/src/10.2/sql/sql_class.h:4423
#10 0x000055658e605e76 in mysql_alter_table (thd=0x7ff184000b00, new_db=0x7ff184012b30 "test", new_name=0x0, create_info=0x7ff1d05a6e60, table_list=0x7ff184012520, alter_info=0x7ff1d05a6db0, order_num=0, order=0x0, ignore=false) at /data/src/10.2/sql/sql_table.cc:9645
#11 0x000055658e67dde8 in Sql_cmd_alter_table::execute (this=0x7ff184012c20, thd=0x7ff184000b00) at /data/src/10.2/sql/sql_alter.cc:324
#12 0x000055658e53a984 in mysql_execute_command (thd=0x7ff184000b00) at /data/src/10.2/sql/sql_parse.cc:6203
#13 0x000055658e53f234 in mysql_parse (thd=0x7ff184000b00, rawbuf=0x7ff184012438 "ALTER TABLE t1 ADD COLUMN i INT", length=31, parser_state=0x7ff1d05a8200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7875
#14 0x000055658e52cee5 in dispatch_command (command=COM_QUERY, thd=0x7ff184000b00, packet=0x7ff184084fc1 "ALTER TABLE t1 ADD COLUMN i INT", packet_length=31, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1812
#15 0x000055658e52b85f in do_command (thd=0x7ff184000b00) at /data/src/10.2/sql/sql_parse.cc:1360
#16 0x000055658e678acb in do_handle_one_connection (connect=0x55659263aa10) at /data/src/10.2/sql/sql_connect.cc:1354
#17 0x000055658e678858 in handle_one_connection (arg=0x55659263aa10) at /data/src/10.2/sql/sql_connect.cc:1260
#18 0x000055658ea9576a in pfs_spawn_thread (arg=0x5565926dd050) at /data/src/10.2/storage/perfschema/pfs.cc:1862
#19 0x00007ff1e089a494 in start_thread (arg=0x7ff1d05a9700) at pthread_create.c:333
#20 0x00007ff1dea1293f in clone () from /lib/x86_64-linux-gnu/libc.so.6

--source include/have_innodb.inc
CREATE TABLE t1 (p POINT DEFAULT 0) ENGINE=InnoDB;
ALTER TABLE t1 ADD COLUMN i INT;
 
# Cleanup
DROP TABLE t1;

No visible effect on non-debug build (just a complaint about wrong default value).
Not reproducible with MySQL 5.7, because defaults for geometry columns aren't allowed there.
Not reproducible with MyISAM.



 Comments   
Comment by Marko Mäkelä [ 2017-09-29 ]

I am rather sure that this must be due to the default value calculation in the InnoDB implementation of ALGORITHM=INPLACE. Before MDEV-13847, MariaDB 10.2 rejected ALGORITHM=INPLACE if the table contained any SPATIAL INDEX.

It would be nice if the default value expressions for geometry columns were validated at CREATE TABLE or ALTER TABLE time.

Comment by Alexey Botchkov [ 2017-10-09 ]

Fix proposal:
http://lists.askmonty.org/pipermail/commits/2017-October/011543.html

Comment by Alexey Botchkov [ 2017-10-09 ]

Updated patch:
http://lists.askmonty.org/pipermail/commits/2017-October/011545.html

Comment by Alexey Botchkov [ 2017-10-10 ]

http://lists.askmonty.org/pipermail/commits/2017-October/011549.html

Comment by Alexey Botchkov [ 2017-10-10 ]

http://lists.askmonty.org/pipermail/commits/2017-October/011551.html

Comment by Alexander Barkov [ 2017-10-10 ]

It also crashes the other way around:

CREATE OR REPLACE TABLE t1 (a INT) ENGINE=InnoDB;
ALTER TABLE t1 ADD COLUMN b POINT DEFAULT '0';

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