diff options
author | monty@mysql.com <> | 2004-12-06 11:38:56 +0200 |
---|---|---|
committer | monty@mysql.com <> | 2004-12-06 11:38:56 +0200 |
commit | 0de4777187a869b4a070ba1e0da28a2ffe1abf05 (patch) | |
tree | a7bb331b7dac7ac2b3cda915e99bb8c1333f4fec /sql/log_event.cc | |
parent | 86508ad9690c61e806acf308b57c6431b1a2dd99 (diff) | |
parent | dededf09fa8cb1096549e74f543c84b81e413066 (diff) | |
download | mariadb-git-0de4777187a869b4a070ba1e0da28a2ffe1abf05.tar.gz |
Merge with 4.1
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r-- | sql/log_event.cc | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index 77769f0e7e8..760436592b9 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -921,7 +921,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); @@ -1077,9 +1078,12 @@ bool Query_log_event::write(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), catalog(thd_arg->catalog), db(thd_arg->db), q_len((uint32) query_length), error_code((thd_arg->killed != THD::NOT_KILLED) ? @@ -1259,14 +1263,14 @@ void Query_log_event::print(FILE* file, bool short_form, (ulong) thread_id, (ulong) exec_time, error_code); } - if (db) + if (!(flags & LOG_EVENT_SUPPRESS_USE_F) && db) { - if ((different_db = memcmp(last_event_info->db, db, db_len + 1))) + if (different_db= memcmp(last_event_info->db, db, db_len + 1)) memcpy(last_event_info->db, db, db_len + 1); + if (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'; |