--- [EMAIL PROTECTED] wrote: > Joe Wilson <[EMAIL PROTECTED]> wrote: > > Given an arbitrary SELECT in a parse tree that has been > > resolved via sqlite3SelectResolve, and assuming that > > Expr.op==TK_COLUMN does Expr.iTable always yield the > > correct index into the Expr.pTab array in the same Expr > > struct? > > No. When Expr.op==TK_COLUMN, Expr.iTable is the integer > cursor number of that table in the virtual machine. For > simple queries, where each table in the FROM clause maps > to a cursor (no indices are used) then your assertion above > might, by chance, turn out to be correct. But for most > interesting queries it will not.
What is the recommended way to match a TK_COLUMN Expr from a Select's pEList with its corresponding Select.pSrc SrcList_item? Do you forsee any technical problem with recursively descending the entire parse tree and calling sqlite3SelectResolve() on every nested Select prior to any code generation in order to perform high-level AST manipulation? I would like to do a number of AST transformations before any VDBE code is generated, but I still lack a clear understanding of how to reliably map a TK_COLUMN Expr with its associated SrcList_item. Thanks. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com