diff -u --label \#\<buffer\ mdev_38752.result\<main\>\> --label \#\<buffer\ mdev_38752.result\<mysql-server\>\> /tmp/buffer-content-FPcrhy /tmp/buffer-content-CnF23Y
--- #<buffer mdev_38752.result<main>>
+++ #<buffer mdev_38752.result<mysql-server>>
@@ -1,10 +1,14 @@
+SET sql_mode = sys.list_drop(@@sql_mode, 'ONLY_FULL_GROUP_BY');
+set @old_sql_mode=@@sql_mode;
 # int and tinyint original case
 CREATE TABLE t (a INT, va TINYINT AS (a), KEY(va));
 ## requires STRICT_ALL_TABLES to fail
 SET sql_mode=STRICT_ALL_TABLES;
+Warnings:
+Warning	3135	'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
 INSERT INTO t (a) VALUES (100),(150),(200);
 ERROR 22003: Out of range value for column 'va' at row 2
-SET sql_mode=default;
+SET sql_mode=@old_sql_mode;
 truncate table t;
 INSERT IGNORE INTO t (a) VALUES (100),(150),(200);
 Warnings:
@@ -13,7 +17,8 @@
 SELECT a, COUNT(*) FROM t GROUP BY a;
 a	COUNT(*)
 100	1
-150	2
+150	1
+200	1
 SELECT * FROM t;
 a	va
 100	100
@@ -72,13 +77,15 @@
 CREATE TABLE t (a decimal(6,3), b int AS (a), KEY(b));
 ## no error even with STRICT_ALL_TABLES
 SET sql_mode=STRICT_ALL_TABLES;
+Warnings:
+Warning	3135	'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
 INSERT INTO t (a) VALUES (33.11),(33.222);
 explain
 SELECT a, COUNT(*) FROM t GROUP BY a;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t	ALL	NULL	NULL	NULL	NULL	2	Using temporary; Using filesort
+id	select_type	table	partitions	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	t	NULL	ALL	NULL	NULL	NULL	NULL	2	100.00	Using temporary
 Warnings:
-Note	1105	Cannot substitute virtual column expression `t`.`a` -> b due to type mismatch
+Note	1003	/* select#1 */ select `test`.`t`.`a` AS `a`,count(0) AS `COUNT(*)` from `test`.`t` group by `test`.`t`.`a`
 SELECT a, COUNT(*) FROM t GROUP BY a;
 a	COUNT(*)
 33.110	1
@@ -90,15 +97,15 @@
 a	b
 33.110	33
 33.222	33
-SET sql_mode=default;
+SET sql_mode=@old_sql_mode;
 truncate table t;
 INSERT IGNORE INTO t (a) VALUES (33.11),(33.222);
 explain
 SELECT a, COUNT(*) FROM t GROUP BY a;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t	ALL	NULL	NULL	NULL	NULL	2	Using temporary; Using filesort
+id	select_type	table	partitions	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	t	NULL	ALL	NULL	NULL	NULL	NULL	2	100.00	Using temporary
 Warnings:
-Note	1105	Cannot substitute virtual column expression `t`.`a` -> b due to type mismatch
+Note	1003	/* select#1 */ select `test`.`t`.`a` AS `a`,count(0) AS `COUNT(*)` from `test`.`t` group by `test`.`t`.`a`
 SELECT a, COUNT(*) FROM t GROUP BY a;
 a	COUNT(*)
 33.110	1
@@ -115,18 +122,21 @@
 CREATE TABLE t (a decimal(5,3), b decimal(4,2) AS (a), KEY(b));
 ## no error even with STRICT_ALL_TABLES
 SET sql_mode=STRICT_ALL_TABLES;
+Warnings:
+Warning	3135	'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
 INSERT INTO t (a) VALUES (33.111),(33.112);
 Warnings:
 Note	1265	Data truncated for column 'b' at row 1
 Note	1265	Data truncated for column 'b' at row 2
 SELECT a, COUNT(*) FROM t GROUP BY a;
 a	COUNT(*)
-33.111	2
+33.111	1
+33.112	1
 SELECT * FROM t;
 a	b
 33.111	33.11
 33.112	33.11
