[Tarantool-patches] [PATCH v3 3/5] sql: introduce SET statement

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Sun Nov 17 23:32:17 MSK 2019


I was thinking about it, and realized, that SET is
really castrated. For example:

    box.cfg{}
    box.execute('CREATE TABLE test (id INTEGER PRIMARY KEY, a BOOLEAN)')
    box.execute('INSERT INTO test VALUES (1, TRUE)')
    tarantool> box.execute('UPDATE test SET a = FALSE AND TRUE')
    ---
    - row_count: 1
    ...

This UPDATE SET works. Settings SET does not work:

    tarantool> box.execute('SET sql_full_column_names = FALSE AND TRUE;')
    ---
    - null
    - Keyword 'AND' is reserved. Please use double quotes if 'AND' is an identifier.
    ...

I think we need to make them working the same. We can't expect that a user
will always pass a trivial constant boolean value.

Binding also does not work:

    tarantool> box.execute('SET sql_full_column_names = ?;', {true})
    ---
    - null
    - Syntax error near '?'
    ...

And as well, we can't force a user to always concatenate its
settings into a query string. At least this is not safe.

But I think this might be moved to 4621 issue. Because PRAGMA
also does not understand complex expressions, nor bound
parameters.


More information about the Tarantool-patches mailing list