mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +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:
@@ -476,6 +476,18 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
|
||||
*/
|
||||
if (create_info->table_charset && sql_field->charset != &my_charset_bin)
|
||||
sql_field->charset= create_info->table_charset;
|
||||
|
||||
CHARSET_INFO *savecs= sql_field->charset;
|
||||
if ((sql_field->flags & BINCMP_FLAG) &&
|
||||
!(sql_field->charset= get_charset_by_csname(sql_field->charset->csname,
|
||||
MY_CS_BINSORT,MYF(0))))
|
||||
{
|
||||
char tmp[64];
|
||||
strmake(strmake(tmp, savecs->csname, sizeof(tmp)-4), "_bin", 4);
|
||||
my_error(ER_UNKNOWN_COLLATION, MYF(0), tmp);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
|
||||
sql_field->create_length_to_internal_length();
|
||||
|
||||
/* Don't pack keys in old tables if the user has requested this */
|
||||
|
||||
Reference in New Issue
Block a user