diff options
author | unknown <monty@mysql.com> | 2005-05-14 18:31:22 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2005-05-14 18:31:22 +0300 |
commit | f8f714a2fbd821488aa3d8e39d6c3a944c7b1aa1 (patch) | |
tree | c08ee86cd9f77c3a7dc13b02b09371ccd19f2b88 /libmysql | |
parent | bb2b8120615f48cd17682aa810e54b20a7002c77 (diff) | |
parent | 78f2e7b53db62a3bc67dcb5ed20dfe47cf680c66 (diff) | |
download | mariadb-git-f8f714a2fbd821488aa3d8e39d6c3a944c7b1aa1.tar.gz |
Merge with 4.1
BitKeeper/etc/logging_ok:
auto-union
BitKeeper/deleted/.del-errmsg.txt~11edc4db89248c16:
Auto merged
BitKeeper/deleted/.del-errmsg.txt~184eb1f09242dc72:
Auto merged
BitKeeper/deleted/.del-errmsg.txt~2cdeb8d6f80eba72:
Auto merged
BitKeeper/deleted/.del-errmsg.txt~4617575065d612b9:
Auto merged
BitKeeper/deleted/.del-errmsg.txt~587903f9311db2d1:
Auto merged
BitKeeper/deleted/.del-errmsg.txt~606dfaeb9e81aa4e:
Auto merged
BitKeeper/deleted/.del-errmsg.txt~6bbd9eac7f0e6b89:
Auto merged
BitKeeper/deleted/.del-errmsg.txt~7397c423c52c6d2c:
Auto merged
BitKeeper/deleted/.del-errmsg.txt~898865062c970766:
Auto merged
BitKeeper/deleted/.del-errmsg.txt~8ed1999cbd481dc4:
Auto merged
BitKeeper/deleted/.del-errmsg.txt~94a93cc742fca24d:
Auto merged
BitKeeper/deleted/.del-errmsg.txt~9dab24f7fb11b1e1:
Auto merged
BitKeeper/deleted/.del-errmsg.txt~b44a85a177954da0:
Auto merged
BitKeeper/deleted/.del-errmsg.txt~b6181e29d8282b06:
Auto merged
BitKeeper/deleted/.del-errmsg.txt~ba132dc9bc936c8a:
Auto merged
BitKeeper/deleted/.del-errmsg.txt~e2609fdf7870795:
Auto merged
BitKeeper/deleted/.del-errmsg.txt~e3183b99fbba0a9c:
Auto merged
BitKeeper/deleted/.del-errmsg.txt~eeb2c47537ed9c23:
Auto merged
BitKeeper/deleted/.del-errmsg.txt~ef28b592c7591b7:
Auto merged
BitKeeper/deleted/.del-errmsg.txt~ef53c33ac0ff8a84:
Auto merged
BitKeeper/deleted/.del-errmsg.txt~f19bfd5d4c918964:
Auto merged
BitKeeper/deleted/.del-errmsg.txt~f96b7055cac394e:
Auto merged
libmysql/libmysql.c:
Auto merged
myisam/mi_key.c:
Auto merged
mysql-test/r/alter_table.result:
Auto merged
mysql-test/r/auto_increment.result:
Auto merged
mysql-test/r/innodb.result:
Auto merged
mysql-test/r/select.result:
Auto merged
mysql-test/t/alter_table.test:
Auto merged
mysql-test/t/innodb.test:
Auto merged
mysql-test/t/select.test:
Auto merged
sql/handler.h:
Auto merged
sql/item_func.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
mysql-test/r/insert_update.result:
Auto merged
strings/ctype-ucs2.c:
Auto merged
sql/sql_table.cc:
merge
sql/unireg.cc:
merge
Diffstat (limited to 'libmysql')
-rw-r--r-- | libmysql/libmysql.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index f070d95780c..463f9da6ad5 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1495,37 +1495,40 @@ const char * STDCALL mysql_character_set_name(MYSQL *mysql) return mysql->charset->csname; } + int STDCALL mysql_set_character_set(MYSQL *mysql, char *cs_name) { struct charset_info_st *cs; - const char *save_csdir = charsets_dir; + const char *save_csdir= charsets_dir; if (mysql->options.charset_dir) - charsets_dir = mysql->options.charset_dir; + charsets_dir= mysql->options.charset_dir; - if ( (cs = get_charset_by_csname(cs_name, MY_CS_PRIMARY, MYF(0))) ) + if ((cs= get_charset_by_csname(cs_name, MY_CS_PRIMARY, MYF(0)))) { char buff[MY_CS_NAME_SIZE + 10]; - charsets_dir = save_csdir; + charsets_dir= save_csdir; sprintf(buff, "SET NAMES %s", cs_name); - if (!mysql_query(mysql, buff)) { - mysql->charset = cs; - } - } else { + if (!mysql_query(mysql, buff)) + { + mysql->charset= cs; + } + } + else + { char cs_dir_name[FN_REFLEN]; get_charsets_dir(cs_dir_name); - mysql->net.last_errno=CR_CANT_READ_CHARSET; + mysql->net.last_errno= CR_CANT_READ_CHARSET; strmov(mysql->net.sqlstate, unknown_sqlstate); - my_snprintf(mysql->net.last_error, sizeof(mysql->net.last_error)-1, - ER(mysql->net.last_errno), - cs_name, - cs_dir_name); + my_snprintf(mysql->net.last_error, sizeof(mysql->net.last_error) - 1, + ER(mysql->net.last_errno), cs_name, cs_dir_name); } - charsets_dir = save_csdir; + charsets_dir= save_csdir; return mysql->net.last_errno; } + uint STDCALL mysql_thread_safe(void) { #ifdef THREAD |