diff options
author | unknown <jimw@mysql.com> | 2004-12-03 17:48:19 +0100 |
---|---|---|
committer | unknown <jimw@mysql.com> | 2004-12-03 17:48:19 +0100 |
commit | a1fb39e7ba46b72e4986b60c24298173cef07f8a (patch) | |
tree | c70e2fed45bb2ec769b74ade57d28b36aa7b5a31 /sql | |
parent | 8948b7450fa543ef14f29b6087fd70ccfa640972 (diff) | |
parent | 0284e541b31b885fdb0ec899ad5cf83c83fa5804 (diff) | |
download | mariadb-git-a1fb39e7ba46b72e4986b60c24298173cef07f8a.tar.gz |
Merge
sql/sql_insert.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_class.h:
SCCS merged
Diffstat (limited to 'sql')
-rw-r--r-- | sql/handler.cc | 4 | ||||
-rw-r--r-- | sql/item_func.cc | 2 | ||||
-rw-r--r-- | sql/log.cc | 14 | ||||
-rw-r--r-- | sql/log_event.cc | 30 | ||||
-rw-r--r-- | sql/log_event.h | 20 | ||||
-rw-r--r-- | sql/sql_acl.cc | 2 | ||||
-rw-r--r-- | sql/sql_base.cc | 4 | ||||
-rw-r--r-- | sql/sql_class.h | 3 | ||||
-rw-r--r-- | sql/sql_db.cc | 44 | ||||
-rw-r--r-- | sql/sql_delete.cc | 6 | ||||
-rw-r--r-- | sql/sql_insert.cc | 51 | ||||
-rw-r--r-- | sql/sql_parse.cc | 16 | ||||
-rw-r--r-- | sql/sql_rename.cc | 2 | ||||
-rw-r--r-- | sql/sql_table.cc | 17 | ||||
-rw-r--r-- | sql/sql_update.cc | 4 |
15 files changed, 138 insertions, 81 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index 7ddd7b80a34..530c5f137ec 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -723,7 +723,7 @@ int ha_rollback_to_savepoint(THD *thd, char *savepoint_name) if (unlikely((thd->options & OPTION_STATUS_NO_TRANS_UPDATE) && my_b_tell(&thd->transaction.trans_log))) { - Query_log_event qinfo(thd, thd->query, thd->query_length, TRUE); + Query_log_event qinfo(thd, thd->query, thd->query_length, TRUE, FALSE); if (mysql_bin_log.write(&qinfo)) error= 1; } @@ -761,7 +761,7 @@ int ha_savepoint(THD *thd, char *savepoint_name) innobase_savepoint(thd,savepoint_name, my_b_tell(&thd->transaction.trans_log)); #endif - Query_log_event qinfo(thd, thd->query, thd->query_length, TRUE); + Query_log_event qinfo(thd, thd->query, thd->query_length, TRUE, FALSE); if (mysql_bin_log.write(&qinfo)) error= 1; } diff --git a/sql/item_func.cc b/sql/item_func.cc index 5ed543efbc7..98b204d1809 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -2010,7 +2010,7 @@ void item_user_lock_release(User_level_lock *ull) tmp.copy(command, strlen(command), tmp.charset()); tmp.append(ull->key,ull->key_length); tmp.append("\")", 2); - Query_log_event qev(current_thd, tmp.ptr(), tmp.length(),1); + Query_log_event qev(current_thd, tmp.ptr(), tmp.length(),1, FALSE); qev.error_code=0; // this query is always safe to run on slave mysql_bin_log.write(&qev); } diff --git a/sql/log.cc b/sql/log.cc index 460910fcee8..6c3ba68165c 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1274,7 +1274,7 @@ bool MYSQL_LOG::write(Log_event* event_info) (local_db && !db_ok(local_db, binlog_do_db, binlog_ignore_db))) { VOID(pthread_mutex_unlock(&LOCK_log)); - DBUG_PRINT("error",("!db_ok")); + DBUG_PRINT("error",("!db_ok('%s')", local_db)); DBUG_RETURN(0); } #endif /* HAVE_REPLICATION */ @@ -1317,7 +1317,7 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u", (uint) thd->variables.collation_connection->number, (uint) thd->variables.collation_database->number, (uint) thd->variables.collation_server->number); - Query_log_event e(thd, buf, written, 0); + Query_log_event e(thd, buf, written, 0, FALSE); e.set_log_pos(this); if (e.write(file)) goto err; @@ -1333,7 +1333,7 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u", char *buf_end= strxmov(buf, "SET ONE_SHOT TIME_ZONE='", thd->variables.time_zone->get_name()->ptr(), "'", NullS); - Query_log_event e(thd, buf, buf_end - buf, 0); + Query_log_event e(thd, buf, buf_end - buf, 0, FALSE); e.set_log_pos(this); if (e.write(file)) goto err; @@ -1402,7 +1402,7 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u", if (thd->options & OPTION_NO_FOREIGN_KEY_CHECKS) { - Query_log_event e(thd, "SET FOREIGN_KEY_CHECKS=0", 24, 0); + Query_log_event e(thd, "SET FOREIGN_KEY_CHECKS=0", 24, 0, FALSE); e.set_log_pos(this); if (e.write(file)) goto err; @@ -1421,7 +1421,7 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u", { if (thd->options & OPTION_NO_FOREIGN_KEY_CHECKS) { - Query_log_event e(thd, "SET FOREIGN_KEY_CHECKS=1", 24, 0); + Query_log_event e(thd, "SET FOREIGN_KEY_CHECKS=1", 24, 0, FALSE); e.set_log_pos(this); if (e.write(file)) goto err; @@ -1597,7 +1597,7 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, bool commit_or_rollback) we will add the "COMMIT mark and write the buffer to the binlog. */ { - Query_log_event qinfo(thd, "BEGIN", 5, TRUE); + Query_log_event qinfo(thd, "BEGIN", 5, TRUE, FALSE); /* Imagine this is rollback due to net timeout, after all statements of the transaction succeeded. Then we want a zero-error code in BEGIN. @@ -1638,7 +1638,7 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, bool commit_or_rollback) Query_log_event qinfo(thd, commit_or_rollback ? "COMMIT" : "ROLLBACK", commit_or_rollback ? 6 : 8, - TRUE); + TRUE, FALSE); qinfo.error_code= 0; qinfo.set_log_pos(this); if (qinfo.write(&log_file) || flush_io_cache(&log_file) || diff --git a/sql/log_event.cc b/sql/log_event.cc index 2fdc89504d7..7a4d14d101a 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -780,7 +780,8 @@ void Query_log_event::pack_info(Protocol *protocol) if (!(buf= my_malloc(9 + db_len + q_len, MYF(MY_WME)))) return; pos= buf; - if (db && db_len) + if (!(flags & LOG_EVENT_SUPPRESS_USE_F) + && db && db_len) { pos= strmov(buf, "use `"); memcpy(pos, db, db_len); @@ -872,9 +873,12 @@ int Query_log_event::write_data(IO_CACHE* file) #ifndef MYSQL_CLIENT Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, - ulong query_length, bool using_trans) - :Log_event(thd_arg, !thd_arg->tmp_table_used ? - 0 : LOG_EVENT_THREAD_SPECIFIC_F, using_trans), + ulong query_length, bool using_trans, + bool suppress_use) + :Log_event(thd_arg, + ((thd_arg->tmp_table_used ? LOG_EVENT_THREAD_SPECIFIC_F : 0) + | (suppress_use ? LOG_EVENT_SUPPRESS_USE_F : 0)), + using_trans), data_buf(0), query(query_arg), db(thd_arg->db), q_len((uint32) query_length), error_code(thd_arg->killed ? @@ -949,14 +953,20 @@ void Query_log_event::print(FILE* file, bool short_form, char* last_db) bool different_db= 1; - if (db && last_db) + if (!(flags & LOG_EVENT_SUPPRESS_USE_F)) { - if (different_db= memcmp(last_db, db, db_len + 1)) - memcpy(last_db, db, db_len + 1); + if (db && last_db) + { + if (different_db= memcmp(last_db, db, db_len + 1)) + memcpy(last_db, db, db_len + 1); + } + + if (db && db[0] && different_db) + { + fprintf(file, "use %s;\n", db); + } } - - if (db && db[0] && different_db) - fprintf(file, "use %s;\n", db); + end=int10_to_str((long) when, strmov(buff,"SET TIMESTAMP="),10); *end++=';'; *end++='\n'; diff --git a/sql/log_event.h b/sql/log_event.h index 1606659e21e..8a2334e8574 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -264,6 +264,19 @@ struct sql_ex_info */ #define LOG_EVENT_THREAD_SPECIFIC_F 0x4 +/* + Suppress the generation of 'USE' statements before the actual + statement. This flag should be set for any events that does not need + the current database set to function correctly. Most notable cases + are 'CREATE DATABASE' and 'DROP DATABASE'. + + This flags should only be used in exceptional circumstances, since + it introduce a significant change in behaviour regarding the + replication logic together with the flags --binlog-do-db and + --replicated-do-db. + */ +#define LOG_EVENT_SUPPRESS_USE_F 0x8 + enum Log_event_type { UNKNOWN_EVENT= 0, START_EVENT= 1, QUERY_EVENT= 2, STOP_EVENT= 3, @@ -331,8 +344,9 @@ public: /* Some 16 flags. Only one is really used now; look above for - LOG_EVENT_TIME_F, LOG_EVENT_FORCED_ROTATE_F, LOG_EVENT_THREAD_SPECIFIC_F - for notes. + LOG_EVENT_TIME_F, LOG_EVENT_FORCED_ROTATE_F, + LOG_EVENT_THREAD_SPECIFIC_F, and LOG_EVENT_SUPPRESS_USE_F for + notes. */ uint16 flags; @@ -465,7 +479,7 @@ public: #ifndef MYSQL_CLIENT Query_log_event(THD* thd_arg, const char* query_arg, ulong query_length, - bool using_trans); + bool using_trans, bool suppress_use); const char* get_db() { return db; } #ifdef HAVE_REPLICATION void pack_info(Protocol* protocol); diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index f1698dcc911..8cc4bf7ea43 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1230,7 +1230,7 @@ bool change_password(THD *thd, const char *host, const char *user, new_password)); thd->clear_error(); mysql_update_log.write(thd, buff, query_length); - Query_log_event qinfo(thd, buff, query_length, 0); + Query_log_event qinfo(thd, buff, query_length, 0, FALSE); mysql_bin_log.write(&qinfo); DBUG_RETURN(0); } diff --git a/sql/sql_base.cc b/sql/sql_base.cc index a5db02478ac..64e616e872f 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -524,7 +524,7 @@ void close_temporary_tables(THD *thd) { /* The -1 is to remove last ',' */ thd->clear_error(); - Query_log_event qinfo(thd, query, (ulong)(end-query)-1, 0); + Query_log_event qinfo(thd, query, (ulong)(end-query)-1, 0, FALSE); /* Imagine the thread had created a temp table, then was doing a SELECT, and the SELECT was killed. Then it's not clever to mark the statement above as @@ -1441,7 +1441,7 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db, { end = strxmov(strmov(query, "DELETE FROM `"), db,"`.`",name,"`", NullS); - Query_log_event qinfo(thd, query, (ulong)(end-query), 0); + Query_log_event qinfo(thd, query, (ulong)(end-query), 0, FALSE); mysql_bin_log.write(&qinfo); my_free(query, MYF(0)); } diff --git a/sql/sql_class.h b/sql/sql_class.h index eaddca7b7d8..ff39a27e82b 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1241,6 +1241,7 @@ class select_insert :public select_result_interceptor { ~select_insert(); int prepare(List<Item> &list, SELECT_LEX_UNIT *u); bool send_data(List<Item> &items); + virtual void store_values(List<Item> &values); void send_error(uint errcode,const char *err); bool send_eof(); /* not implemented: select_insert is never re-used in prepared statements */ @@ -1268,7 +1269,7 @@ public: create_info(create_info_par), lock(0) {} int prepare(List<Item> &list, SELECT_LEX_UNIT *u); - bool send_data(List<Item> &values); + void store_values(List<Item> &values); void send_error(uint errcode,const char *err); bool send_eof(); void abort(); diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 350a7432990..e3ca0328382 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -467,7 +467,29 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info, mysql_update_log.write(thd, query, query_length); 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 @@ int mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info) mysql_update_log.write(thd,thd->query, thd->query_length); 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); } @@ -625,7 +655,15 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) mysql_update_log.write(thd, query, query_length); 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); } diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 09893970803..29d86a99ff3 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -216,7 +216,7 @@ cleanup: if (error <= 0) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - log_delayed); + log_delayed, FALSE); if (mysql_bin_log.write(&qinfo) && transactional_table) error=1; } @@ -565,7 +565,7 @@ bool multi_delete::send_eof() if (error <= 0) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - log_delayed); + log_delayed, FALSE); if (mysql_bin_log.write(&qinfo) && !normal_tables) local_error=1; // Log write failed: roll back the SQL statement } @@ -674,7 +674,7 @@ end: { thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - thd->tmp_table); + thd->tmp_table, FALSE); mysql_bin_log.write(&qinfo); } send_ok(thd); // This should return record count diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index d63bb29affa..d53ad4a8102 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -368,7 +368,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, if (error <= 0) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - log_delayed); + log_delayed, FALSE); if (mysql_bin_log.write(&qinfo) && transactional_table) error=1; } @@ -1364,7 +1364,7 @@ bool delayed_insert::handle_inserts(void) mysql_update_log.write(&thd,row->query, row->query_length); if (row->log_query & DELAYED_LOG_BIN && using_bin_log) { - Query_log_event qinfo(&thd, row->query, row->query_length,0); + Query_log_event qinfo(&thd, row->query, row->query_length,0, FALSE); mysql_bin_log.write(&qinfo); } } @@ -1457,7 +1457,6 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u) restore_record(table,default_values); // Get empty record table->next_number_field=table->found_next_number_field; - thd->count_cuted_fields= CHECK_FIELD_WARN; // calc cuted fields thd->cuted_fields=0; if (info.handle_duplicates == DUP_IGNORE || info.handle_duplicates == DUP_REPLACE) @@ -1487,27 +1486,34 @@ select_insert::~select_insert() bool select_insert::send_data(List<Item> &values) { DBUG_ENTER("select_insert::send_data"); + bool error=0; if (unit->offset_limit_cnt) { // using limit offset,count unit->offset_limit_cnt--; DBUG_RETURN(0); } - if (fields->elements) - fill_record(*fields, values, 1); - else - fill_record(table->field, values, 1); - if (thd->net.report_error || write_record(table,&info)) - DBUG_RETURN(1); - if (table->next_number_field) // Clear for next record + thd->count_cuted_fields= CHECK_FIELD_WARN; // calc cuted fields + store_values(values); + error=thd->net.report_error || write_record(table,&info); + thd->count_cuted_fields= CHECK_FIELD_IGNORE; + if (!error && table->next_number_field) // Clear for next record { table->next_number_field->reset(); if (! last_insert_id && thd->insert_id_used) last_insert_id=thd->insert_id(); } - DBUG_RETURN(0); + DBUG_RETURN(error); } +void select_insert::store_values(List<Item> &values) +{ + if (fields->elements) + fill_record(*fields, values, 1); + else + fill_record(table->field, values, 1); +} + void select_insert::send_error(uint errcode,const char *err) { DBUG_ENTER("select_insert::send_error"); @@ -1539,7 +1545,7 @@ void select_insert::send_error(uint errcode,const char *err) if (mysql_bin_log.is_open()) { Query_log_event qinfo(thd, thd->query, thd->query_length, - table->file->has_transactions()); + table->file->has_transactions(), FALSE); mysql_bin_log.write(&qinfo); } if (!table->tmp_table) @@ -1581,7 +1587,7 @@ bool select_insert::send_eof() if (!error) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - table->file->has_transactions()); + table->file->has_transactions(), FALSE); mysql_bin_log.write(&qinfo); } if ((error2=ha_autocommit_or_rollback(thd,error)) && ! error) @@ -1637,7 +1643,6 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u) table->next_number_field=table->found_next_number_field; restore_record(table,default_values); // Get empty record - thd->count_cuted_fields= CHECK_FIELD_WARN; // count warnings thd->cuted_fields=0; if (info.handle_duplicates == DUP_IGNORE || info.handle_duplicates == DUP_REPLACE) @@ -1647,23 +1652,9 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u) } -bool select_create::send_data(List<Item> &values) +void select_create::store_values(List<Item> &values) { - if (unit->offset_limit_cnt) - { // using limit offset,count - unit->offset_limit_cnt--; - return 0; - } fill_record(field, values, 1); - if (thd->net.report_error ||write_record(table,&info)) - return 1; - if (table->next_number_field) // Clear for next record - { - table->next_number_field->reset(); - if (! last_insert_id && thd->insert_id_used) - last_insert_id=thd->insert_id(); - } - return 0; } @@ -1723,7 +1714,7 @@ void select_create::abort() enum db_type table_type=table->db_type; if (!table->tmp_table) { - ulong version= table->version; + ulong version= table->version; hash_delete(&open_cache,(byte*) table); if (!create_info->table_existed) quick_rm_table(table_type, db, name); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 990e52d05ce..7d1798e751e 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2614,7 +2614,7 @@ unsent_create_error: if (mysql_bin_log.is_open()) { thd->clear_error(); // No binlog error generated - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } } @@ -2643,7 +2643,7 @@ unsent_create_error: if (mysql_bin_log.is_open()) { thd->clear_error(); // No binlog error generated - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } } @@ -2666,7 +2666,7 @@ unsent_create_error: if (mysql_bin_log.is_open()) { thd->clear_error(); // No binlog error generated - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } } @@ -3262,7 +3262,7 @@ purposes internal to the MySQL server", MYF(0)); mysql_update_log.write(thd, thd->query, thd->query_length); 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, FALSE); mysql_bin_log.write(&qinfo); } send_ok(thd); @@ -3278,7 +3278,7 @@ purposes internal to the MySQL server", MYF(0)); mysql_update_log.write(thd, thd->query, thd->query_length); 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, FALSE); mysql_bin_log.write(&qinfo); } send_ok(thd); @@ -3345,7 +3345,7 @@ purposes internal to the MySQL server", MYF(0)); if (mysql_bin_log.is_open()) { thd->clear_error(); - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } } @@ -3366,7 +3366,7 @@ purposes internal to the MySQL server", MYF(0)); if (mysql_bin_log.is_open()) { thd->clear_error(); - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } if (mqh_used && lex->sql_command == SQLCOM_GRANT) @@ -3409,7 +3409,7 @@ purposes internal to the MySQL server", MYF(0)); mysql_update_log.write(thd, thd->query, thd->query_length); 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, FALSE); mysql_bin_log.write(&qinfo); } } diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc index afaf2ed0923..388034e0f1a 100644 --- a/sql/sql_rename.cc +++ b/sql/sql_rename.cc @@ -84,7 +84,7 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list) if (mysql_bin_log.is_open()) { thd->clear_error(); - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } send_ok(thd); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index abb840568c3..12193e8736b 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -276,7 +276,8 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, if (!error) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - tmp_table_deleted && !some_tables_deleted); + tmp_table_deleted && !some_tables_deleted, + FALSE); mysql_bin_log.write(&qinfo); } } @@ -1413,7 +1414,8 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, test(create_info->options & - HA_LEX_CREATE_TMP_TABLE)); + HA_LEX_CREATE_TMP_TABLE), + FALSE); mysql_bin_log.write(&qinfo); } } @@ -2338,7 +2340,8 @@ int mysql_create_like_table(THD* thd, TABLE_LIST* table, thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, test(create_info->options & - HA_LEX_CREATE_TMP_TABLE)); + HA_LEX_CREATE_TMP_TABLE), + FALSE); mysql_bin_log.write(&qinfo); } res= 0; @@ -2449,7 +2452,7 @@ mysql_discard_or_import_tablespace(THD *thd, mysql_update_log.write(thd, thd->query,thd->query_length); 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, FALSE); mysql_bin_log.write(&qinfo); } err: @@ -2836,7 +2839,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, if (mysql_bin_log.is_open()) { thd->clear_error(); - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } if (do_send_ok) @@ -3231,7 +3234,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, if (mysql_bin_log.is_open()) { thd->clear_error(); - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } goto end_temporary; @@ -3366,7 +3369,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, if (mysql_bin_log.is_open()) { thd->clear_error(); - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } VOID(pthread_cond_broadcast(&COND_refresh)); diff --git a/sql/sql_update.cc b/sql/sql_update.cc index d3597f274dc..21fcac34070 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -344,7 +344,7 @@ int mysql_update(THD *thd, if (error <= 0) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - log_delayed); + log_delayed, FALSE); if (mysql_bin_log.write(&qinfo) && transactional_table) error=1; // Rollback update } @@ -1221,7 +1221,7 @@ bool multi_update::send_eof() if (local_error <= 0) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - log_delayed); + log_delayed, FALSE); if (mysql_bin_log.write(&qinfo) && trans_safe) local_error= 1; // Rollback update } |