Commit 4f71d081 authored by Aleksey Midenkov's avatar Aleksey Midenkov

MDEV-31030 Assertion `!error' failed in ha_partition::update_row on UPDATE

Removing wrong assertion as division by zero was caused by valid
input.
parent b4465fc6
...@@ -2857,3 +2857,26 @@ id select_type table type possible_keys key key_len ref rows Extra ...@@ -2857,3 +2857,26 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DEPENDENT SUBQUERY t3 ref_or_null a1,b a1 10 func,test.t2.a 198 Using where; Full scan on NULL key 2 DEPENDENT SUBQUERY t3 ref_or_null a1,b a1 10 func,test.t2.a 198 Using where; Full scan on NULL key
set optimizer_switch=@tmp_os; set optimizer_switch=@tmp_os;
drop table t1,t2,t3; drop table t1,t2,t3;
#
# MDEV-31030 Assertion `!error' failed in ha_partition::update_row on UPDATE
#
create table t (c int)
partition by list (1 div c) (
partition p0 values in (null),
partition p values in (1));
insert ignore into t values (0), (1), (0);
Warnings:
Warning 1365 Division by 0
Warning 1365 Division by 0
update t set c= 2;
ERROR 22012: Division by 0
update ignore t set c= 3;
Warnings:
Warning 1365 Division by 0
Warning 1365 Division by 0
select * from t;
c
0
0
1
drop table t;
...@@ -3068,3 +3068,17 @@ set optimizer_switch=@tmp_os; ...@@ -3068,3 +3068,17 @@ set optimizer_switch=@tmp_os;
drop table t1,t2,t3; drop table t1,t2,t3;
--echo #
--echo # MDEV-31030 Assertion `!error' failed in ha_partition::update_row on UPDATE
--echo #
create table t (c int)
partition by list (1 div c) (
partition p0 values in (null),
partition p values in (1));
insert ignore into t values (0), (1), (0);
--error ER_DIVISION_BY_ZERO
update t set c= 2;
update ignore t set c= 3;
select * from t;
drop table t;
...@@ -4593,7 +4593,6 @@ int ha_partition::update_row(const uchar *old_data, const uchar *new_data) ...@@ -4593,7 +4593,6 @@ int ha_partition::update_row(const uchar *old_data, const uchar *new_data)
so this is not supported for this engine. so this is not supported for this engine.
*/ */
error= get_part_for_buf(old_data, m_rec0, m_part_info, &old_part_id); error= get_part_for_buf(old_data, m_rec0, m_part_info, &old_part_id);
DBUG_ASSERT(!error);
DBUG_ASSERT(old_part_id == m_last_part); DBUG_ASSERT(old_part_id == m_last_part);
DBUG_ASSERT(bitmap_is_set(&(m_part_info->read_partitions), old_part_id)); DBUG_ASSERT(bitmap_is_set(&(m_part_info->read_partitions), old_part_id));
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment