Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.0-rpl

into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.0-merge
parents bd461b01 11ccfd80
......@@ -2117,6 +2117,17 @@ com_go(String *buffer,char *line __attribute__((unused)))
if (!mysql_num_rows(result) && ! quick && !info_flag)
{
strmov(buff, "Empty set");
if (opt_xml)
{
/*
We must print XML header and footer
to produce a well-formed XML even if
the result set is empty (Bug#27608).
*/
init_pager();
print_table_data_xml(result);
end_pager();
}
}
else
{
......
set autocommit=1;
reset master;
create table bug16206 (a int);
insert into bug16206 values(1);
start transaction;
insert into bug16206 values(2);
commit;
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4
f n Query 1 n use `test`; create table bug16206 (a int)
f n Query 1 n use `test`; insert into bug16206 values(1)
f n Query 1 n use `test`; insert into bug16206 values(2)
drop table bug16206;
reset master;
create table bug16206 (a int) engine= bdb;
insert into bug16206 values(0);
insert into bug16206 values(1);
start transaction;
insert into bug16206 values(2);
commit;
insert into bug16206 values(3);
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4
f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb
f n Query 1 n use `test`; insert into bug16206 values(0)
f n Query 1 n use `test`; insert into bug16206 values(1)
f n Query 1 n use `test`; BEGIN
f n Query 1 n use `test`; insert into bug16206 values(2)
f n Query 1 n use `test`; COMMIT
f n Query 1 n use `test`; insert into bug16206 values(3)
drop table bug16206;
set autocommit=0;
End of 5.0 tests
......@@ -71,4 +71,18 @@ insert into t1 values (1, 2, 'a&b a<b a>b');
<field name="NULL" xsi:nil="true" />
</row>
</resultset>
<?xml version="1.0"?>
<resultset statement="select 1 limit 0
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></resultset>
--------------
select 1 limit 0
--------------
<?xml version="1.0"?>
<resultset statement="select 1 limit 0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></resultset>
Empty set
Bye
drop table t1;
......@@ -637,6 +637,37 @@ set lc_time_names=0;
select @@lc_time_names;
@@lc_time_names
en_US
select @@global.lc_time_names, @@lc_time_names;
@@global.lc_time_names @@lc_time_names
en_US en_US
set @@global.lc_time_names=fr_FR;
select @@global.lc_time_names, @@lc_time_names;
@@global.lc_time_names @@lc_time_names
fr_FR en_US
New connection
select @@global.lc_time_names, @@lc_time_names;
@@global.lc_time_names @@lc_time_names
fr_FR fr_FR
set @@lc_time_names=ru_RU;
select @@global.lc_time_names, @@lc_time_names;
@@global.lc_time_names @@lc_time_names
fr_FR ru_RU
Returnung to default connection
select @@global.lc_time_names, @@lc_time_names;
@@global.lc_time_names @@lc_time_names
fr_FR en_US
set lc_time_names=default;
select @@global.lc_time_names, @@lc_time_names;
@@global.lc_time_names @@lc_time_names
fr_FR fr_FR
set @@global.lc_time_names=default;
select @@global.lc_time_names, @@lc_time_names;
@@global.lc_time_names @@lc_time_names
en_US fr_FR
set @@lc_time_names=default;
select @@global.lc_time_names, @@lc_time_names;
@@global.lc_time_names @@lc_time_names
en_US en_US
set @test = @@query_prealloc_size;
set @@query_prealloc_size = @test;
select @@query_prealloc_size = @test;
......
-- source include/not_embedded.inc
-- source include/have_bdb.inc
#
# Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit mode
#
set autocommit=1;
let $VERSION=`select version()`;
reset master;
create table bug16206 (a int);
insert into bug16206 values(1);
start transaction;
insert into bug16206 values(2);
commit;
--replace_result $VERSION VERSION
--replace_column 1 f 2 n 5 n
show binlog events;
drop table bug16206;
reset master;
create table bug16206 (a int) engine= bdb;
insert into bug16206 values(0);
insert into bug16206 values(1);
start transaction;
insert into bug16206 values(2);
commit;
insert into bug16206 values(3);
--replace_result $VERSION VERSION
--replace_column 1 f 2 n 5 n
show binlog events;
drop table bug16206;
set autocommit=0;
--echo End of 5.0 tests
......@@ -17,5 +17,7 @@ insert into t1 values (1, 2, 'a&b a<b a>b');
--exec $MYSQL --xml test -e "select 1 > 2 from dual"
--exec $MYSQL --xml test -e "select 1 & 3 from dual"
--exec $MYSQL --xml test -e "select null from dual"
--exec $MYSQL --xml test -e "select 1 limit 0"
--exec $MYSQL --xml test -vv -e "select 1 limit 0"
drop table t1;
......@@ -504,6 +504,30 @@ select @@lc_time_names;
set lc_time_names=0;
select @@lc_time_names;
#
# Bug #22648 LC_TIME_NAMES: Setting GLOBAL has no effect
#
select @@global.lc_time_names, @@lc_time_names;
set @@global.lc_time_names=fr_FR;
select @@global.lc_time_names, @@lc_time_names;
--echo New connection
connect (con1,localhost,root,,);
connection con1;
select @@global.lc_time_names, @@lc_time_names;
set @@lc_time_names=ru_RU;
select @@global.lc_time_names, @@lc_time_names;
disconnect con1;
connection default;
--echo Returnung to default connection
select @@global.lc_time_names, @@lc_time_names;
set lc_time_names=default;
select @@global.lc_time_names, @@lc_time_names;
set @@global.lc_time_names=default;
select @@global.lc_time_names, @@lc_time_names;
set @@lc_time_names=default;
select @@global.lc_time_names, @@lc_time_names;
#
# Bug #13334: query_prealloc_size default less than minimum
#
......
......@@ -149,6 +149,7 @@ typedef struct my_locale_st
extern MY_LOCALE my_locale_en_US;
extern MY_LOCALE *my_locales[];
extern MY_LOCALE *my_default_lc_time_names;
MY_LOCALE *my_locale_by_name(const char *name);
MY_LOCALE *my_locale_by_number(uint number);
......
......@@ -315,6 +315,7 @@ static char *mysqld_user, *mysqld_chroot, *log_error_file_ptr;
static char *opt_init_slave, *language_ptr, *opt_init_connect;
static char *default_character_set_name;
static char *character_set_filesystem_name;
static char *lc_time_names_name;
static char *my_bind_addr_str;
static char *default_collation_name;
static char compiled_default_collation_name[]= MYSQL_DEFAULT_COLLATION_NAME;
......@@ -495,6 +496,8 @@ CHARSET_INFO *system_charset_info, *files_charset_info ;
CHARSET_INFO *national_charset_info, *table_alias_charset;
CHARSET_INFO *character_set_filesystem;
MY_LOCALE *my_default_lc_time_names;
SHOW_COMP_OPTION have_isam;
SHOW_COMP_OPTION have_raid, have_ssl, have_symlink, have_query_cache;
SHOW_COMP_OPTION have_geometry, have_rtree_keys, have_dlopen;
......@@ -2826,6 +2829,14 @@ static int init_common_variables(const char *conf_file_name, int argc,
return 1;
global_system_variables.character_set_filesystem= character_set_filesystem;
if (!(my_default_lc_time_names=
my_locale_by_name(lc_time_names_name)))
{
sql_print_error("Unknown locale: '%s'", MYF(0), lc_time_names_name);
return 1;
}
global_system_variables.lc_time_names= my_default_lc_time_names;
sys_init_connect.value_length= 0;
if ((sys_init_connect.value= opt_init_connect))
sys_init_connect.value_length= strlen(opt_init_connect);
......@@ -4749,6 +4760,7 @@ enum options_mysqld
OPT_DEFAULT_COLLATION,
OPT_CHARACTER_SET_CLIENT_HANDSHAKE,
OPT_CHARACTER_SET_FILESYSTEM,
OPT_LC_TIME_NAMES,
OPT_INIT_CONNECT,
OPT_INIT_SLAVE,
OPT_SECURE_AUTH,
......@@ -5078,6 +5090,11 @@ Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite,
"Client error messages in given language. May be given as a full path.",
(gptr*) &language_ptr, (gptr*) &language_ptr, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"lc-time-names", OPT_LC_TIME_NAMES,
"Set the language used for the month names and the days of the week.",
(gptr*) &lc_time_names_name,
(gptr*) &lc_time_names_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{"local-infile", OPT_LOCAL_INFILE,
"Enable/disable LOAD DATA LOCAL INFILE (takes values 1|0).",
(gptr*) &opt_local_infile,
......@@ -6552,7 +6569,7 @@ static void mysql_init_variables(void)
default_collation_name= compiled_default_collation_name;
sys_charset_system.value= (char*) system_charset_info->csname;
character_set_filesystem_name= (char*) "binary";
lc_time_names_name= (char*) "en_US";
/* Set default values for some option variables */
global_system_variables.table_type= DB_TYPE_MYISAM;
......
......@@ -2825,6 +2825,9 @@ bool sys_var_thd_lc_time_names::check(THD *thd, set_var *var)
bool sys_var_thd_lc_time_names::update(THD *thd, set_var *var)
{
if (var->type == OPT_GLOBAL)
global_system_variables.lc_time_names= var->save_result.locale_value;
else
thd->variables.lc_time_names= var->save_result.locale_value;
return 0;
}
......@@ -2833,13 +2836,18 @@ bool sys_var_thd_lc_time_names::update(THD *thd, set_var *var)
byte *sys_var_thd_lc_time_names::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
return (byte *)(thd->variables.lc_time_names->name);
return type == OPT_GLOBAL ?
(byte *) global_system_variables.lc_time_names->name :
(byte *) thd->variables.lc_time_names->name;
}
void sys_var_thd_lc_time_names::set_default(THD *thd, enum_var_type type)
{
thd->variables.lc_time_names = &my_locale_en_US;
if (type == OPT_GLOBAL)
global_system_variables.lc_time_names= my_default_lc_time_names;
else
thd->variables.lc_time_names= global_system_variables.lc_time_names;
}
/*
......
......@@ -343,7 +343,6 @@ void THD::init(void)
total_warn_count= 0;
update_charset();
bzero((char *) &status_var, sizeof(status_var));
variables.lc_time_names = &my_locale_en_US;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment