mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
New SQL variables "collation_server" and "collation_database"
This commit is contained in:
@ -62,7 +62,7 @@ static bool write_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create)
|
||||
ulong length;
|
||||
CHARSET_INFO *cs= (create && create->table_charset) ?
|
||||
create->table_charset :
|
||||
thd->variables.character_set_database;
|
||||
thd->variables.collation_database;
|
||||
length= my_sprintf(buf,(buf, "default-character-set=%s\ndefault-collation=%s\n", cs->csname,cs->name));
|
||||
|
||||
/* Error is written by my_write */
|
||||
@ -99,7 +99,7 @@ static bool load_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create)
|
||||
uint nbytes;
|
||||
|
||||
bzero((char*) create,sizeof(*create));
|
||||
create->table_charset= global_system_variables.character_set_database;
|
||||
create->table_charset= global_system_variables.collation_database;
|
||||
if ((file=my_open(path, O_RDONLY | O_SHARE, MYF(0))) >= 0)
|
||||
{
|
||||
IO_CACHE cache;
|
||||
@ -288,8 +288,8 @@ int mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info)
|
||||
{
|
||||
thd->db_charset= (create_info && create_info->table_charset) ?
|
||||
create_info->table_charset :
|
||||
global_system_variables.character_set_database;
|
||||
thd->variables.character_set_database= thd->db_charset;
|
||||
global_system_variables.collation_database;
|
||||
thd->variables.collation_database= thd->db_charset;
|
||||
}
|
||||
|
||||
mysql_update_log.write(thd,thd->query, thd->query_length);
|
||||
@ -632,8 +632,8 @@ bool mysql_change_db(THD *thd, const char *name)
|
||||
load_db_opt(thd, path, &create);
|
||||
thd->db_charset= create.table_charset ?
|
||||
create.table_charset :
|
||||
global_system_variables.character_set_database;
|
||||
thd->variables.character_set_database= thd->db_charset;
|
||||
global_system_variables.collation_database;
|
||||
thd->variables.collation_database= thd->db_charset;
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user