[MDEV-17653] replace into generated columns is unstable Created: 2018-11-09  Updated: 2018-11-09  Resolved: 2018-11-09

Status: Closed
Project: MariaDB Server
Component/s: Virtual Columns
Affects Version/s: 10.3.10
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: sbester1 Assignee: Unassigned
Resolution: Duplicate Votes: 1
Labels: None
Environment:

Win64


Issue Links:
Duplicate
duplicates MDEV-16039 Crash when selecting virtual columns ... Closed

 Description   

Version: '10.3.10-MariaDB'  socket: ''  port: 3306  mariadb.org binary distribution
[ERROR] mysqld got exception 0xc0000005 ;
terribly wrong...
mysqld.exe!Field::load_data_set_null()[field.cc:1297]
mysqld.exe!Item_func::print_args()[item_func.cc:611]
mysqld.exe!Item_func::print()[item_func.cc:601]
mysqld.exe!Item::print_parenthesised()[item.cc:585]
mysqld.exe!Item_func::print_op()[item_func.cc:621]
mysqld.exe!Item::print_parenthesised()[item.cc:585]
mysqld.exe!fix_vcol_expr()[table.cc:2868]
mysqld.exe!fix_all_session_vcol_exprs()[sql_base.cc:5177]
mysqld.exe!lock_tables()[sql_base.cc:5361]
mysqld.exe!open_and_lock_tables()[sql_base.cc:5004]
mysqld.exe!mysql_insert()[sql_insert.cc:760]
mysqld.exe!mysql_execute_command()[sql_parse.cc:4725]
mysqld.exe!mysql_parse()[sql_parse.cc:8096]
mysqld.exe!dispatch_command()[sql_parse.cc:1852]
mysqld.exe!do_command()[sql_parse.cc:1394]
mysqld.exe!threadpool_process_request()[threadpool_common.cc:358]
mysqld.exe!tp_callback()[threadpool_common.cc:186]

How to Repeat (non-simplified test)

set sql_mode='';
drop table if exists t;
create table t (
  `c0000` timestamp not null default current_timestamp() on update current_timestamp(),
  `c0001` decimal(27,25) generated always as (dayofmonth(( @@global.secure_file_priv))) virtual,
  `c0002` datetime(1) not null,
  `c0003` date not null,
  `c0004` time not null,
  `c0005` date not null,
  `c0006` smallint(6) not null,
  `c0007` timestamp generated always as (-2147483649) virtual,
  `c0008` smallint(6) generated always as (concat_ws(convert(`c0001` using cp932),get_format(datetime, 'iso'),( @@global.flush_time)) <> (`c0004` = 1)) virtual,
  `c0009` double not null,
  primary key (`c0004`),
  unique key `i0002` (`c0007`),
  key `i0001` (`c0003`) using btree,
  key `i0003` (`c0003`)
) engine=innodb default charset=latin1 row_format=compressed key_block_size=2;
 
replace into t set `c0000` = '2018-06-03 10:31:43',`c0002` = '2019-08-07 10:54:42',`c0003` = '2019-10-15',`c0004` = '02:58:55',`c0005` = '2018-04-28',`c0006` = 0,`c0009` = 4294967294;
replace into t set `c0000` = '2018-06-03 10:31:43',`c0002` = '2019-08-07 10:54:42',`c0003` = '2019-10-15',`c0004` = '02:58:55',`c0005` = '2018-04-28',`c0006` = 0,`c0009` = 4294967294;
replace into t set `c0000` = '2018-06-03 10:31:43',`c0002` = '2019-08-07 10:54:42',`c0003` = '2019-10-15',`c0004` = '02:58:55',`c0005` = '2018-04-28',`c0006` = 0,`c0009` = 4294967294;



 Comments   
Comment by Alice Sherepa [ 2018-11-09 ]

