mariadb/mysql-test/suite/gcol/r/gcol_bug20746926.result
Sergei Golubchik 2c983b5ebb MDEV-38006 Inconsistent behaviors when casting into time
number-to-time conversion was too eagerly capping the value.

A string "9000090" was invalid time, because of 90 seconds.
But number-to-time was capping first, validating later,
to 9000090->time worked. Let's fix it.

also, let's make invalid time values in a string field include
the field name in the warning message, just like invalid time
values in a numeric field do.
2026-01-14 19:44:54 +01:00

32 lines
1.1 KiB
Text

#Bug #20746926: GENERATED COLUMNS: INVALID READ OF THD WHEN WARNINGS
#
# Testing cmp_item_datetime
connect con1,localhost,root,,;
set sql_mode='';
create table t1 (
a date not null,
b mediumtext generated always as ((a not in (a,a))) virtual,
c timestamp generated always as ((a not in (b,b))) stored
);
insert t1(a) values(7777777777);
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
Warning 1292 Incorrect datetime value: '0' for column `test`.`t1`.`b` at row 1
show warnings;
Level Code Message
Warning 1265 Data truncated for column 'a' at row 1
Warning 1292 Incorrect datetime value: '0' for column `test`.`t1`.`b` at row 1
disconnect con1;
connect con2,localhost,root,,;
set sql_mode='';
insert t1(a) values(6666666666);
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
Warning 1292 Incorrect datetime value: '0' for column `test`.`t1`.`b` at row 1
show warnings;
Level Code Message
Warning 1265 Data truncated for column 'a' at row 1
Warning 1292 Incorrect datetime value: '0' for column `test`.`t1`.`b` at row 1
drop table t1;
disconnect con2;
connection default;