Commit 76f9049e authored by unknown's avatar unknown

Merge mysql.com:/home/bkroot/mysql-5.0 into mysql.com:/home/bk/mysql-5.0

parents 07b8ace7 a26e966d
...@@ -493,7 +493,8 @@ static void write_header(FILE *sql_file, char *db_name) ...@@ -493,7 +493,8 @@ static void write_header(FILE *sql_file, char *db_name)
"); ");
} }
fprintf(sql_file, fprintf(sql_file,
"/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='%s%s%s' */;\n", "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='%s%s%s' */;\n"
"/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\n",
path?"":"NO_AUTO_VALUE_ON_ZERO",compatible_mode_normal_str[0]==0?"":",", path?"":"NO_AUTO_VALUE_ON_ZERO",compatible_mode_normal_str[0]==0?"":",",
compatible_mode_normal_str); compatible_mode_normal_str);
check_io(sql_file); check_io(sql_file);
...@@ -522,6 +523,8 @@ static void write_footer(FILE *sql_file) ...@@ -522,6 +523,8 @@ static void write_footer(FILE *sql_file)
"/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n" "/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n"
"/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n" "/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n"
"/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n"); "/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n");
fprintf(sql_file,
"/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;\n");
fputs("\n", sql_file); fputs("\n", sql_file);
check_io(sql_file); check_io(sql_file);
} }
......
This diff is collapsed.
...@@ -246,3 +246,10 @@ SET TIMESTAMP=1000000000; ...@@ -246,3 +246,10 @@ SET TIMESTAMP=1000000000;
SET @@session.character_set_client=7,@@session.collation_connection=51,@@session.collation_server=30; SET @@session.character_set_client=7,@@session.collation_connection=51,@@session.collation_server=30;
INSERT INTO t1 (c1, c2) VALUES (', ',', '); INSERT INTO t1 (c1, c2) VALUES (', ',', ');
drop table t1; drop table t1;
create table `t1` (
`pk` varchar(10) not null default '',
primary key (`pk`)
) engine=myisam default charset=latin1;
set @p=_latin1 'test';
update t1 set pk='test' where pk=@p;
drop table t1;
...@@ -63,10 +63,10 @@ connection master; ...@@ -63,10 +63,10 @@ connection master;
set character_set_client=latin1, collation_connection=latin1_german1_ci; set character_set_client=latin1, collation_connection=latin1_german1_ci;
truncate table t1; truncate table t1;
insert into t1 (b) values(@@collation_connection); insert into t1 (b) values(@@collation_connection);
insert into t1 (b) values(LEAST("Mller","Muffler")); insert into t1 (b) values(LEAST("Müller","Muffler"));
set collation_connection=latin1_german2_ci; set collation_connection=latin1_german2_ci;
insert into t1 (b) values(@@collation_connection); insert into t1 (b) values(@@collation_connection);
insert into t1 (b) values(LEAST("Mller","Muffler")); insert into t1 (b) values(LEAST("Müller","Muffler"));
--disable_query_log --disable_query_log
select "--- --master--" as ""; select "--- --master--" as "";
--enable_query_log --enable_query_log
...@@ -90,7 +90,7 @@ select * from mysqltest2.t1 order by a; ...@@ -90,7 +90,7 @@ select * from mysqltest2.t1 order by a;
# which provokes error messages (like 'Illegal mix of collation') when # which provokes error messages (like 'Illegal mix of collation') when
# we replay the master's INSERT/etc statements. # we replay the master's INSERT/etc statements.
connection master; connection master;
set @a= _cp850 'Mller' collate cp850_general_ci; set @a= _cp850 'Müller' collate cp850_general_ci;
truncate table t1; truncate table t1;
insert into t1 (b) values(collation(@a)); insert into t1 (b) values(collation(@a));
--disable_query_log --disable_query_log
...@@ -145,7 +145,7 @@ CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255)); ...@@ -145,7 +145,7 @@ CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255));
SET CHARACTER_SET_CLIENT=koi8r, SET CHARACTER_SET_CLIENT=koi8r,
CHARACTER_SET_CONNECTION=cp1251, CHARACTER_SET_CONNECTION=cp1251,
CHARACTER_SET_RESULTS=koi8r; CHARACTER_SET_RESULTS=koi8r;
INSERT INTO t1 (c1, c2) VALUES (', ',', '); INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ');
select hex(c1), hex(c2) from t1; select hex(c1), hex(c2) from t1;
sync_slave_with_master; sync_slave_with_master;
select hex(c1), hex(c2) from t1; select hex(c1), hex(c2) from t1;
...@@ -157,3 +157,15 @@ connection master; ...@@ -157,3 +157,15 @@ connection master;
drop table t1; drop table t1;
sync_slave_with_master; sync_slave_with_master;
#
# BUG#6676: Derivation of variables must be correct on slave
#
connection master;
create table `t1` (
`pk` varchar(10) not null default '',
primary key (`pk`)
) engine=myisam default charset=latin1;
set @p=_latin1 'test';
update t1 set pk='test' where pk=@p;
drop table t1;
sync_slave_with_master;
...@@ -1450,7 +1450,6 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli) ...@@ -1450,7 +1450,6 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli)
thd->query_id = next_query_id(); thd->query_id = next_query_id();
VOID(pthread_mutex_unlock(&LOCK_thread_count)); VOID(pthread_mutex_unlock(&LOCK_thread_count));
thd->variables.pseudo_thread_id= thread_id; // for temp tables thd->variables.pseudo_thread_id= thread_id; // for temp tables
mysql_log.write(thd,COM_QUERY,"%s",thd->query);
DBUG_PRINT("query",("%s",thd->query)); DBUG_PRINT("query",("%s",thd->query));
if (ignored_error_code((expected_error= error_code)) || if (ignored_error_code((expected_error= error_code)) ||
...@@ -1535,9 +1534,13 @@ START SLAVE; . Query: '%s'", expected_error, thd->query); ...@@ -1535,9 +1534,13 @@ START SLAVE; . Query: '%s'", expected_error, thd->query);
goto end; goto end;
} }
/* If the query was not ignored, it is printed to the general log */
if (thd->net.last_errno != ER_SLAVE_IGNORED_TABLE)
mysql_log.write(thd,COM_QUERY,"%s",thd->query);
compare_errors: compare_errors:
/* /*
If we expected a non-zero error code, and we don't get the same error If we expected a non-zero error code, and we don't get the same error
code, and none of them should be ignored. code, and none of them should be ignored.
*/ */
...@@ -3470,7 +3473,12 @@ int User_var_log_event::exec_event(struct st_relay_log_info* rli) ...@@ -3470,7 +3473,12 @@ int User_var_log_event::exec_event(struct st_relay_log_info* rli)
0 can be passed as last argument (reference on item) 0 can be passed as last argument (reference on item)
*/ */
e.fix_fields(thd, 0, 0); e.fix_fields(thd, 0, 0);
e.update_hash(val, val_len, type, charset, DERIVATION_NONE); /*
A variable can just be considered as a table with
a single record and with a single column. Thus, like
a column value, it could always have IMPLICIT derivation.
*/
e.update_hash(val, val_len, type, charset, DERIVATION_IMPLICIT);
free_root(thd->mem_root,0); free_root(thd->mem_root,0);
rli->inc_event_relay_log_pos(); rli->inc_event_relay_log_pos();
......
...@@ -254,6 +254,10 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset; ...@@ -254,6 +254,10 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset;
/* The rest of the file is included in the server only */ /* The rest of the file is included in the server only */
#ifndef MYSQL_CLIENT #ifndef MYSQL_CLIENT
/* If set to 0, then the thread will ignore all warnings with level notes.
Set by executing SET SQL_NOTES=1 */
#define OPTION_SQL_NOTES (1L << 31)
/* Bits for different SQL modes modes (including ANSI mode) */ /* Bits for different SQL modes modes (including ANSI mode) */
#define MODE_REAL_AS_FLOAT 1 #define MODE_REAL_AS_FLOAT 1
#define MODE_PIPES_AS_CONCAT 2 #define MODE_PIPES_AS_CONCAT 2
......
...@@ -5782,7 +5782,8 @@ static void mysql_init_variables(void) ...@@ -5782,7 +5782,8 @@ static void mysql_init_variables(void)
language_ptr= language; language_ptr= language;
mysql_data_home= mysql_real_data_home; mysql_data_home= mysql_real_data_home;
thd_startup_options= (OPTION_UPDATE_LOG | OPTION_AUTO_IS_NULL | thd_startup_options= (OPTION_UPDATE_LOG | OPTION_AUTO_IS_NULL |
OPTION_BIN_LOG | OPTION_QUOTE_SHOW_CREATE); OPTION_BIN_LOG | OPTION_QUOTE_SHOW_CREATE |
OPTION_SQL_NOTES);
protocol_version= PROTOCOL_VERSION; protocol_version= PROTOCOL_VERSION;
what_to_log= ~ (1L << (uint) COM_TIME); what_to_log= ~ (1L << (uint) COM_TIME);
refresh_version= flush_version= 1L; /* Increments on each reload */ refresh_version= flush_version= 1L; /* Increments on each reload */
......
...@@ -459,6 +459,9 @@ static sys_var_thd_bit sys_log_binlog("sql_log_bin", ...@@ -459,6 +459,9 @@ static sys_var_thd_bit sys_log_binlog("sql_log_bin",
static sys_var_thd_bit sys_sql_warnings("sql_warnings", 0, static sys_var_thd_bit sys_sql_warnings("sql_warnings", 0,
set_option_bit, set_option_bit,
OPTION_WARNINGS); OPTION_WARNINGS);
static sys_var_thd_bit sys_sql_notes("sql_notes", 0,
set_option_bit,
OPTION_SQL_NOTES);
static sys_var_thd_bit sys_auto_is_null("sql_auto_is_null", 0, static sys_var_thd_bit sys_auto_is_null("sql_auto_is_null", 0,
set_option_bit, set_option_bit,
OPTION_AUTO_IS_NULL); OPTION_AUTO_IS_NULL);
...@@ -653,6 +656,7 @@ sys_var *sys_variables[]= ...@@ -653,6 +656,7 @@ sys_var *sys_variables[]=
&sys_sql_max_join_size, &sys_sql_max_join_size,
&sys_sql_mode, &sys_sql_mode,
&sys_sql_warnings, &sys_sql_warnings,
&sys_sql_notes,
&sys_storage_engine, &sys_storage_engine,
#ifdef HAVE_REPLICATION #ifdef HAVE_REPLICATION
&sys_sync_binlog_period, &sys_sync_binlog_period,
...@@ -927,6 +931,8 @@ struct show_var_st init_vars[]= { ...@@ -927,6 +931,8 @@ struct show_var_st init_vars[]= {
{sys_sort_buffer.name, (char*) &sys_sort_buffer, SHOW_SYS}, {sys_sort_buffer.name, (char*) &sys_sort_buffer, SHOW_SYS},
{sys_sql_mode.name, (char*) &sys_sql_mode, SHOW_SYS}, {sys_sql_mode.name, (char*) &sys_sql_mode, SHOW_SYS},
{sys_storage_engine.name, (char*) &sys_storage_engine, SHOW_SYS}, {sys_storage_engine.name, (char*) &sys_storage_engine, SHOW_SYS},
{"sql_notes", (char*) &sys_sql_notes, SHOW_BOOL},
{"sql_warnings", (char*) &sys_sql_warnings, SHOW_BOOL},
#ifdef HAVE_REPLICATION #ifdef HAVE_REPLICATION
{sys_sync_binlog_period.name,(char*) &sys_sync_binlog_period, SHOW_SYS}, {sys_sync_binlog_period.name,(char*) &sys_sync_binlog_period, SHOW_SYS},
{sys_sync_replication.name, (char*) &sys_sync_replication, SHOW_SYS}, {sys_sync_replication.name, (char*) &sys_sync_replication, SHOW_SYS},
......
...@@ -106,6 +106,9 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, ...@@ -106,6 +106,9 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
MYSQL_ERROR *err= 0; MYSQL_ERROR *err= 0;
DBUG_ENTER("push_warning"); DBUG_ENTER("push_warning");
if (level == MYSQL_ERROR::WARN_LEVEL_NOTE && !(thd->options & OPTION_SQL_NOTES))
return(0);
if (thd->query_id != thd->warn_id) if (thd->query_id != thd->warn_id)
mysql_reset_errors(thd); mysql_reset_errors(thd);
thd->got_warning= 1; thd->got_warning= 1;
......
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