1
0
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:
bar@bar.mysql.r18.ru
2003-09-15 16:31:04 +05:00
parent 8d05911df0
commit 1d20c09ce9
9 changed files with 126 additions and 30 deletions

View File

@ -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);
}