mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge with 4.1
This commit is contained in:
@ -468,7 +468,29 @@ bool mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info,
|
||||
}
|
||||
if (mysql_bin_log.is_open())
|
||||
{
|
||||
Query_log_event qinfo(thd, query, query_length, 0);
|
||||
Query_log_event qinfo(thd, query, query_length, 0,
|
||||
/* suppress_use */ TRUE);
|
||||
|
||||
/*
|
||||
Write should use the database being created as the "current
|
||||
database" and not the threads current database, which is the
|
||||
default. If we do not change the "current database" to the
|
||||
database being created, the CREATE statement will not be
|
||||
replicated when using --binlog-do-db to select databases to be
|
||||
replicated.
|
||||
|
||||
An example (--binlog-do-db=sisyfos):
|
||||
|
||||
CREATE DATABASE bob; # Not replicated
|
||||
USE bob; # 'bob' is the current database
|
||||
CREATE DATABASE sisyfos; # Not replicated since 'bob' is
|
||||
# current database.
|
||||
USE sisyfos; # Will give error on slave since
|
||||
# database does not exist.
|
||||
*/
|
||||
qinfo.db = db;
|
||||
qinfo.db_len = strlen(db);
|
||||
|
||||
mysql_bin_log.write(&qinfo);
|
||||
}
|
||||
send_ok(thd, result);
|
||||
@ -517,7 +539,15 @@ bool mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info)
|
||||
|
||||
if (mysql_bin_log.is_open())
|
||||
{
|
||||
Query_log_event qinfo(thd, thd->query, thd->query_length, 0);
|
||||
Query_log_event qinfo(thd, thd->query, thd->query_length, 0,
|
||||
/* suppress_use */ TRUE);
|
||||
|
||||
// Write should use the database being created as the "current
|
||||
// database" and not the threads current database, which is the
|
||||
// default.
|
||||
qinfo.db = db;
|
||||
qinfo.db_len = strlen(db);
|
||||
|
||||
thd->clear_error();
|
||||
mysql_bin_log.write(&qinfo);
|
||||
}
|
||||
@ -623,7 +653,15 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
|
||||
}
|
||||
if (mysql_bin_log.is_open())
|
||||
{
|
||||
Query_log_event qinfo(thd, query, query_length, 0);
|
||||
Query_log_event qinfo(thd, query, query_length, 0,
|
||||
/* suppress_use */ TRUE);
|
||||
|
||||
// Write should use the database being created as the "current
|
||||
// database" and not the threads current database, which is the
|
||||
// default.
|
||||
qinfo.db = db;
|
||||
qinfo.db_len = strlen(db);
|
||||
|
||||
thd->clear_error();
|
||||
mysql_bin_log.write(&qinfo);
|
||||
}
|
||||
|
Reference in New Issue
Block a user