Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL)
-
with 10.3 and 10.4 system on Windows and Linux
Description
With the following procedure you can reproduce the bug:
1. Query cache needs to be ON
2. Create the Table
CREATE TABLE `test`.`virtualtest` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`aDateTime` DATETIME,
`isGreater` TINYINT(1) GENERATED ALWAYS AS (IF(CURRENT_TIMESTAMP()>`aDateTime`,TRUE,FALSE)) VIRTUAL,
PRIMARY KEY (`id`)
);
3. Insert data
INSERT INTO `virtualtest` (`aDateTime`) VALUES (TIMESTAMPADD(SECOND,30,CURRENT_TIMESTAMP()));
4. Select the data
SELECT * FROM `virtualtest` a;
Expected behaviour:
When current timestamp ist graeater than the timestamp in the table the field isGreater whould become true.
But when the query is executed before (isGreater=false) this time the result will keep FALSE even when current timestamp is greater.
Conclusion:
Obviously the result set is stored in query cache. I guess the check for query cache doesn't check the expressen of virtual columns.
Attachments
Issue Links
- duplicates
-
MDEV-14043 Virtual columns depending on system function work incorrectly with query cache
- Open