mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
1. New data types, from the user point of view:
BINARY(N) and VARBIBARY(N) 2. More 4.0 compatibility and more BINARY keyword consistency: 2a. CREATE TABLE a (a CHAR(N) BINARY) is now synonym for CREATE TABLE a (a CHAR(N) COLLATE xxxx_bin) 2b. SELECT BINARY x is still synonin for SELECT x COLLATE xxxxx_bin.
This commit is contained in:
@ -1247,26 +1247,21 @@ store_create_info(THD *thd, TABLE *table, String *packet)
|
||||
field->sql_type(type);
|
||||
packet->append(type.ptr(),type.length());
|
||||
|
||||
if (field->has_charset())
|
||||
if (field->has_charset() && !limited_mysql_mode && !foreign_db_mode)
|
||||
{
|
||||
if (field->charset() == &my_charset_bin)
|
||||
packet->append(" binary", 7);
|
||||
else if (!limited_mysql_mode && !foreign_db_mode)
|
||||
if (field->charset() != table->table_charset)
|
||||
{
|
||||
if (field->charset() != table->table_charset)
|
||||
{
|
||||
packet->append(" character set ", 15);
|
||||
packet->append(field->charset()->csname);
|
||||
}
|
||||
/*
|
||||
For string types dump collation name only if
|
||||
collation is not primary for the given charset
|
||||
*/
|
||||
if (!(field->charset()->state & MY_CS_PRIMARY))
|
||||
{
|
||||
packet->append(" collate ", 9);
|
||||
packet->append(field->charset()->name);
|
||||
}
|
||||
packet->append(" character set ", 15);
|
||||
packet->append(field->charset()->csname);
|
||||
}
|
||||
/*
|
||||
For string types dump collation name only if
|
||||
collation is not primary for the given charset
|
||||
*/
|
||||
if (!(field->charset()->state & MY_CS_PRIMARY))
|
||||
{
|
||||
packet->append(" collate ", 9);
|
||||
packet->append(field->charset()->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user