Approved.
I think Øystein's suggestion for test cases is reasonable.
Otherwise, I have one comment to the commit header, see below.
Thanks,
Roy
On 13.10.10 13.38, Jorgen Loland wrote:
> #At file:///export/home/jl208045/mysql/mysql-next-mr-opt-backporting-52329/ based on
> revid:tor.didriksen@stripped
>
> 3262 Jorgen Loland 2010-10-13
> Bug#52329: Wrong result: subquery materialization, IN, non-null
> field followed by nullable
>
> Consider a query
>
> SELECT * FROM t1
> WHERE (a1, a2) IN (
> SELECT b1, b2 FROM t2 ...)
>
> When solved using materialized subselect, we check if a record
> from t1 is part of the result set by constructing a key from the
> a1 and a2 values and perform a lookup based on that key. If a1
> and a2 are CHAR(3) with values foo and bar, the KEY is "foobar".
> If a2 is NULLable, the null-bit should be the first bit for this
> field's part of the KEY ("foo<nullbit_a2>bar").
You probably mean null-byte, and not null-bit?
>
> Before, the null-bit pointer for each key field wrongly pointed
> to the first bit of the KEY instead of the first bit of the key
> part. Thus, when setting the null bit for a2 above, the first bit
> of a1 was wrongly updated: "0oo bar" ('f' in foo replaced
> with null-bit of a2, and the null-bit of a2 not set)
>
> This patch sets the null-pointer for each key part to the first
> bit of that field's part of KEY, not the first bit of KEY.
>
> The bug was masked if the first field was NOT NULL. The bug also
> applied to semi-join materialization since the code has been
> copied (also fixed by this patch).
>
>
>
>