-SET sql_mode=default;
+SET sql_mode=@old_sql_mode;
 truncate table t;
 INSERT IGNORE INTO t (a) VALUES (33.111),(33.112);
 Warnings:
@@ -134,7 +144,8 @@
 Note	1265	Data truncated for column 'b' at row 2
 SELECT a, COUNT(*) FROM t GROUP BY a;
 a	COUNT(*)
-33.111	2
+33.111	1
+33.112	1
 SELECT * FROM t;
 a	b
 33.111	33.11
@@ -150,7 +161,8 @@
 Warning	1264	Out of range value for column 'b' at row 2
 SELECT a, COUNT(*) FROM t GROUP BY a;
 a	COUNT(*)
-333.110	2
+333.110	1
+333.112	1
 SELECT * FROM t;
 a	b
 333.110	9.9999
@@ -159,14 +171,15 @@
 # varchar(10) and varchar(5)
 CREATE TABLE t (a varchar(10), b varchar(5) as (a), key(b));
 INSERT INTO t (a) VALUES ('12345-aaa'),('12345-bbb');
-ERROR 22001: Data too long for column 'b' at row 1
+ERROR 01000: Data truncated for column 'b' at row 1
 INSERT IGNORE INTO t (a) VALUES ('12345-aaa'),('12345-bbb');
 Warnings:
 Warning	1265	Data truncated for column 'b' at row 1
 Warning	1265	Data truncated for column 'b' at row 2
 SELECT a, COUNT(*) FROM t GROUP BY a;
 a	COUNT(*)
-12345-aaa	2
+12345-aaa	1
+12345-bbb	1
 SELECT * FROM t;
 a	b
 12345-aaa	12345
@@ -176,16 +189,18 @@
 CREATE TABLE t (a datetime, b date as (a), key(b));
 ## no error even with STRICT_ALL_TABLES
 SET sql_mode=STRICT_ALL_TABLES;
+Warnings:
+Warning	3135	'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
 INSERT INTO t (a) VALUES ('2026-01-01 12:00'),('2026-01-01 16:00');
 Warnings:
-Note	1265	Data truncated for column 'b' at row 1
-Note	1265	Data truncated for column 'b' at row 2
+Note	1292	Incorrect date value: '2026-01-01 12:00:00' for column 'b' at row 1
+Note	1292	Incorrect date value: '2026-01-01 16:00:00' for column 'b' at row 2
 explain
 SELECT a, COUNT(*) FROM t GROUP BY a;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t	ALL	NULL	NULL	NULL	NULL	2	Using temporary; Using filesort
+id	select_type	table	partitions	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	t	NULL	ALL	NULL	NULL	NULL	NULL	2	100.00	Using temporary
 Warnings:
-Note	1105	Cannot substitute virtual column expression `t`.`a` -> b due to type mismatch
+Note	1003	/* select#1 */ select `test`.`t`.`a` AS `a`,count(0) AS `COUNT(*)` from `test`.`t` group by `test`.`t`.`a`
 SELECT a, COUNT(*) FROM t GROUP BY a;
 a	COUNT(*)
 2026-01-01 12:00:00	1
@@ -193,11 +208,17 @@
 SELECT a, COUNT(*) FROM t GROUP BY b;
 a	COUNT(*)
 2026-01-01 12:00:00	2
+Warnings:
+Note	1292	Incorrect date value: '2026-01-01 12:00:00' for column 'b' at row 1
+Note	1292	Incorrect date value: '2026-01-01 16:00:00' for column 'b' at row 1
 SELECT * FROM t;
 a	b
 2026-01-01 12:00:00	2026-01-01
 2026-01-01 16:00:00	2026-01-01
-SET sql_mode=default;
+Warnings:
+Note	1292	Incorrect date value: '2026-01-01 12:00:00' for column 'b' at row 1
+Note	1292	Incorrect date value: '2026-01-01 16:00:00' for column 'b' at row 2
+SET sql_mode=@old_sql_mode;
 truncate table t;
 INSERT IGNORE INTO t (a) VALUES ('2026-01-01 12:00'),('2026-01-01 16:00');
 Warnings:
