Bug #99297 | sql-mode TIME_TRUNCATE_FRACTIONAL unsafe for generated columns | ||
---|---|---|---|
Submitted: | 18 Apr 2020 18:11 | Modified: | 18 Apr 2020 19:11 |
Reporter: | Morgan Tocker | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: DDL | Severity: | S2 (Serious) |
Version: | 8.0.19 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[18 Apr 2020 18:11]
Morgan Tocker
[18 Apr 2020 19:11]
MySQL Verification Team
Thank you for the bug report. Your MySQL connection id is 8 Server version: 8.0.21 Source distribution BUILT: 2020-APR-07 Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql 8.0 > CREATE DATABASE h; Query OK, 1 row affected (0.01 sec) mysql 8.0 > USE h; Database changed mysql 8.0 > SET sql_mode=DEFAULT; Query OK, 0 rows affected (0.00 sec) mysql 8.0 > CREATE TABLE fractest( -> id int not null primary key auto_increment, -> s varchar(255) not null, -> ts datetime(2) AS ( CAST(s as datetime(2)) ), -> INDEX (ts) -> ); Query OK, 0 rows affected (0.03 sec) mysql 8.0 > INSERT INTO fractest (s) VALUES ('2018-09-08 17:51:04.777'); Query OK, 1 row affected (0.02 sec) mysql 8.0 > SET sql_mode='TIME_TRUNCATE_FRACTIONAL'; Query OK, 0 rows affected (0.00 sec) mysql 8.0 > INSERT INTO fractest (s) VALUES ('2018-09-08 17:51:04.777'); Query OK, 1 row affected (0.01 sec) mysql 8.0 > SELECT * FROM fractest WHERE ts = '2018-09-08 17:51:04.77'; +----+-------------------------+------------------------+ | id | s | ts | +----+-------------------------+------------------------+ | 2 | 2018-09-08 17:51:04.777 | 2018-09-08 17:51:04.77 | +----+-------------------------+------------------------+ 1 row in set (0.00 sec) mysql 8.0 > SELECT * FROM fractest; +----+-------------------------+------------------------+ | id | s | ts | +----+-------------------------+------------------------+ | 1 | 2018-09-08 17:51:04.777 | 2018-09-08 17:51:04.77 | | 2 | 2018-09-08 17:51:04.777 | 2018-09-08 17:51:04.77 | +----+-------------------------+------------------------+ 2 rows in set (0.00 sec) mysql 8.0 >