1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

MCOL-2000 Fix CREATE TABLE syntax

for a generated replacement statements of original statements:
* `CREATE TABLE .. LIKE ..`
* `ALTER TABLE .. ENGINE=Columnstore`
* `CREATE TABLE .. AS ..`
This commit is contained in:
Alexey Antipovsky
2020-12-04 22:18:17 +03:00
parent 5ef444c46e
commit b1d1ad1486

View File

@ -2395,6 +2395,18 @@ int ha_mcs_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO* crea
oss << ", ";
oss << (*field)->field_name.str << " " << datatype.ptr();
if ((*field)->has_charset())
{
const CHARSET_INFO* field_cs = (*field)->charset();
if (field_cs &&
(!share->table_charset ||
field_cs->number != share->table_charset->number))
{
oss << " CHARACTER SET " << field_cs->csname;
}
}
if (flags & NOT_NULL_FLAG)
oss << " NOT NULL";
@ -2404,12 +2416,6 @@ int ha_mcs_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO* crea
oss << " DEFAULT " << def_value.c_ptr();
}
const CHARSET_INFO* field_cs = (*field)->charset();
if (field_cs && (!share->table_charset || field_cs->number != share->table_charset->number))
{
oss << " CHARACTER SET " << field_cs->csname;
}
if ((*field)->comment.length)
{
String comment;