@@ -205,10 +226,10 @@
 Note	1265	Data truncated for column 'b' at row 2
 explain
 SELECT a, COUNT(*) FROM t GROUP BY a;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t	ALL	NULL	NULL	NULL	NULL	2	Using temporary; Using filesort
+id	select_type	table	partitions	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	t	NULL	ALL	NULL	NULL	NULL	NULL	2	100.00	Using temporary
 Warnings:
-Note	1105	Cannot substitute virtual column expression `t`.`a` -> b due to type mismatch
+Note	1003	/* select#1 */ select `test`.`t`.`a` AS `a`,count(0) AS `COUNT(*)` from `test`.`t` group by `test`.`t`.`a`
 SELECT a, COUNT(*) FROM t GROUP BY a;
 a	COUNT(*)
 2026-01-01 12:00:00	1
@@ -216,25 +237,30 @@
 SELECT a, COUNT(*) FROM t GROUP BY b;
 a	COUNT(*)
 2026-01-01 12:00:00	2
+Warnings:
+Note	1292	Incorrect date value: '2026-01-01 12:00:00' for column 'b' at row 1
+Note	1292	Incorrect date value: '2026-01-01 16:00:00' for column 'b' at row 1
 SELECT * FROM t;
 a	b
 2026-01-01 12:00:00	2026-01-01
 2026-01-01 16:00:00	2026-01-01
+Warnings:
+Note	1292	Incorrect date value: '2026-01-01 12:00:00' for column 'b' at row 1
+Note	1292	Incorrect date value: '2026-01-01 16:00:00' for column 'b' at row 2
 DROP TABLE t;
 # datetime and time, optimization disabled
 CREATE TABLE t (a datetime, b time as (a), key(b));
 ## no error even with STRICT_ALL_TABLES
 SET sql_mode=STRICT_ALL_TABLES;
-INSERT INTO t (a) VALUES ('2026-01-01 12:00'),('2026-03-01 12:00');
 Warnings:
-Note	1265	Data truncated for column 'b' at row 1
-Note	1265	Data truncated for column 'b' at row 2
+Warning	3135	'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
+INSERT INTO t (a) VALUES ('2026-01-01 12:00'),('2026-03-01 12:00');
 explain
 SELECT a, COUNT(*) FROM t GROUP BY a;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t	ALL	NULL	NULL	NULL	NULL	2	Using temporary; Using filesort
+id	select_type	table	partitions	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	t	NULL	ALL	NULL	NULL	NULL	NULL	2	100.00	Using temporary
 Warnings:
-Note	1105	Cannot substitute virtual column expression `t`.`a` -> b due to type mismatch
+Note	1003	/* select#1 */ select `test`.`t`.`a` AS `a`,count(0) AS `COUNT(*)` from `test`.`t` group by `test`.`t`.`a`
 SELECT a, COUNT(*) FROM t GROUP BY a;
 a	COUNT(*)
 2026-01-01 12:00:00	1
@@ -246,18 +272,15 @@
 a	b
 2026-01-01 12:00:00	12:00:00
 2026-03-01 12:00:00	12:00:00
-SET sql_mode=default;
+SET sql_mode=@old_sql_mode;
 truncate table t;
 INSERT IGNORE INTO t (a) VALUES ('2026-01-01 12:00'),('2026-03-01 12:00');
-Warnings:
-Note	1265	Data truncated for column 'b' at row 1
-Note	1265	Data truncated for column 'b' at row 2
 explain
 SELECT a, COUNT(*) FROM t GROUP BY a;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t	ALL	NULL	NULL	NULL	NULL	2	Using temporary; Using filesort
+id	select_type	table	partitions	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	t	NULL	ALL	NULL	NULL	NULL	NULL	2	100.00	Using temporary
 Warnings:
-Note	1105	Cannot substitute virtual column expression `t`.`a` -> b due to type mismatch
+Note	1003	/* select#1 */ select `test`.`t`.`a` AS `a`,count(0) AS `COUNT(*)` from `test`.`t` group by `test`.`t`.`a`
 SELECT a, COUNT(*) FROM t GROUP BY a;
 a	COUNT(*)
 2026-01-01 12:00:00	1
