[MDEV-14766] DELETE HISTORY from partitioned table deserves a specific error message Created: 2017-12-25  Updated: 2018-02-22  Resolved: 2018-02-22

Status: Closed
Project: MariaDB Server
Component/s: Partitioning, Versioned Tables
Affects Version/s: 10.3.4
Fix Version/s: 10.3.5

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Eugene Kosov (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Environment:

bb-10.3-temporal ea49441c41



 Description   

DELETE HISTORY from a system-version-partitioned table is not currently allowed, and it fails with the most generic ER_NOT_ALLOWED_COMMAND:

MariaDB [test]> create or replace table t1 (i int) with system versioning partition by system_time interval 1 day (partition p1 history, partition pn current);
Query OK, 0 rows affected (0.45 sec)
 
MariaDB [test]> delete history from t1;
ERROR 1148 (42000): The used command is not allowed with this MariaDB version

I think it's user-unfriendly, table creation and the attempt to truncate the history can be long time apart, and it's not easy to understand the relation. Besides, it's not accurate, because the command itself is allowed with the MariaDB version, it's the circumstances that prohibit it from being executed. All in all, I think a more specific error would be better here.



 Comments   
Comment by Sergei Golubchik [ 2017-12-27 ]

I don't see why it is not allowed in the first place.

Comment by Aleksey Midenkov [ 2017-12-28 ]

Feature scheduled in #403.

Comment by Aleksey Midenkov [ 2018-01-18 ]

Fixed by Truncate history of partitioned table #403

Comment by Elena Stepanova [ 2018-02-01 ]

(Re-opening since it didn't show up in git commit history).

It is said to have been fixed in 10.3.4, but I don't see it:

MariaDB [test]> create or replace table t1 (i int) with system versioning partition by system_time interval 1 day (partition p1 history, partition pn current);
Query OK, 0 rows affected (0.32 sec)
 
MariaDB [test]>  delete history from t1;
ERROR 1148 (42000): The used command is not allowed with this MariaDB version
 
MariaDB [test]> select @@version, @@version_source_revision;
+----------------------+------------------------------------------+
| @@version            | @@version_source_revision                |
+----------------------+------------------------------------------+
| 10.3.5-MariaDB-debug | 1951e7f05ae7b6069eeffdfe8ab304fa3a18a85a |
+----------------------+------------------------------------------+
1 row in set (0.00 sec)

So, either the fix never made it to the main tree, or it got broken again.

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