summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
authormonty@mysql.com <>2004-12-06 11:38:56 +0200
committermonty@mysql.com <>2004-12-06 11:38:56 +0200
commit0de4777187a869b4a070ba1e0da28a2ffe1abf05 (patch)
treea7bb331b7dac7ac2b3cda915e99bb8c1333f4fec /sql/log_event.cc
parent86508ad9690c61e806acf308b57c6431b1a2dd99 (diff)
parentdededf09fa8cb1096549e74f543c84b81e413066 (diff)
downloadmariadb-git-0de4777187a869b4a070ba1e0da28a2ffe1abf05.tar.gz
Merge with 4.1
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc22
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';