@@ -274,41 +297,25 @@
 CREATE TABLE t (a time(3), b time(2) as (a));
 drop table t;
 CREATE TABLE t (a time(3), b time(2) as (a), key (b));
-ERROR HY000: Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `b`
+drop table t;
 # signed and unsigned, optimization disabled
 CREATE TABLE t (a tinyint, b tinyint unsigned as (a));
-## succeeds even with STRICT_ALL_TABLES
-SET sql_mode=STRICT_ALL_TABLES;
 INSERT INTO t (a) VALUES (-1),(-2),(111);
-explain
-SELECT a, COUNT(*) FROM t GROUP BY a;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t	ALL	NULL	NULL	NULL	NULL	3	Using temporary; Using filesort
-SELECT a, COUNT(*) FROM t GROUP BY a;
-a	COUNT(*)
--2	1
--1	1
-111	1
-SELECT a, COUNT(*) FROM t GROUP BY b;
-a	COUNT(*)
--1	2
-111	1
-SELECT * FROM t;
-a	b
--1	0
--2	0
-111	111
-SET sql_mode=default;
-truncate table t;
+ERROR 22003: Out of range value for column 'b' at row 1
 INSERT IGNORE INTO t (a) VALUES (-1),(-2),(111);
+Warnings:
+Warning	1264	Out of range value for column 'b' at row 1
+Warning	1264	Out of range value for column 'b' at row 2
 explain
 SELECT a, COUNT(*) FROM t GROUP BY a;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t	ALL	NULL	NULL	NULL	NULL	3	Using temporary; Using filesort
+id	select_type	table	partitions	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	t	NULL	ALL	NULL	NULL	NULL	NULL	3	100.00	Using temporary
+Warnings:
+Note	1003	/* select#1 */ select `test`.`t`.`a` AS `a`,count(0) AS `COUNT(*)` from `test`.`t` group by `test`.`t`.`a`
 SELECT a, COUNT(*) FROM t GROUP BY a;
 a	COUNT(*)
--2	1
 -1	1
+-2	1
 111	1
 SELECT a, COUNT(*) FROM t GROUP BY b;
 a	COUNT(*)
@@ -323,22 +330,26 @@
 #######
 # insert then add index
 CREATE TABLE t (a INT, va TINYINT AS (a));
-SET sql_mode=STRICT_ALL_TABLES;
 INSERT INTO t (a) VALUES (100),(150),(200);
-SET sql_mode=DEFAULT;
-ALTER TABLE t add index i(a);
 ERROR 22003: Out of range value for column 'va' at row 2
+INSERT IGNORE INTO t (a) VALUES (100),(150),(200);
+Warnings:
+Warning	1264	Out of range value for column 'va' at row 2
+Warning	1264	Out of range value for column 'va' at row 3
+ALTER TABLE t add index i(a);
 drop table t;
 # insert ignore overrides STRICT_ALL_TABLES
 CREATE TABLE t (a INT, b TINYINT AS (a), key (b));
 SET sql_mode=STRICT_ALL_TABLES;
+Warnings:
+Warning	3135	'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
 INSERT INTO t (a) VALUES (100),(150),(200);
 ERROR 22003: Out of range value for column 'b' at row 2
 INSERT IGNORE INTO t (a) VALUES (100),(150),(200);
 Warnings:
 Warning	1264	Out of range value for column 'b' at row 2
 Warning	1264	Out of range value for column 'b' at row 3
-SET sql_mode=DEFAULT;
+SET sql_mode=@old_sql_mode;
 drop table t;
 # order by also affected
 CREATE TABLE t (a INT, va TINYINT AS (a), key (va));
@@ -351,8 +362,8 @@
 a	va
 100	100
 150	127
-200	127
 180	127
+200	127
 drop table t;
 # where also affected
 CREATE TABLE t (a INT, va TINYINT AS (a), key (va));
@@ -363,7 +374,4 @@
 Warning	1264	Out of range value for column 'va' at row 4
 select * from t where a = 127;
 a	va
-150	127
-200	127
-180	127
 drop table t;

Diff finished.  Thu Apr  2 15:12:53 2026