Thanks for the report!
Looks like it is the same problem as MDEV-16039. Stack trace from 10.3 :

 
#4  0x0000560273cd3a28 in Item_args::walk_args (this=0x7f81ec043ff0, processor=&virtual table offset 776, walk_subquery=false, arg=0x0) at /git/10.3/sql/item.h:2185
#5  0x0000560273cd3fb7 in Item_func_or_sum::walk (this=0x7f81ec043f68, processor=&virtual table offset 776, walk_subquery=false, arg=0x0) at /git/10.3/sql/item.h:4687
#6  0x0000560273cd3a51 in Item_args::walk_args (this=0x7f81ec0443d8, processor=&virtual table offset 776, walk_subquery=false, arg=0x0) at /git/10.3/sql/item.h:2185
#7  0x0000560273cd3fb7 in Item_func_or_sum::walk (this=0x7f81ec044350, processor=&virtual table offset 776, walk_subquery=false, arg=0x0) at /git/10.3/sql/item.h:4687
#8  0x0000560273e6488b in fix_session_vcol_expr (thd=0x7f81ec000b00, vcol=0x7f81ec0434c0) at /git/10.3/sql/table.cc:2886
#9  0x0000560273cc8d9e in fix_all_session_vcol_exprs (thd=0x7f81ec000b00, tables=0x7f81ec014ed8) at /git/10.3/sql/sql_base.cc:5178
#10 0x0000560273cc9506 in lock_tables (thd=0x7f81ec000b00, tables=0x7f81ec014ed8, count=1, flags=0) at /git/10.3/sql/sql_base.cc:5361
#11 0x0000560273cc87bc in open_and_lock_tables (thd=0x7f81ec000b00, options=..., tables=0x7f81ec014ed8, derived=true, flags=0, prelocking_strategy=0x7f8240224860) at /git/10.3/sql/sql_base.cc:5005
#12 0x0000560273c8908a in open_and_lock_tables (thd=0x7f81ec000b00, tables=0x7f81ec014ed8, derived=true, flags=0) at /git/10.3/sql/sql_base.h:502
#13 0x0000560273d13969 in mysql_insert (thd=0x7f81ec000b00, table_list=0x7f81ec014ed8, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_REPLACE, ignore=false) at /git/10.3/sql/sql_insert.cc:760
#14 0x0000560273d559bb in mysql_execute_command (thd=0x7f81ec000b00) at /git/10.3/sql/sql_parse.cc:4723
#15 0x0000560273d609f4 in mysql_parse (thd=0x7f81ec000b00, rawbuf=0x7f81ec014cd8 "replace into t set c0000 = '2018-06-03 10:31:43',c0002 = '2019-08-07 10:54:42',c0003 = '2019-10-15',c0004 = '02:58:55',c0005 = '2018-04-28',c0006 = 0,c0009 = 4294967294", length=168, parser_state=0x7f8240225470, is_com_multi=false, is_next_command=false) at /git/10.3/sql/sql_parse.cc:8090
#16 0x0000560273d4d8a7 in dispatch_command (command=COM_QUERY, thd=0x7f81ec000b00, packet=0x7f81ec161121 "replace into t set c0000 = '2018-06-03 10:31:43',c0002 = '2019-08-07 10:54:42',c0003 = '2019-10-15',c0004 = '02:58:55',c0005 = '2018-04-28',c0006 = 0,c0009 = 4294967294", packet_length=168, is_com_multi=false, is_next_command=false) at /git/10.3/sql/sql_parse.cc:1850
#17 0x0000560273d4c2c4 in do_command (thd=0x7f81ec000b00) at /git/10.3/sql/sql_parse.cc:1395
#18 0x0000560273eb394e in do_handle_one_connection (connect=0x5602776277d0) at /git/10.3/sql/sql_connect.cc:1402
#19 0x0000560273eb369f in handle_one_connection (arg=0x5602776277d0) at /git/10.3/sql/sql_connect.cc:1308
#20 0x0000560274789710 in pfs_spawn_thread (arg=0x56027762fd70) at /git/10.3/storage/perfschema/pfs.cc:1862
#21 0x00007f824786d6ba in start_thread (arg=0x7f8240226700) at pthread_create.c:333
#22 0x00007f8246d0241d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

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