[MDEV-15626] Assertion on update virtual column in partitioned table Created: 2018-03-21  Updated: 2018-08-29  Resolved: 2018-05-10

Status: Closed
Project: MariaDB Server
Component/s: Partitioning
Affects Version/s: 10.2, 10.3
Fix Version/s: 10.2.15, 10.3.7

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: 10.3-ga, regression

Issue Links:
Duplicate
duplicates MDEV-16000 Error on partitioning by virtual column Closed

 Description   

Assertion `old_part_id == m_last_part' failed in ha_partition::update_row.

--source include/have_partition.inc
 
SET sql_mode= '';
 
CREATE OR REPLACE TABLE t (i INT, v INT AS (i) VIRTUAL) WITH SYSTEM VERSIONING
  PARTITION BY system_time INTERVAL 6 HOUR 
  SUBPARTITION BY HASH(v) SUBPARTITIONS 6 
  ( PARTITION p1 HISTORY, PARTITION pn CURRENT );
 
INSERT INTO t SET i = 0;
UPDATE t SET v = 53;
 
# Cleanup
DROP TABLE t;

10.3 865cec928a0

mysqld: /data/src/10.3/sql/ha_partition.cc:4345: virtual int ha_partition::update_row(const uchar*, const uchar*): Assertion `old_part_id == m_last_part' failed.
180322  1:36:59 [ERROR] mysqld got signal 6 ;
 
#7  0x00007f9f20c1cee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#8  0x0000564c9ba48d45 in ha_partition::update_row (this=0x7f9f00125ad8, old_data=0x7f9f00132a98 "\371", new_data=0x7f9f00132a80 "\371") at /data/src/10.3/sql/ha_partition.cc:4345
#9  0x0000564c9b2e005e in handler::ha_update_row (this=0x7f9f00125ad8, old_data=0x7f9f00132a98 "\371", new_data=0x7f9f00132a80 "\371") at /data/src/10.3/sql/handler.cc:6248
#10 0x0000564c9b0e2dc7 in mysql_update (thd=0x7f9f00000b00, table_list=0x7f9f00014e20, fields=..., values=..., conds=0x0, order_num=0, order=0x0, limit=18446744073709551615, handle_duplicates=DUP_ERROR, ignore=false, found_return=0x7f9f16da56e0, updated_return=0x7f9f16da5790) at /data/src/10.3/sql/sql_update.cc:943
#11 0x0000564c9afec783 in mysql_execute_command (thd=0x7f9f00000b00) at /data/src/10.3/sql/sql_parse.cc:4573
#12 0x0000564c9aff767a in mysql_parse (thd=0x7f9f00000b00, rawbuf=0x7f9f00014d48 "UPDATE t SET v = 53", length=19, parser_state=0x7f9f16da65d0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:8009
#13 0x0000564c9afe4d2e in dispatch_command (command=COM_QUERY, thd=0x7f9f00000b00, packet=0x7f9f0008ffc1 "UPDATE t SET v = 53", packet_length=19, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1838
#14 0x0000564c9afe376d in do_command (thd=0x7f9f00000b00) at /data/src/10.3/sql/sql_parse.cc:1383
#15 0x0000564c9b147bd5 in do_handle_one_connection (connect=0x564c9eb71bb0) at /data/src/10.3/sql/sql_connect.cc:1402
#16 0x0000564c9b147962 in handle_one_connection (arg=0x564c9eb71bb0) at /data/src/10.3/sql/sql_connect.cc:1308
#17 0x0000564c9b5ceaeb in pfs_spawn_thread (arg=0x564c9eb85450) at /data/src/10.3/storage/perfschema/pfs.cc:1862
#18 0x00007f9f228f3494 in start_thread (arg=0x7f9f16da7700) at pthread_create.c:333
#19 0x00007f9f20cd993f in clone () from /lib/x86_64-linux-gnu/libc.so.6

No visible problems on a non-debug build.



 Comments   
Comment by Aleksey Midenkov [ 2018-03-30 ]

Analysis

Comment by Aleksey Midenkov [ 2018-03-31 ]

Still reproducible with:

update t set i=2, v= 1;

Also reproducible without System Versioning:

create or replace table g (i int, v int as (i) virtual)
partition by range columns (i)
subpartition by hash(v) subpartitions 3 (
    partition p1 values less than (3),
    partition pn values less than (maxvalue));
 
insert into g set i= 0;
set sql_mode= ''; update g set i= 1, v= 2;

Comment by Aleksey Midenkov [ 2018-03-31 ]

Please, reassign.

Comment by Sergey Vojtovich [ 2018-04-20 ]

Pull request https://github.com/MariaDB/server/pull/688 was marked as relevant to this bug.

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