Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH 0/4] session settings fixes
@ 2020-03-30  9:13 Chris Sosnin
  2020-03-30  9:13 ` [Tarantool-patches] [PATCH 1/4] box: replace session_settings modules with a single array Chris Sosnin
                   ` (6 more replies)
  0 siblings, 7 replies; 26+ messages in thread
From: Chris Sosnin @ 2020-03-30  9:13 UTC (permalink / raw)
  To: v.shpilevoy, korablev, tarantool-patches

issue #1:https://github.com/tarantool/tarantool/issues/4711
issue #2:https://github.com/tarantool/tarantool/issues/4712
branch:https://github.com/tarantool/tarantool/tree/ksosnin/gh-4712-session-settings-v2

Chris Sosnin (4):
  box: replace session_settings modules with a single array
  box: add binary search for _session_settings space
  box: provide a user friendly frontend for accessing session settings
  sql: provide a user friendly frontend for accessing session settings

 extra/mkkeywordhash.c                         |   1 +
 src/box/lua/session.c                         | 111 +++++++++
 src/box/session.cc                            |   1 +
 src/box/session.h                             |   2 +
 src/box/session_settings.c                    | 214 +++++++++++-------
 src/box/session_settings.h                    |  53 +++--
 src/box/sql.c                                 |   5 -
 src/box/sql/build.c                           | 104 ++++-----
 src/box/sql/parse.y                           |   5 +
 src/box/sql/sqlInt.h                          |  11 +
 src/box/sql/vdbe.c                            |  50 ++++
 ...rontend.result => session_settings.result} | 147 ++++++++++--
 ...end.test.lua => session_settings.test.lua} |  61 ++++-
 13 files changed, 589 insertions(+), 176 deletions(-)
 rename test/box/{gh-4511-access-settings-from-any-frontend.result => session_settings.result} (71%)
 rename test/box/{gh-4511-access-settings-from-any-frontend.test.lua => session_settings.test.lua} (64%)

-- 
2.21.1 (Apple Git-122.3)

^ permalink raw reply	[flat|nested] 26+ messages in thread
* [Tarantool-patches]  [PATCH 0/4] session settings fixes
@ 2020-04-03 17:09 Peter Gulutzan
  2020-04-03 18:11 ` Timur Safin
  2020-04-07 16:32 ` Chris Sosnin
  0 siblings, 2 replies; 26+ messages in thread
From: Peter Gulutzan @ 2020-04-03 17:09 UTC (permalink / raw)
  To: tarantool-patches

Hi,

Re:
SETTING SET "sql_default_engine" = 'memtx';

Adding a new reserved word SETTING, without advance notice,
should be against policy. It causes a slight risk
of breaking an existing application.

I had hoped for
UPDATE _SETTINGS_DEFAULT_ENGINE SET VALUE = 'memtx';
I claim that is just as "user friendly" -- it
adds two words, but it removes quotation marks.
And it does not require that users learn new syntax
because UPDATE ... SET is well known.

Notice that I can already do this -- almost.
This is legal:
CREATE VIEW _SETTINGS_DEFAULT_ENGINE AS
     SELECT "value" AS value
     FROM "_session_settings"
     WHERE "name" = 'sql_default_engine';
The flaw is that views are not updatable.
But I don't regard that as a big problem
because this is not a proposal to make
all views updatable. It only requires:
when you see that exact UPDATE statement,
transform it to box.session._settings:update.
And similarly for sql_defer_foreign_keys etc.

Alternatively, users could create a Lua function
X which updates
_session_settings, vaguely like this
box.schema.func.create('X',
     {language = 'LUA',
      returns = 'string',
      body = [[function ()
box.space._session_settings:update('sql_default_engine', {{'=', 2, 
'memtx'}});
               return 'memtx changed'
               end]],
      is_sandboxed = false,
      exports = {'LUA', 'SQL'},
      is_deterministic = true})
then allow this SQL syntax:
CALL X();
Again, I claim that this is just as "user friendly"
because -- as far as I can tell -- some people think
saving keystrokes is the same as being friendly.
Nikita Pettik explained that issue#4711 is for a shortcut
and that is short.
Eventually we will probably want to support CALL anyway,
and it is already a reserved word.

Thus there are "user-friendly" alternatives that do not
require new proprietary syntax.

Peter Gulutzan

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2020-04-13 14:18 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-30  9:13 [Tarantool-patches] [PATCH 0/4] session settings fixes Chris Sosnin
2020-03-30  9:13 ` [Tarantool-patches] [PATCH 1/4] box: replace session_settings modules with a single array Chris Sosnin
2020-04-03 13:32   ` Nikita Pettik
2020-03-30  9:13 ` [Tarantool-patches] [PATCH 2/4] box: add binary search for _session_settings space Chris Sosnin
2020-04-03 14:00   ` Nikita Pettik
2020-04-13 13:40     ` Kirill Yukhin
2020-03-30  9:13 ` [Tarantool-patches] [PATCH 3/4] box: provide a user friendly frontend for accessing session settings Chris Sosnin
2020-04-03 14:47   ` Nikita Pettik
2020-03-30  9:13 ` [Tarantool-patches] [PATCH 4/4] sql: " Chris Sosnin
2020-04-03 15:19   ` Nikita Pettik
2020-04-04 21:56   ` Vladislav Shpilevoy
2020-04-10 15:40     ` Chris Sosnin
2020-04-11 17:18       ` Vladislav Shpilevoy
2020-04-13  7:50       ` Timur Safin
2020-04-02  9:14 ` [Tarantool-patches] [PATCH 0/4] session settings fixes Timur Safin
2020-04-02 10:18   ` Chris Sosnin
2020-04-03 12:47   ` Nikita Pettik
2020-04-03 13:09 ` Nikita Pettik
2020-04-03 14:02   ` Chris Sosnin
2020-04-13 14:18 ` Kirill Yukhin
2020-04-03 17:09 Peter Gulutzan
2020-04-03 18:11 ` Timur Safin
2020-04-07 16:32 ` Chris Sosnin
2020-04-08  9:40   ` Timur Safin
2020-04-08 15:03     ` Peter Gulutzan
2020-04-08 14:36   ` Peter Gulutzan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox