Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions mysql-test/main/func_debug.result
Original file line number Diff line number Diff line change
Expand Up @@ -1967,3 +1967,18 @@ Warning 1292 Truncated incorrect DECIMAL value: '0x'
SET SESSION debug_dbug="-d,Predicant_to_list_comparator";
SET SESSION debug_dbug="-d,Item_func_in";
SET SESSION debug_dbug="-d,cmp_item";
#
# MDEV-25529 Fix to_string() OOM return semantics for temporal types
#
# NULL from to_string() does not stick to the next execution
prepare s from "select trim(time'10:00:00') as t";
set @save_dbug= @@debug_dbug;
set debug_dbug= '+d,time_to_string_oom';
execute s;
ERROR HY000: Out of memory.
set debug_dbug= @save_dbug;
execute s;
t
10:00:00
deallocate prepare s;
# End of 13.2 tests
15 changes: 15 additions & 0 deletions mysql-test/main/func_debug.test
Original file line number Diff line number Diff line change
Expand Up @@ -592,3 +592,18 @@ SELECT ('0x',1) IN ((0,1),(1,1));
SET SESSION debug_dbug="-d,Predicant_to_list_comparator";
SET SESSION debug_dbug="-d,Item_func_in";
SET SESSION debug_dbug="-d,cmp_item";

--echo #
--echo # MDEV-25529 Fix to_string() OOM return semantics for temporal types
--echo #
--echo # NULL from to_string() does not stick to the next execution
prepare s from "select trim(time'10:00:00') as t";
set @save_dbug= @@debug_dbug;
set debug_dbug= '+d,time_to_string_oom';
--error ER_OUT_OF_RESOURCES
execute s;
set debug_dbug= @save_dbug;
execute s;
deallocate prepare s;

--echo # End of 13.2 tests
18 changes: 18 additions & 0 deletions mysql-test/main/partition.result
Original file line number Diff line number Diff line change
Expand Up @@ -2922,4 +2922,22 @@ DROP TABLE mdev20498;
#
# End of 10.6 tests
#
#
# MDEV-25529 ALTER TABLE FORCE syntax improved
#
create table t1 (id int primary key);
alter table t1 force partition by hash(id) partitions 2;
alter table t1 force remove partitioning;
alter table t1 partition by hash(id) partitions 2 force;
alter table t1 remove partitioning force;
alter table t1 force partition by hash(id) partitions 2 force;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'force' at line 1
alter table t1 force remove partitioning force;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'force' at line 1
alter table t1 add column x int partition by hash(id) partitions 2;
alter table t1 remove partitioning add column y int;
drop table t1;
#
# End of 13.2 tests
#
ALTER DATABASE test CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci;
21 changes: 21 additions & 0 deletions mysql-test/main/partition.test
Original file line number Diff line number Diff line change
Expand Up @@ -3147,4 +3147,25 @@ DROP TABLE mdev20498;
--echo # End of 10.6 tests
--echo #

--echo #
--echo # MDEV-25529 ALTER TABLE FORCE syntax improved
--echo #
create table t1 (id int primary key);
alter table t1 force partition by hash(id) partitions 2;
alter table t1 force remove partitioning;
alter table t1 partition by hash(id) partitions 2 force;
alter table t1 remove partitioning force;
--error ER_PARSE_ERROR
alter table t1 force partition by hash(id) partitions 2 force;
--error ER_PARSE_ERROR
alter table t1 force remove partitioning force;
# alter_list is accepted before and after partitioning/remove_partitioning
alter table t1 add column x int partition by hash(id) partitions 2;
alter table t1 remove partitioning add column y int;
drop table t1;

--echo #
--echo # End of 13.2 tests
--echo #

--source include/test_db_charset_restore.inc
29 changes: 29 additions & 0 deletions mysql-test/suite/versioning/r/old_timestamp.result
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,32 @@ a row_foo_end
2 2023-12-19 14:23:22.359113
3 2106-02-07 06:28:15.999999
drop table sv_basic,sv_partition,sv_explicit;
#
# MDEV-25529 Auto-create: Pre-existing historical data is not
# partitioned as specified by ALTER
#
# Current rows of a table that is not upgraded keep the old row_end
# marker; they are not history.
select a, row_end from t1 for system_time all order by a;
a row_end
1 2038-01-19 03:14:07.999999
2 2023-12-19 14:23:22.305292
3 2038-01-19 03:14:07.999999
alter table t1 partition by system_time interval 1 hour auto;
Warnings:
Warning 4277 `t1`: no usable ROW END index, using slow scan; add an ordered index starting with the ROW END column (ascending, not DESC) to avoid it
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
PARTITION BY SYSTEM_TIME INTERVAL 1 HOUR STARTS TIMESTAMP'2023-12-19 14:00:00' AUTO
PARTITIONS 2
select a from t1 partition (pn) order by a;
a
1
3
set timestamp= default;
drop table t1;
# End of 13.2 tests
6 changes: 3 additions & 3 deletions mysql-test/suite/versioning/r/partition.result
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ PARTITIONS 2
create or replace table t1 (i int) with system versioning
partition by system_time interval 1 day starts '2000-01-01 00:00:01';
Warnings:
Warning 4164 `t1`: STARTS is later than query time, first history partition may exceed INTERVAL value
Warning 4164 `t1`: STARTS timestamp 2000-01-01 00:00:01 is later than query timestamp 2000-01-01 00:00:00, first history partition may exceed INTERVAL value
# Test default STARTS rounding
set timestamp= unix_timestamp('1999-12-15 13:33:33');
create or replace table t1 (i int) with system versioning
Expand Down Expand Up @@ -544,7 +544,7 @@ set time_zone="+03:00";
create or replace table t1 (i int) with system versioning
partition by system_time interval 1 day starts '2000-01-01 00:00:00';
Warnings:
Warning 4164 `t1`: STARTS is later than query time, first history partition may exceed INTERVAL value
Warning 4164 `t1`: STARTS timestamp 2000-01-01 00:00:00 is later than query timestamp 1999-12-15 16:33:33, first history partition may exceed INTERVAL value
set timestamp= unix_timestamp('2000-01-01 00:00:00');
create or replace table t2 (i int) with system versioning
partition by system_time interval 1 day;
Expand Down Expand Up @@ -604,7 +604,7 @@ create or replace table t1 (i int) with system versioning
partition by system_time interval 1 day starts '2000-01-03 00:00:00'
partitions 3;
Warnings:
Warning 4164 `t1`: STARTS is later than query time, first history partition may exceed INTERVAL value
Warning 4164 `t1`: STARTS timestamp 2000-01-03 00:00:00 is later than query timestamp 2000-01-01 00:00:00, first history partition may exceed INTERVAL value
insert into t1 values (0);
set timestamp= unix_timestamp('2000-01-01 00:00:01');
update t1 set i= i + 1;
Expand Down
Loading