Aleksey Midenkov
101af8ee09
MDEV-41543 Changing INTERVAL of SYSTEM_TIME partitioning does not move history
...
ALTER TABLE ... PARTITION BY SYSTEM_TIME with a changed INTERVAL or
STARTS on a table already partitioned by SYSTEM_TIME took the fast
ALTER path, which only rewrites the table definition. The history rows
stayed where the old layout put them, so after the ALTER they were in
wrong partitions. An unchanged interval took the copy path instead.
MDEV-29873 replaced memcmp() of the intervals, which is true when they
differ, with interval_t::operator==, which is true when they are equal,
and lost the negation.
The copy path was also broken: it assigned the whole vers_info of the
new partitioning spec to the cloned partition info, now_part and
hist_part included. The ALTER does not list partitions, so now_part
became NULL and check_partition_info() failed with ER_VERS_WRONG_PARTS
for a table with explicit partitions (MDEV-33370 test case).
The fix negates the comparison again (now with interval_t::operator!=),
so a changed interval rebuilds the table and redistributes the history.
It copies only interval, limit and auto_hist from the new spec and keeps
now_part and hist_part of the existing partitions.
Without STARTS the start of the interval defaults to the current time
rounded down to the INTERVAL unit. So ALTER with the same INTERVAL and
no STARTS usually gets a different start and now rebuilds the table.
Vers_part_info::operator=, which copied now_part and hist_part and had
no other callers, is deleted.
Fast ALTER was also chosen when the same statement changed the table
definition, e.g. ADD COLUMN with the same INTERVAL and STARTS, or DROP
COLUMN with LIMIT. It wrote the new .frm, but the partitions kept the
old record layout. Now any change of the table definition
(alter_info->flags) takes the copy path.
2026-10-15 13:59:19 +03:00
..
2026-04-21 09:50:37 +03:00
2026-05-15 13:30:21 +10:00
2026-10-02 10:18:55 +02:00
2024-11-23 08:14:22 -07:00
2026-07-29 13:05:09 +02:00
2026-05-15 13:30:21 +10:00
2026-07-23 11:12:27 +02:00
2024-10-29 15:24:38 +01:00
2023-10-19 17:24:30 +03:00
2023-10-19 17:24:30 +03:00
2025-06-18 16:46:21 +10:00
2026-07-23 11:12:27 +02:00
2025-09-04 18:08:39 +03:00
2024-01-17 13:35:05 +02:00
2023-07-07 15:15:24 +07:00
2024-04-30 23:09:02 +10:00
2024-04-30 23:09:02 +10:00
2025-06-18 16:46:21 +10:00
2024-11-29 13:43:17 +02:00
2026-01-14 19:44:30 +01:00
2024-06-20 11:32:13 -04:00
2026-07-24 17:06:40 +02:00
2024-11-29 12:37:46 +02:00
2026-01-14 19:44:30 +01:00
2026-01-14 19:44:30 +01:00
2024-10-29 15:24:38 +01:00
2026-01-26 10:01:31 +01:00
2026-10-14 12:57:43 +05:30
2026-10-14 12:57:43 +05:30
2024-11-23 08:14:22 -07:00
2025-09-04 18:08:39 +03:00
2023-12-17 11:20:43 +01:00
2026-07-20 14:02:09 +04:00
2026-01-28 12:55:26 +04:00
2026-03-13 08:27:46 +01:00
2024-06-20 11:32:13 -04:00
2024-10-15 15:36:12 +11:00
2024-10-03 13:45:26 +03:00
2026-10-13 12:19:46 +03:00
2025-12-16 11:57:17 +11:00
2026-05-29 09:40:02 +03:00
2025-02-27 04:02:33 +01:00
2025-09-04 18:08:39 +03:00
2026-08-27 15:24:51 +03:00
2026-10-13 07:06:17 +13:00
2026-07-24 17:06:41 +02:00
2024-11-29 13:43:17 +02:00
2026-07-02 11:08:22 +10:00
2026-10-01 15:39:25 -04:00
2026-09-14 10:46:29 +03:00
2024-11-29 13:43:17 +02:00
2024-12-05 10:11:58 +01:00
2026-07-29 13:05:09 +02:00
2026-10-03 15:35:29 +03:00
2026-08-19 08:13:54 +02:00
2026-01-28 14:22:20 +01:00
2026-09-25 11:04:46 -04:00
2026-03-25 10:55:02 +02:00
2026-01-22 12:57:48 +01:00
2026-01-22 12:57:48 +01:00
2026-10-01 13:57:23 +03:00
2026-07-24 17:06:41 +02:00
2026-07-31 06:58:29 +12:00
2026-07-31 06:58:29 +12:00
2026-10-05 14:55:31 +03:00
2026-01-28 14:22:20 +01:00
2026-10-02 09:25:58 +10:00
2026-01-28 14:22:20 +01:00
2024-10-08 11:58:46 +02:00
2026-01-28 14:22:20 +01:00
2026-03-27 15:08:28 +03:00
2026-07-02 11:08:22 +10:00
2026-07-23 11:12:27 +02:00
2026-01-28 14:22:20 +01:00
2026-10-13 15:07:25 +03:00
2026-10-05 14:55:31 +03:00
2026-10-14 12:57:43 +05:30
2025-10-22 22:49:26 +05:30
2024-11-29 13:43:17 +02:00
2024-11-23 08:14:22 -07:00
2024-06-20 11:32:13 -04:00
2024-06-04 12:38:43 +04:00
2024-05-21 14:58:01 +04:00
2025-04-22 12:03:05 +02:00
2024-02-13 14:00:42 +11:00
2023-11-08 16:23:30 +01:00
2026-08-10 20:47:46 +02:00
2024-01-16 18:53:23 +04:00
2024-06-27 10:26:09 +03:00
2024-06-24 13:09:47 +03:00
2026-09-03 08:16:29 +02:00
2026-08-11 15:36:38 -06:00
2026-09-03 08:16:29 +02:00
2023-10-03 08:25:31 +03:00
2026-09-14 13:00:27 +05:30
2026-04-16 19:00:12 +10:00
2025-09-04 18:08:39 +03:00
2026-03-28 23:27:41 +03:00
2024-09-13 14:34:08 +03:00
2026-06-16 07:38:54 +10:00
2024-11-23 08:14:22 -07:00
2023-11-08 16:23:30 +01:00
2023-11-08 14:50:43 +01:00
2026-04-16 19:00:12 +10:00
2026-07-07 15:56:47 +02:00
2026-04-17 10:05:59 +10:00
2026-04-18 07:45:31 +10:00
2025-04-15 18:58:32 +02:00
2026-04-16 19:00:12 +10:00
2026-08-19 08:15:36 +02:00
2026-08-19 08:13:54 +02:00
2026-07-29 13:05:09 +02:00
2026-09-23 14:25:20 +02:00
2025-06-09 21:15:30 +03:00
2023-10-14 13:36:11 +03:00
2026-10-13 07:06:17 +13:00
2026-08-06 11:44:20 -04:00
2025-10-24 17:12:16 +05:30
2026-01-28 14:22:20 +01:00
2026-09-02 06:30:40 +12:00
2025-09-04 18:08:39 +03:00
2025-09-04 18:08:39 +03:00
2026-07-31 06:58:29 +12:00
2026-08-01 19:44:19 +02:00
2026-07-21 18:29:13 +02:00
2026-01-14 19:44:29 +01:00
2026-07-22 14:36:17 +02:00
2026-01-31 11:42:12 +01:00
2026-10-15 13:59:19 +03:00
2026-04-16 19:00:12 +10:00
2026-08-01 19:44:19 +02:00
2026-01-22 12:57:48 +01:00
2026-04-20 11:07:30 +03:00
2023-12-18 11:19:04 +01:00
2026-09-23 14:25:20 +02:00
2024-11-29 12:37:46 +02:00
2024-06-24 13:09:47 +03:00
2025-09-04 18:08:39 +03:00
2025-09-04 18:08:39 +03:00
2025-09-04 18:08:39 +03:00
2024-07-22 15:14:50 +02:00
2026-09-29 14:58:47 +03:00
2026-04-16 19:00:12 +10:00
2025-09-04 18:08:39 +03:00
2025-04-11 13:42:12 +02:00
2026-09-14 13:00:27 +05:30
2026-06-15 10:43:23 +02:00
2026-07-16 12:56:45 +02:00
2025-07-07 14:03:49 -06:00
2026-07-24 17:06:40 +02:00
2026-09-03 08:16:29 +02:00
2026-09-03 08:16:29 +02:00
2026-09-03 08:16:29 +02:00
2026-08-11 11:29:34 -06:00
2026-08-11 11:29:34 -06:00
2024-10-29 15:24:38 +01:00
2024-03-05 20:19:49 +02:00
2026-06-15 10:43:23 +02:00
2026-06-15 10:43:23 +02:00
2025-04-23 17:20:47 -06:00
2025-04-23 17:20:47 -06:00
2026-03-30 14:40:47 +03:00
2026-04-07 11:39:40 +10:00
2024-11-23 08:14:22 -07:00
2026-07-29 13:05:09 +02:00
2026-07-29 13:05:09 +02:00
2026-09-07 12:18:32 +10:00
2026-09-03 08:16:29 +02:00
2026-09-03 08:16:29 +02:00
2024-01-23 13:03:11 +02:00
2024-01-23 13:03:11 +02:00
2025-10-28 17:49:51 +01:00
2025-10-28 17:49:51 +01:00
2026-09-10 17:00:23 +03:00
2026-09-10 17:00:23 +03:00
2026-09-10 17:00:23 +03:00
2026-09-10 17:00:23 +03:00
2026-07-23 11:12:27 +02:00
2026-07-24 17:06:40 +02:00
2024-11-29 12:37:46 +02:00
2026-08-19 08:13:54 +02:00
2025-12-26 23:49:46 +01:00
2025-09-04 18:08:39 +03:00
2026-09-29 01:13:28 +02:00
2025-01-10 13:14:42 +01:00
2026-03-24 14:21:55 +02:00
2024-06-24 13:09:47 +03:00
2025-01-30 11:55:13 +01:00
2025-01-30 11:55:13 +01:00
2026-05-13 16:20:38 +10:00
2026-05-12 15:21:00 +10:00
2023-07-10 11:22:21 +03:00
2024-11-29 13:43:17 +02:00
2024-11-29 13:43:17 +02:00
2025-09-18 18:01:33 +02:00
2026-08-19 08:13:54 +02:00
2026-04-28 12:49:24 +05:30
2025-09-04 18:08:39 +03:00
2024-01-18 19:22:23 +02:00
2025-09-04 18:08:39 +03:00
2024-04-23 14:12:31 +03:00
2026-03-27 15:08:28 +03:00
2024-11-23 08:14:22 -07:00
2026-10-05 13:29:33 +03:00
2026-09-29 01:13:28 +02:00
2026-01-13 15:37:08 +04:00
2026-01-02 11:06:05 +02:00
2026-10-05 13:29:33 +03:00
2026-09-23 14:25:20 +02:00
2026-10-13 07:06:17 +13:00
2026-06-22 22:26:08 +07:00
2025-12-23 13:42:45 +03:00
2026-07-23 11:12:27 +02:00
2026-07-23 11:12:27 +02:00
2026-09-25 14:04:58 +03:00
2025-02-26 12:40:07 +02:00
2026-03-17 18:57:42 +01:00
2026-01-27 16:42:41 +05:30
2026-01-28 14:22:20 +01:00
2024-10-17 21:37:37 +02:00
2025-10-12 21:08:04 +03:00
2024-08-20 10:00:39 +02:00
2026-03-26 21:46:35 +05:30
2025-09-22 10:24:14 +05:30
2025-09-04 18:08:39 +03:00
2024-06-20 11:32:13 -04:00
2024-06-27 10:26:09 +03:00
2026-10-09 11:48:19 +02:00
2024-10-14 09:36:17 +02:00
2024-11-29 12:37:46 +02:00
2026-09-03 08:16:29 +02:00
2025-09-19 12:31:14 +03:00
2026-10-13 07:06:17 +13:00
2025-09-04 18:08:39 +03:00
2026-10-07 13:30:32 +13:00
2026-10-07 13:30:32 +13:00
2026-06-16 07:38:54 +10:00
2023-05-23 12:25:39 +03:00
2025-07-29 13:15:02 +10:00
2026-04-16 19:00:12 +10:00
2024-06-11 12:50:10 +03:00
2024-04-15 18:54:30 +02:00
2026-10-14 11:31:29 +03:00
2026-01-28 14:22:20 +01:00
2026-09-14 10:46:29 +03:00
2024-07-03 12:45:30 +02:00
2026-10-15 13:59:19 +03:00
2023-08-04 08:01:06 +02:00
2025-07-29 13:15:02 +10:00
2025-01-30 11:55:13 +01:00
2026-10-12 12:03:54 +05:30
2024-12-30 16:13:20 +02:00
2026-07-23 11:12:27 +02:00
2023-11-05 23:35:31 +04:00
2026-04-16 09:26:39 +10:00
2026-03-11 08:05:08 +02:00
2023-12-17 11:20:43 +01:00
2026-07-29 13:05:09 +02:00
2026-07-23 11:12:27 +02:00
2026-08-11 15:36:37 -06:00
2024-01-23 13:03:11 +02:00
2024-06-20 11:32:13 -04:00
2023-12-02 01:02:50 +01:00
2026-10-13 07:06:17 +13:00
2026-09-02 06:30:40 +12:00
2025-07-07 13:00:18 +03:00
2025-09-04 18:08:39 +03:00
2026-04-30 15:32:24 +02:00
2026-08-01 19:44:19 +02:00
2026-08-01 19:44:19 +02:00
2024-06-20 11:32:13 -04:00
2025-09-04 18:08:39 +03:00
2026-07-24 17:06:40 +02:00
2026-03-17 11:05:34 +02:00
2024-03-27 15:00:56 +02:00
2025-09-15 11:00:02 +02:00
2026-10-01 15:52:50 +02:00
2026-09-14 10:46:29 +03:00
2026-08-13 09:15:13 +10:00
2026-03-17 18:57:42 +01:00
2025-09-04 18:08:39 +03:00
2026-07-20 17:04:39 +10:00
2026-07-23 11:12:27 +02:00
2025-01-20 09:57:37 +02:00
2025-03-27 08:01:47 +02:00
2024-06-20 11:32:13 -04:00
2026-04-16 19:00:12 +10:00
2023-09-25 13:06:57 +10:00
2026-01-28 14:22:20 +01:00
2026-05-08 07:38:22 +02:00
2024-01-18 19:22:23 +02:00
2023-08-01 15:08:52 +02:00
2023-07-04 16:37:29 +02:00
2026-10-13 19:39:19 +03:00
2026-10-13 19:39:19 +03:00
2024-11-23 08:14:22 -07:00
2024-11-23 08:14:23 -07:00
2026-08-19 08:13:54 +02:00
2026-07-24 17:06:41 +02:00
2026-07-23 11:12:27 +02:00
2026-06-11 09:47:54 +10:00
2024-06-20 11:32:13 -04:00
2026-10-07 13:30:32 +13:00
2026-08-13 08:28:57 +04:00
2026-07-23 11:12:27 +02:00
2024-06-20 11:32:13 -04:00
2026-09-29 01:13:28 +02:00
2026-07-29 13:05:09 +02:00
2026-07-29 13:05:09 +02:00
2024-01-10 18:01:46 +11:00
2026-10-13 07:06:17 +13:00
2026-07-24 17:06:40 +02:00
2025-09-04 18:08:39 +03:00
2023-12-02 01:02:50 +01:00
2026-07-29 13:05:09 +02:00
2026-03-18 14:59:52 +02:00
2024-06-20 11:32:13 -04:00
2024-03-19 11:57:38 +01:00
2025-09-04 18:08:39 +03:00
2024-06-24 13:09:47 +03:00
2025-06-24 13:34:27 +05:30
2025-09-04 18:08:39 +03:00
2026-04-16 19:00:12 +10:00
2024-11-29 13:43:17 +02:00
2024-11-23 08:14:23 -07:00
2026-08-13 08:28:57 +04:00
2024-02-26 19:45:11 +02:00
2026-10-12 10:54:50 +05:30
2024-11-15 12:18:06 +11:00
2026-09-22 18:42:39 +02:00
2025-09-10 15:03:59 +03:00
2026-05-29 09:40:02 +03:00
2024-09-01 02:58:27 +02:00
2025-11-25 13:01:26 +02:00
2025-11-25 13:01:26 +02:00
2025-11-25 13:01:26 +02:00
2026-07-07 12:23:16 +03:00
2024-06-20 11:32:13 -04:00
2024-01-02 17:37:58 +02:00
2026-06-21 15:32:20 +02:00
2024-06-20 11:32:13 -04:00
2024-06-27 10:26:09 +03:00
2026-09-11 13:36:04 +03:00
2026-04-21 13:00:39 +03:00
2026-06-21 15:32:20 +02:00
2023-09-29 12:54:04 +02:00
2024-01-03 15:37:57 +02:00
2023-08-08 03:25:56 +02:00
2026-05-29 09:40:02 +03:00
2026-03-30 14:40:47 +03:00
2026-09-13 21:40:11 +03:00
2024-09-01 02:48:19 +02:00
2024-10-03 10:55:08 +03:00
2024-09-02 03:49:03 +02:00
2026-09-17 13:49:22 +03:00
2025-12-16 14:40:46 +02:00
2024-06-20 11:32:13 -04:00
2026-01-20 10:23:44 +02:00
2026-01-20 10:23:44 +02:00
2026-08-27 15:24:51 +03:00
2026-07-23 11:12:27 +02:00
2026-07-23 11:12:27 +02:00
2026-06-21 15:32:20 +02:00
2026-03-24 07:00:51 +02:00
2025-10-08 14:15:04 +03:00
2026-04-21 13:00:39 +03:00
2025-07-27 12:16:03 +02:00
2024-10-16 13:23:47 +02:00