1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00
The CREATE SHOW TABLE command misplaced virtual column specifiers:
the AS clause for a virtual column was put before optional
character set attributes, not after them as required by the syntax.
This commit is contained in:
Igor Babaev
2010-07-28 12:09:38 -07:00
parent 238098657e
commit a008a6eb35
3 changed files with 31 additions and 13 deletions

View File

@ -1348,19 +1348,6 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
field->sql_type(type);
packet->append(type.ptr(), type.length(), system_charset_info);
if (field->vcol_info)
{
packet->append(STRING_WITH_LEN(" AS ("));
packet->append(field->vcol_info->expr_str.str,
field->vcol_info->expr_str.length,
system_charset_info);
packet->append(STRING_WITH_LEN(")"));
if (field->stored_in_db)
packet->append(STRING_WITH_LEN(" PERSISTENT"));
else
packet->append(STRING_WITH_LEN(" VIRTUAL"));
}
if (field->has_charset() &&
!(thd->variables.sql_mode & (MODE_MYSQL323 | MODE_MYSQL40)))
{
@ -1380,6 +1367,19 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
}
}
if (field->vcol_info)
{
packet->append(STRING_WITH_LEN(" AS ("));
packet->append(field->vcol_info->expr_str.str,
field->vcol_info->expr_str.length,
system_charset_info);
packet->append(STRING_WITH_LEN(")"));
if (field->stored_in_db)
packet->append(STRING_WITH_LEN(" PERSISTENT"));
else
packet->append(STRING_WITH_LEN(" VIRTUAL"));
}
if (flags & NOT_NULL_FLAG)
packet->append(STRING_WITH_LEN(" NOT NULL"));
else if (field->type() == MYSQL_TYPE_TIMESTAMP)