diff options
author | Igor Babaev <igor@askmonty.org> | 2010-07-28 12:09:38 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2010-07-28 12:09:38 -0700 |
commit | a008a6eb35cde020f80b4aefa2e3a351d0640c38 (patch) | |
tree | 753c9f69567a544bc629d3f1b61d11986cfe50b5 /sql/sql_show.cc | |
parent | 238098657ea4a9a620c1b972683c2cfc0d02afbd (diff) | |
download | mariadb-git-a008a6eb35cde020f80b4aefa2e3a351d0640c38.tar.gz |
Fixed bug #610890.
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.
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index b4c88d7f659..4dca54b6290 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -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) |