summaryrefslogtreecommitdiff
path: root/libmysql
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-05-14 16:24:36 +0300
committerunknown <monty@mysql.com>2005-05-14 16:24:36 +0300
commit2fc28a36ad0e5c8c1681defe80be5352900c4b11 (patch)
tree438b1bf66c03f295f0c2546a80859345423c0539 /libmysql
parent4cda05b44ba3b8f4cc69d94f3cc0fc701dfc5b99 (diff)
downloadmariadb-git-2fc28a36ad0e5c8c1681defe80be5352900c4b11.tar.gz
After merge fixes
BitKeeper/deleted/.del-outfile2.result~fb702ee2518d8e6d: Delete: mysql-test/r/outfile2.result libmysql/libmysql.c: Fix indentation for new function mysql_set_character_set() mysql-test/r/alter_table.result: Fix test to be in same order as in 4.0 mysql-test/r/innodb.result: After merge fix mysql-test/r/insert_update.result: Add extra test for insert into ... on duplicate key upate mysql-test/r/outfile.result: After merge fix mysql-test/t/alter_table.test: Fix test to be in same order as in 4.0 mysql-test/t/insert_update.test: Add extra test for insert into ... on duplicate key upate mysql-test/t/outfile.test: After merge fix sql/item_func.cc: After merge fix sql/sql_table.cc: After merge fix
Diffstat (limited to 'libmysql')
-rw-r--r--libmysql/libmysql.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 4c9f06df38e..ff90cfb6007 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -1509,37 +1509,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