Loading client/mysql.cc +25 −1 Original line number Diff line number Diff line Loading @@ -194,7 +194,7 @@ static int com_quit(String *str,char*), com_connect(String *str,char*), com_status(String *str,char*), com_use(String *str,char*), com_source(String *str, char*), com_rehash(String *str, char*), com_tee(String *str, char*), com_notee(String *str, char*), com_notee(String *str, char*), com_charset(String *str,char*), com_prompt(String *str, char*), com_delimiter(String *str, char*), com_warnings(String *str, char*), com_nowarnings(String *str, char*); Loading Loading @@ -268,6 +268,8 @@ static COMMANDS commands[] = { "Set outfile [to_outfile]. Append everything into given outfile." }, { "use", 'u', com_use, 1, "Use another database. Takes database name as argument." }, { "charset", 'C', com_charset, 1, "Switch to another charset. Might be needed for processing binlog with multi-byte charsets." }, { "warnings", 'W', com_warnings, 0, "Show warnings after every statement." }, { "nowarning", 'w', com_nowarnings, 0, Loading Loading @@ -1909,6 +1911,28 @@ com_clear(String *buffer,char *line __attribute__((unused))) return 0; } /* ARGSUSED */ static int com_charset(String *buffer __attribute__((unused)), char *line) { char buff[256], *param; CHARSET_INFO * new_cs; strmake(buff, line, sizeof(buff) - 1); param= get_arg(buff, 0); if (!param || !*param) { return put_info("Usage: \\C char_setname | charset charset_name", INFO_ERROR, 0); } new_cs= get_charset_by_csname(param, MY_CS_PRIMARY, MYF(MY_WME)); if (new_cs) { charset_info= new_cs; put_info("Charset changed", INFO_INFO); } else put_info("Charset is not found", INFO_INFO); return 0; } /* Execute command Loading mysql-test/r/binlog_stm_ctype_ucs.result +1 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ use test; SET TIMESTAMP=10000; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; SET @@session.sql_mode=0; /*!\C latin1 */; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t2 values (@v); # End of log file Loading mysql-test/r/func_if.result +7 −0 Original line number Diff line number Diff line Loading @@ -121,3 +121,10 @@ a NULLIF(a,'') NULL NULL NULL DROP TABLE t1; create table t1 (f1 int, f2 int); insert into t1 values(1,1),(0,0); select f1, f2, if(f1, 40.0, 5.00) from t1 group by f1 order by f2; f1 f2 if(f1, 40.0, 5.00) 0 0 5.00 1 1 40.00 drop table t1; mysql-test/r/mysql.result +10 −0 Original line number Diff line number Diff line Loading @@ -59,3 +59,13 @@ database() test unlock tables; drop table t1; ソ ソ c_cp932 ソ ソ ソ ソ ソ ソ ソ mysql-test/r/mysqlbinlog.result +24 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ use test; SET TIMESTAMP=1000000000; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; SET @@session.sql_mode=0; /*!\C latin1 */; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; drop table if exists t1,t2; SET TIMESTAMP=1000000000; Loading Loading @@ -50,6 +51,7 @@ use test; SET TIMESTAMP=1000000000; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; SET @@session.sql_mode=0; /*!\C latin1 */; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values ("Alas"); # End of log file Loading @@ -72,6 +74,7 @@ use test; SET TIMESTAMP=1000000000; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; SET @@session.sql_mode=0; /*!\C latin1 */; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values ("Alas"); # End of log file Loading @@ -86,6 +89,7 @@ use test; SET TIMESTAMP=1000000000; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; SET @@session.sql_mode=0; /*!\C latin1 */; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; drop table if exists t1,t2; SET TIMESTAMP=1000000000; Loading Loading @@ -116,6 +120,7 @@ use test; SET TIMESTAMP=1000000000; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; SET @@session.sql_mode=0; /*!\C latin1 */; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values ("Alas"); # End of log file Loading @@ -138,6 +143,7 @@ use test; SET TIMESTAMP=1000000000; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; SET @@session.sql_mode=0; /*!\C latin1 */; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values ("Alas"); # End of log file Loading Loading @@ -166,4 +172,21 @@ insert t1 values (1); # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; drop table t1, t2; flush logs; create table t3 (f text character set utf8); create table t4 (f text character set cp932); flush logs; rename table t3 to t03, t4 to t04; select HEX(f) from t03; HEX(f) E382BD select HEX(f) from t3; HEX(f) E382BD select HEX(f) from t04; HEX(f) 835C select HEX(f) from t4; HEX(f) 835C drop table t1, t2, t03, t04, t3, t4; Loading
client/mysql.cc +25 −1 Original line number Diff line number Diff line Loading @@ -194,7 +194,7 @@ static int com_quit(String *str,char*), com_connect(String *str,char*), com_status(String *str,char*), com_use(String *str,char*), com_source(String *str, char*), com_rehash(String *str, char*), com_tee(String *str, char*), com_notee(String *str, char*), com_notee(String *str, char*), com_charset(String *str,char*), com_prompt(String *str, char*), com_delimiter(String *str, char*), com_warnings(String *str, char*), com_nowarnings(String *str, char*); Loading Loading @@ -268,6 +268,8 @@ static COMMANDS commands[] = { "Set outfile [to_outfile]. Append everything into given outfile." }, { "use", 'u', com_use, 1, "Use another database. Takes database name as argument." }, { "charset", 'C', com_charset, 1, "Switch to another charset. Might be needed for processing binlog with multi-byte charsets." }, { "warnings", 'W', com_warnings, 0, "Show warnings after every statement." }, { "nowarning", 'w', com_nowarnings, 0, Loading Loading @@ -1909,6 +1911,28 @@ com_clear(String *buffer,char *line __attribute__((unused))) return 0; } /* ARGSUSED */ static int com_charset(String *buffer __attribute__((unused)), char *line) { char buff[256], *param; CHARSET_INFO * new_cs; strmake(buff, line, sizeof(buff) - 1); param= get_arg(buff, 0); if (!param || !*param) { return put_info("Usage: \\C char_setname | charset charset_name", INFO_ERROR, 0); } new_cs= get_charset_by_csname(param, MY_CS_PRIMARY, MYF(MY_WME)); if (new_cs) { charset_info= new_cs; put_info("Charset changed", INFO_INFO); } else put_info("Charset is not found", INFO_INFO); return 0; } /* Execute command Loading
mysql-test/r/binlog_stm_ctype_ucs.result +1 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ use test; SET TIMESTAMP=10000; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; SET @@session.sql_mode=0; /*!\C latin1 */; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t2 values (@v); # End of log file Loading
mysql-test/r/func_if.result +7 −0 Original line number Diff line number Diff line Loading @@ -121,3 +121,10 @@ a NULLIF(a,'') NULL NULL NULL DROP TABLE t1; create table t1 (f1 int, f2 int); insert into t1 values(1,1),(0,0); select f1, f2, if(f1, 40.0, 5.00) from t1 group by f1 order by f2; f1 f2 if(f1, 40.0, 5.00) 0 0 5.00 1 1 40.00 drop table t1;
mysql-test/r/mysql.result +10 −0 Original line number Diff line number Diff line Loading @@ -59,3 +59,13 @@ database() test unlock tables; drop table t1; ソ ソ c_cp932 ソ ソ ソ ソ ソ ソ ソ
mysql-test/r/mysqlbinlog.result +24 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ use test; SET TIMESTAMP=1000000000; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; SET @@session.sql_mode=0; /*!\C latin1 */; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; drop table if exists t1,t2; SET TIMESTAMP=1000000000; Loading Loading @@ -50,6 +51,7 @@ use test; SET TIMESTAMP=1000000000; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; SET @@session.sql_mode=0; /*!\C latin1 */; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values ("Alas"); # End of log file Loading @@ -72,6 +74,7 @@ use test; SET TIMESTAMP=1000000000; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; SET @@session.sql_mode=0; /*!\C latin1 */; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values ("Alas"); # End of log file Loading @@ -86,6 +89,7 @@ use test; SET TIMESTAMP=1000000000; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; SET @@session.sql_mode=0; /*!\C latin1 */; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; drop table if exists t1,t2; SET TIMESTAMP=1000000000; Loading Loading @@ -116,6 +120,7 @@ use test; SET TIMESTAMP=1000000000; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; SET @@session.sql_mode=0; /*!\C latin1 */; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values ("Alas"); # End of log file Loading @@ -138,6 +143,7 @@ use test; SET TIMESTAMP=1000000000; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; SET @@session.sql_mode=0; /*!\C latin1 */; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values ("Alas"); # End of log file Loading Loading @@ -166,4 +172,21 @@ insert t1 values (1); # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; drop table t1, t2; flush logs; create table t3 (f text character set utf8); create table t4 (f text character set cp932); flush logs; rename table t3 to t03, t4 to t04; select HEX(f) from t03; HEX(f) E382BD select HEX(f) from t3; HEX(f) E382BD select HEX(f) from t04; HEX(f) 835C select HEX(f) from t4; HEX(f) 835C drop table t1, t2, t03, t04, t3, t4;