Below is the list of changes that have just been committed into a local
5.0 repository of iggy. When iggy does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-07-13 17:46:02-04:00, iggy@stripped +1 -0
Bug #11972: client uses wrong character set after reconnect.
The client uses the value specified by the --default-characterset parameter but there is no way to change the value once the client starts.
client/mysql.cc@stripped, 2006-07-13 17:46:00-04:00, iggy@stripped +38 -9
Added new client command defcharset which gives users the ability to re-define the command line parameter --default-charset once the client has started.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: iggy
# Host: rolltop.ignatz42.dyndns.org
# Root: /mnt/storeage/mysql-5.0-maint_bug11972
--- 1.206/client/mysql.cc 2006-07-13 17:46:07 -04:00
+++ 1.207/client/mysql.cc 2006-07-13 17:46:07 -04:00
@@ -189,15 +189,16 @@
/* The names of functions that actually do the manipulation. */
static int get_options(int argc,char **argv);
static int com_quit(String *str,char*),
- com_go(String *str,char*), com_ego(String *str,char*),
- com_print(String *str,char*),
- com_help(String *str,char*), com_clear(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_charset(String *str,char*),
- com_prompt(String *str, char*), com_delimiter(String *str, char*),
- com_warnings(String *str, char*), com_nowarnings(String *str, char*);
+ com_go(String *str,char*), com_ego(String *str,char*),
+ com_print(String *str,char*),
+ com_help(String *str,char*), com_clear(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_charset(String *str,char*),
+ com_defcharset(String *str,char*), com_prompt(String *str, char*),
+ com_delimiter(String *str, char*), com_warnings(String *str, char*),
+ com_nowarnings(String *str, char*);
#ifdef USE_POPEN
static int com_nopager(String *str, char*), com_pager(String *str, char*),
@@ -271,6 +272,8 @@
"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." },
+ { "defcharset", 'D', com_defcharset, 1,
+ "Set the default charset on both the client and the server." },
{ "warnings", 'W', com_warnings, 0,
"Show warnings after every statement." },
{ "nowarning", 'w', com_nowarnings, 0,
@@ -1939,6 +1942,32 @@
{
charset_info= new_cs;
put_info("Charset changed", INFO_INFO);
+ }
+ else put_info("Charset is not found", INFO_INFO);
+ return 0;
+}
+
+ /* ARGSUSED */
+static int
+com_defcharset(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: \\D char_setname | defaultcharset 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;
+ mysql_set_character_set(&mysql, charset_info->csname);
+ default_charset_used= 1;
+ default_charset= (char *)charset_info->csname;
+ put_info("Default charset changed", INFO_INFO);
}
else put_info("Charset is not found", INFO_INFO);
return 0;
| Thread |
|---|
| • bk commit into 5.0 tree (iggy:1.2220) BUG#11972 | Ignacio Galarza | 13 Jul |