Hi!
On Tue, May 15, 2007 at 03:53:19PM -0600, Sasha Pachev wrote:
> Hello, MySQL hackers:
>
> I noticed that during the sub-select transformation some extra stuff is
> being added in to the where clause of some subselects that looks like this:
>
> AND <no matter>.<left_expr> = col_name
>
> <no matter>.<left_expr> is Item_direct_ref
>
> The code in question is in Item_in_subselect::single_value_transformer()
>
> and looks like this:
>
> expr= new Item_direct_ref(&select_lex->context,
> (Item**)optimizer->get_cache(),
> (char *)"<no matter>",
> (char *)in_left_expr_name);
>
>
> Can somebody who knows that code elaborate on the purpose and the
> general idea of such
> transformations?
It is rewriting IN via EXISTS-like query. (there is description in
internals (maybe not up-to-date but you can get the idea).
--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Oleksandr Byelkin <sanja@stripped>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
/_/ /_/\_, /___/\___\_\___/ Lugansk, Ukraine
<___/ www.mysql.com