Below is the list of changes that have just been committed into a local
4.1 repository of bar. When bar 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
1.2401 05/09/05 20:05:32 bar@stripped +2 -0
Merge abarkov@stripped:/home/bk/mysql-4.1
into mysql.com:/usr/home/bar/mysql-4.1.b9948
sql/sql_parse.cc
1.464 05/09/05 20:05:25 bar@stripped +0 -0
Auto merged
sql/mysqld.cc
1.593 05/09/05 20:05:25 bar@stripped +0 -0
Auto merged
# 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: bar
# Host: bar.intranet.mysql.r18.ru
# Root: /usr/home/bar/mysql-4.1.b9948/RESYNC
--- 1.592/sql/mysqld.cc 2005-09-05 19:58:42 +05:00
+++ 1.593/sql/mysqld.cc 2005-09-05 20:05:25 +05:00
@@ -3081,7 +3081,7 @@
*/
error_handler_hook = my_message_sql;
start_signal_handler(); // Creates pidfile
- if (acl_init((THD *)0, opt_noacl) ||
+ if (acl_init(opt_noacl) ||
my_tz_init((THD *)0, default_tz_name, opt_bootstrap))
{
abort_loop=1;
@@ -3098,7 +3098,7 @@
exit(1);
}
if (!opt_noacl)
- (void) grant_init((THD *)0);
+ (void) grant_init();
#ifdef HAVE_DLOPEN
if (!opt_noacl)
--- 1.463/sql/sql_parse.cc 2005-09-05 19:58:55 +05:00
+++ 1.464/sql/sql_parse.cc 2005-09-05 20:05:25 +05:00
@@ -120,6 +120,9 @@
#ifdef HAVE_REPLICATION
+/*
+ Returns true if all tables should be ignored
+*/
inline bool all_tables_not_ok(THD *thd, TABLE_LIST *tables)
{
return (table_rules_on && tables && !tables_ok(thd,tables) &&
@@ -1917,6 +1920,23 @@
return 0;
}
+static void reset_one_shot_variables(THD *thd)
+{
+ thd->variables.character_set_client=
+ global_system_variables.character_set_client;
+ thd->variables.collation_connection=
+ global_system_variables.collation_connection;
+ thd->variables.collation_database=
+ global_system_variables.collation_database;
+ thd->variables.collation_server=
+ global_system_variables.collation_server;
+ thd->update_charset();
+ thd->variables.time_zone=
+ global_system_variables.time_zone;
+ thd->one_shot_set= 0;
+}
+
+
/****************************************************************************
** mysql_execute_command
** Execute command saved in thd and current_lex->sql_command
@@ -1977,16 +1997,22 @@
/*
Skip if we are in the slave thread, some table rules have been
given and the table list says the query should not be replicated.
- Exception is DROP TEMPORARY TABLE IF EXISTS: we always execute it
- (otherwise we have stale files on slave caused by exclusion of one tmp
- table).
+
+ Exceptions are:
+ - SET: we always execute it (Not that many SET commands exists in
+ the binary log anyway -- only 4.1 masters write SET statements,
+ in 5.0 there are no SET statements in the binary log)
+ - DROP TEMPORARY TABLE IF EXISTS: we always execute it (otherwise we
+ have stale files on slave caused by exclusion of one tmp table).
*/
- if (!(lex->sql_command == SQLCOM_DROP_TABLE &&
+ if (!(lex->sql_command == SQLCOM_SET_OPTION) &&
+ !(lex->sql_command == SQLCOM_DROP_TABLE &&
lex->drop_temporary && lex->drop_if_exists) &&
all_tables_not_ok(thd,tables))
{
/* we warn the slave SQL thread */
my_error(ER_SLAVE_IGNORED_TABLE, MYF(0));
+ reset_one_shot_variables(thd);
DBUG_VOID_RETURN;
}
#ifndef TO_BE_DELETED
@@ -3311,6 +3337,7 @@
!db_ok_with_wild_table(lex->name)))
{
my_error(ER_SLAVE_IGNORED_TABLE, MYF(0));
+ reset_one_shot_variables(thd);
break;
}
#endif
@@ -3346,6 +3373,7 @@
!db_ok_with_wild_table(lex->name)))
{
my_error(ER_SLAVE_IGNORED_TABLE, MYF(0));
+ reset_one_shot_variables(thd);
break;
}
#endif
@@ -3386,6 +3414,7 @@
!db_ok_with_wild_table(db)))
{
my_error(ER_SLAVE_IGNORED_TABLE, MYF(0));
+ reset_one_shot_variables(thd);
break;
}
#endif
@@ -3720,30 +3749,19 @@
break;
}
thd->proc_info="query end"; // QQ
- if (thd->one_shot_set)
- {
- /*
- If this is a SET, do nothing. This is to allow mysqlbinlog to print
- many SET commands (in this case we want the charset temp setting to
- live until the real query). This is also needed so that SET
- CHARACTER_SET_CLIENT... does not cancel itself immediately.
- */
- if (lex->sql_command != SQLCOM_SET_OPTION)
- {
- thd->variables.character_set_client=
- global_system_variables.character_set_client;
- thd->variables.collation_connection=
- global_system_variables.collation_connection;
- thd->variables.collation_database=
- global_system_variables.collation_database;
- thd->variables.collation_server=
- global_system_variables.collation_server;
- thd->update_charset();
- thd->variables.time_zone=
- global_system_variables.time_zone;
- thd->one_shot_set= 0;
- }
- }
+
+ /*
+ Reset system variables temporarily modified by SET ONE SHOT.
+
+ Exception: If this is a SET, do nothing. This is to allow
+ mysqlbinlog to print many SET commands (in this case we want the
+ charset temp setting to live until the real query). This is also
+ needed so that SET CHARACTER_SET_CLIENT... does not cancel itself
+ immediately.
+ */
+ if (thd->one_shot_set && lex->sql_command != SQLCOM_SET_OPTION)
+ reset_one_shot_variables(thd);
+
if (res < 0)
send_error(thd,thd->killed ? ER_SERVER_SHUTDOWN : 0);
@@ -4990,10 +5008,27 @@
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (options & REFRESH_GRANT)
{
- acl_reload(thd);
- grant_reload(thd);
- if (mqh_used)
- reset_mqh(thd,(LEX_USER *) NULL,TRUE);
+ THD *tmp_thd= 0;
+ /*
+ If reload_acl_and_cache() is called from SIGHUP handler we have to
+ allocate temporary THD for execution of acl_reload()/grant_reload().
+ */
+ if (!thd && (thd= (tmp_thd= new THD)))
+ thd->store_globals();
+ if (thd)
+ {
+ (void)acl_reload(thd);
+ (void)grant_reload(thd);
+ if (mqh_used)
+ reset_mqh(thd, (LEX_USER *) NULL, TRUE);
+ }
+ if (tmp_thd)
+ {
+ delete tmp_thd;
+ /* Remember that we don't have a THD */
+ my_pthread_setspecific_ptr(THR_THD, 0);
+ thd= 0;
+ }
}
#endif
if (options & REFRESH_LOG)
| Thread |
|---|
| • bk commit into 4.1 tree (bar:1.2401) | bar | 5 Sep |