[MDEV-19771] REPLACE on table with virtual_field can cause crash in set_ok_status() Created: 2019-06-15  Updated: 2020-08-06  Due: 2019-06-15  Resolved: 2019-06-15

Status: Closed
Project: MariaDB Server
Component/s: Virtual Columns
Affects Version/s: 10.2.24, 10.3.15, 10.4.5
Fix Version/s: 10.2.25, 10.3.16, 10.4.6

Type: Bug Priority: Major
Reporter: Michael Widenius Assignee: Michael Widenius
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MDEV-17837 Assertion `!is_set() || (m_status == ... Closed
Relates
relates to MDEV-20618 Assertion `btr_validate_index(index, ... Closed

 Description   

create or replace table t1 (pk int primary key, col_bit bit(15) default null,
vcol_bit bit(10) GENERATED ALWAYS AS (`col_bit`) VIRTUAL);
replace INTO `t1` (`pk`,col_bit) VALUES (99,1000);
select pk, col_bit+0, vcol_bit+0 from t1;
replace INTO `t1` (`pk`,col_bit) VALUES (99,10000);
select pk, col_bit+0, vcol_bit+0 from t1;
REPLACE LOW_PRIORITY INTO `t1` (`pk`) VALUES (99);
drop table t1;

Causes crash in:
mysqld: /my/maria-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.



 Comments   
Comment by Michael Widenius [ 2019-06-15 ]

Problem was that we did not ignore warnings from virtual fields when updated virtual fields for to-be-replaced-row.

Comment by Nikita Malyavin [ 2020-08-06 ]

monty, I think we should rather fail in that case – it is not mentioned anywhere that REPLACE should behave in IGNORE manner

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