Andrei Elkin wrote:
> He Zhenxing,
>
> the patch is approved.
>
Thank you!
> <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.
I agree to check all update querys that using temporary table would make
the test complete, but I think the idea to print the content of the
binlog is not good, because that would make the test dependent on the
format of the binlog dump format, which might change from time to time.
> 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).
>
the tmp_table_used flag is an internal member used by the code, it
cannot be verified by the test. I think the important thing is that the
thread_id is correctly used for each query that uses temporary table. I
think there are only two ways to verify this, one is the method that I
used for the test, the other is use mysqlbinlog to dump the binlog and
check if the thread_id is printed correctly, but since the second method
would make the test dependent on binlog dump format, I choose the first
one.
>
> cheers,
>
> Andrei
>
>