1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-8441 Bad SHOW CREATE TABLE output for a table with a virtual column

This commit is contained in:
Alexander Barkov
2015-08-10 11:46:41 +04:00
parent 840aefc6a3
commit 86a3613d4e
6 changed files with 85 additions and 32 deletions

View File

@@ -3061,6 +3061,9 @@ CHARSET_INFO* get_sql_field_charset(Create_field *sql_field,
Modifies the first column definition whose SQL type is TIMESTAMP
by adding the features DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP.
If the first TIMESTAMP column appears to be nullable, or to have an
explicit default, or to be a virtual column, then no promition is done.
@param column_definitions The list of column definitions, in the physical
order in which they appear in the table.
*/
@@ -3076,7 +3079,8 @@ void promote_first_timestamp_column(List<Create_field> *column_definitions)
{
if ((column_definition->flags & NOT_NULL_FLAG) != 0 && // NOT NULL,
column_definition->def == NULL && // no constant default,
column_definition->unireg_check == Field::NONE) // no function default
column_definition->unireg_check == Field::NONE && // no function default
column_definition->vcol_info == NULL)
{
DBUG_PRINT("info", ("First TIMESTAMP column '%s' was promoted to "
"DEFAULT CURRENT_TIMESTAMP ON UPDATE "