[MDEV-24766] Duplicate warnings ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED upon on ALTER TABLE Created: 2021-02-02  Updated: 2021-02-02

Status: Open
Project: MariaDB Server
Component/s: Data Definition - Alter Table
Affects Version/s: 10.4
Fix Version/s: 10.4

Type: Bug Priority: Trivial
Reporter: Elena Stepanova Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

CREATE TABLE t1 (a TIMESTAMP(6), b TIMESTAMP AS (a) VIRTUAL);
ALTER TABLE t1 ADD INDEX(b);

10.4 542d769e

MariaDB [test]> show warnings;
+---------+------+--------------------------------------------------------------------------------------+
| Level   | Code | Message                                                                              |
+---------+------+--------------------------------------------------------------------------------------+
| Warning | 1901 | Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `b` |
| Warning | 1105 | Expression depends on the @@sql_mode value TIME_ROUND_FRACTIONAL                     |
| Warning | 1901 | Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `b` |
| Warning | 1105 | Expression depends on the @@sql_mode value TIME_ROUND_FRACTIONAL                     |
+---------+------+--------------------------------------------------------------------------------------+
4 rows in set (0.000 sec)

The warning is probably expected, but the duplication isn't.
Only applies to 10.4. 10.3 doesn't have this SQL mode, hence no warning, in 10.5 it is an error (and is not duplicated in SHOW WARNINGS).


Generated at Thu Feb 08 09:32:30 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.