[tarantool-patches] Re: [PATCH] sql: remove Table lookup from ColumnsFromExprList

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Fri Jun 1 16:48:11 MSK 2018


Hello. Thanks for the patch! LGTM.

On 01/06/2018 14:12, Nikita Pettik wrote:
> sqlite3ColumnsFromExprList doesn't assume that hash contains table to be
> examined. Thus, assert(table != NULL) after table lookup fails for
> temporary (or in other words ephemeral) objects, e.g. see sqlite_sq_...
> tables. In fact, this lookup is needed only when iColumn member of
> struct Expr is less than zero. On the other hand, Expr->iColumn < 0 only
> for rowid (according to comments in source code) columns:
> "Expr.iColumn The column index in X.Y.  -1 for the rowid."
> As far as we don't have rowid anymore, remove table lookup and add
> assert testing iColumn to be greater or equal to zero.
> 
> Closes #3440
> ---
> Branch: https://github.com/tarantool/tarantool/commits/np/gh-3440-crash-on-view
> Issue: https://github.com/tarantool/tarantool/issues/3440
> 
>   src/box/sql/select.c          |  7 +------
>   test/sql-tap/tkt1449.test.lua | 12 +++++++++++-
>   2 files changed, 12 insertions(+), 7 deletions(-)
> 




More information about the Tarantool-patches mailing list