Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.6
-
None
Description
When dropping a period for an application-time period table defined using WITHOUT OVERLAPS, the associated index must be dropped as part of the same operation. If the index is not dropped, the operation results in an error.
This behavior probably makes sense, but the current error message is not very clear:
MariaDB [test]> ALTER TABLE coupons_wo_overlaps |
-> DROP PERIOD FOR valid_period; |
ERROR 4156 (HY000): Period `valid_period` is not found in table |
I would think that a better error message might be something like:
Period %s cannot be dropped from table unless index %s is dropped
To reproduce:
CREATE TABLE coupons_wo_overlaps ( |
id SERIAL PRIMARY KEY, |
name VARCHAR(255), |
type ENUM('Monthly Special', 'Seasonal Sale') DEFAULT 'Monthly Special', |
code VARCHAR(255), |
date_start DATETIME,
|
date_end DATETIME,
|
PERIOD FOR valid_period(date_start, date_end), |
UNIQUE KEY (name, valid_period WITHOUT OVERLAPS) |
);
|
|
SHOW CREATE TABLE coupons_wo_overlaps\G |
|
ALTER TABLE coupons_wo_overlaps |
DROP PERIOD FOR valid_period; |
|
ALTER TABLE coupons_wo_overlaps |
DROP PERIOD FOR valid_period, |
DROP INDEX name; |
Attachments
Issue Links
- is caused by
-
MDEV-16975 Application-time periods: ALTER TABLE
- Closed