List:Internals« Previous MessageNext Message »
From:Sergei Golubchik Date:February 9 2009 7:37pm
Subject:Re: Parse Tree Question
View as plain text  
Hi, Matthew!

On Feb 09, Matthew Jenkins wrote:
> Hi,
>
> I am accessing the parse tree for a select query from within a storage 
> engine, and can move along the item list to get the fields and the values. 
> However, I cannot work out how to determine the predicate operator, so I 
> can't see if it was a = or a !=. I get items of type FIELD_ITEM and 
> FIELD_VARIANCE_ITEM. How can I see or test for all the possible operators 
> (=, !=, like etc).

if you have an item, do something like

 item->type() == FUNC_ITEM && ((Item_func*)item)->functype() == EQ_FUNC

that's for "=". See item_cmpfunc.h for the rest of the gang.

Regards / Mit vielen Grüßen,
Sergei

-- 
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <serg@stripped>
 / /|_/ / // /\ \/ /_/ / /__  Principal Software Engineer/Server Architect
/_/  /_/\_, /___/\___\_\___/  Sun Microsystems GmbH, HRB München 161028
       <___/                  Sonnenallee 1, 85551 Kirchheim-Heimstetten
Geschäftsführer: Thomas Schroeder, Wolfgang Engels, Dr. Roland Boemer
Vorsitzender des Aufsichtsrates: Martin Häring
Thread
Parse Tree QuestionMatthew Jenkins9 Feb
  • Re: Parse Tree QuestionSergei Golubchik9 Feb