mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
BUG#16217 fix partly backported from 5.0. It is different in mysqlbinlog part.
This changeset is assumed to stay in 4.1. client/mysql.cc: BUG#16217 forced to introduce a separate mysql client command. Feature is backported from 5.0, precisely ChangeSet 1.2034 06/02/09 16:23:09 aelkin@mysql.com (under second review at the moment) mysql-test/r/mysqlbinlog.result: changed in 5.0 mysql-test/t/mysqlbinlog.test: backported from 5.0. The last part of the test to mimic bug#16217 sql/log_event.cc: Inserting exclaiming comment command for mysql client made differently than in 5.0. Parsing still is cheap enough not to think to modify server code instead.
This commit is contained in:
@@ -190,7 +190,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*);
|
||||
|
||||
#ifdef USE_POPEN
|
||||
@@ -263,6 +263,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_name", 'C', com_charset, 1,
|
||||
"Switch to another charset. Might be needed for processing binlog." },
|
||||
/* Get bash-like expansion for some commands */
|
||||
{ "create table", 0, 0, 0, ""},
|
||||
{ "create database", 0, 0, 0, ""},
|
||||
@@ -1850,6 +1852,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
|
||||
|
Reference in New Issue
Block a user