He Zhenxing,
the patch is approved.
<Zhenxing.He@stripped> writes:
> Andrei Elkin wrote:
>> He Zhenxing, hello.
>>
>> It's great you found yet another flaw, not reported
>> in the bug!
>>
>> The fix is okay, although I need to ask you to make a test case which
>> would not just prove your fixes (straighforward enough to believe 'me)
>> but rather secure marking thd->tmp_table_used will never be lost.
>>
>> I suggest to file binlog_temp_table.test and list there yours two and
>> the rest basic cases where a query event goes in binlog with the temp
>> flag on.
>>
>
> I have added a test case named binlog_tmp_table.test in my latest
> commit. Please review that commit.
>
>> Hope you'll appreciate this idea,
>>
>
> Of course.
>
>> cheers,
>>
>> Andrei
Thanks for adding the test!
As a comment on it, I thought the test would lists all kinds of query
on a temporary table and to print the content of the binlog in the
end.
The content would prove each temp table query is accociated with a
pseudo_thread_id.
=== added file 'mysql-test/t/binlog_tmp_table.test'
--- a/mysql-test/t/binlog_tmp_table.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/binlog_tmp_table.test 2009-01-09 08:47:53 +0000
@@ -0,0 +1,58 @@
+# ==== Purpose ====
+#
+# Test if statements used temporary tables are binlogged correctly
+#
+# ==== Method ====
+#
+# Use two connections, use temporary tables on both of them, and by
+# switching connections between statements, the test can check if the
+# statements are logged with the correct thread id.
This way is fine too, although it does not verify that tmp_table_used
flag in all cases (which is not a reqirement for the bug still would
be good to implement while we are within this problem context, imo).
cheers,
Andrei