diff --git a/mysql-test/suite/period/r/update.result b/mysql-test/suite/period/r/update.result index b86537fc9fb..05d1a2eb6d3 100644 --- a/mysql-test/suite/period/r/update.result +++ b/mysql-test/suite/period/r/update.result @@ -274,3 +274,10 @@ drop function f; drop function g; drop function h; drop procedure log; +# +# MDEV-21471 ER_CRASHED_ON_USAGE upon UPDATE FOR PORTION on Aria table +# +create table t1 (s date, e date, period for app(s,e), f varchar(8)) engine=aria row_format=fixed; +insert into t1 values ('2024-05-13','2026-03-25','foo'); +update t1 for portion of app from '2024-04-02' to '2026-03-15' set f = 'bar'; +drop table t1; diff --git a/mysql-test/suite/period/t/update.test b/mysql-test/suite/period/t/update.test index 5730387dfda..0f54dd80eec 100644 --- a/mysql-test/suite/period/t/update.test +++ b/mysql-test/suite/period/t/update.test @@ -163,3 +163,13 @@ drop function f; drop function g; drop function h; drop procedure log; + +--echo # +--echo # MDEV-21471 ER_CRASHED_ON_USAGE upon UPDATE FOR PORTION on Aria table +--echo # +create table t1 (s date, e date, period for app(s,e), f varchar(8)) engine=aria row_format=fixed; +insert into t1 values ('2024-05-13','2026-03-25','foo'); +update t1 for portion of app from '2024-04-02' to '2026-03-15' set f = 'bar'; + +# cleanup +drop table t1; diff --git a/sql/sql_update.cc b/sql/sql_update.cc index af09675d917..0d2860de19f 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -465,6 +465,7 @@ int mysql_update(THD *thd, my_error(ER_NOT_CONSTANT_EXPRESSION, MYF(0), "FOR PORTION OF"); DBUG_RETURN(true); } + table->no_cache= true; } old_covering_keys= table->covering_keys; // Keys used in WHERE