Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
N/A
-
None
Description
Filing as 10.11v1- critical as previously discussed, to make it show up on the list for consideration. Please feel free to downgrade or close as "won't fix".
For a table with visible versioning columns, setting system_versioning_insert_history variable changes the behavior of inserting default values (restricts it).
create or replace table t (a int auto_increment primary key, s timestamp(6) as row start, e timestamp(6) as row end, period for system_time (s,e)) with system versioning; |
set system_versioning_insert_history=off; |
insert into t () values (),(); |
insert into t (a) values (3),(4); |
set system_versioning_insert_history=on; |
insert into t (a) values (5),(6); |
insert into t () values (),(); |
Both INSERTs with system_versioning_insert_history=off work, with a values inserted according to the auto-increment or explicit values, s to the current time, and e to the max timestamp.
The third INSERT, first with system_versioning_insert_history=on also works, the same way.
But the last INSERT fails:
bb-10.11-MDEV-16546 2b1d32429 |
query 'insert into t () values (),()' failed: ER_WRONG_VALUE (1525): Incorrect s value: '0000-00-00 00:00:00.000000' |
There seems to be no good reason for this.
Attachments
Issue Links
- includes
-
MDEV-29722 History modification requires specifying values for both period columns
-
- Closed
-
-
MDEV-29738 REPLACE under system_versioning_insert_history allows to change existing historical records
-
- Closed
-
- is caused by
-
MDEV-16546 System versioning setting to allow history modification
-
- Closed
-
With the fix 623159a6, the following (still?) does not work:
bb-10.11-MDEV-16546 32090722c
With system_versioning_insert_history=off it works:
Query OK, 1 row affected (0.015 sec)
| a | s | e |
| 1 | 2022-10-17 01:22:04.887098 | 2038-01-19 05:14:07.999999 |
Again, there seems to be no logical reason why it shouldn't work with the variable set to ON.
I think we should generally avoid (whenever possible) changes which make previously working statements fail, unless it's the purpose of the change. It makes various OM=>NS, rolling galera upgrade and such scenarios even more problematic than they already are.