Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use square brackets in procedure resolution for Lua calls #8604

Closed
CuriousGeorgiy opened this issue Apr 25, 2023 · 1 comment · Fixed by #8660
Closed

Cannot use square brackets in procedure resolution for Lua calls #8604

CuriousGeorgiy opened this issue Apr 25, 2023 · 1 comment · Fixed by #8660
Assignees
Labels
3.0 Target is 3.0 and all newer release/master branches feature A new functionality iproto

Comments

@CuriousGeorgiy
Copy link
Member

CuriousGeorgiy commented Apr 25, 2023

I have the following schema:

box.cfg{}

s = box.schema.space:create('s')
s:create_index('i')

rawset(_G, {bar = function() return 777 end, [777] = function() return 777 end}, 'foo')

The following calls succeed:

nb = require('net.box')

nb.self:call('box.space.s:select')
-- []
nb.self:call('foo.bar')
-- 777

While the following calls return an error:

nb = require('net.box')

nb.self:call('box.space['s']:select')
-- error: Procedure 'box.space['s']:select()' is not defined
nb.self:call('box.space[512]:select')
-- error: Procedure 'box.space[512]:select()' is not defined
nb.self:call('foo[777]')
-- error: Procedure 'foo[777]' is not defined
@CuriousGeorgiy CuriousGeorgiy added bug Something isn't working iproto labels Apr 25, 2023
@CuriousGeorgiy CuriousGeorgiy self-assigned this Apr 25, 2023
@CuriousGeorgiy CuriousGeorgiy added feature A new functionality and removed bug Something isn't working labels Apr 25, 2023
@CuriousGeorgiy CuriousGeorgiy changed the title Cannot use square brackets in box procedure resolution for remote calls Cannot use square brackets in procedure resolution for Lua calls Apr 25, 2023
@CuriousGeorgiy
Copy link
Member Author

Requested by @alyapunov.

CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Apr 25, 2023
With the addition of square brackets, procedure resolution for Lua calls is
essentially parsing a JSON path ('*' placeholder forbidden) with a special
colon case for object methods, which we handle separately: refactor the
existing code to reuse JSON lexer.

Closes tarantool#8604

@TarantoolBot document
Title: JSON paths in procedure resolution for Lua calls

With the addition of square brackets to procedure resolution, Lua calls now
resolve any JSON path to a procedure. This is applicable to `net.box`
connection objects `call` method as well as `box.schema.func.call`.

Examples of JSON path function calls are provided in the test.
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Apr 25, 2023
With the addition of square brackets, procedure resolution for Lua calls is
essentially parsing a JSON path ('*' placeholder forbidden) with a special
colon case for object methods, which we handle separately: refactor the
existing code to reuse JSON lexer.

Closes tarantool#8604

@TarantoolBot document
Title: JSON paths in procedure resolution for Lua calls

With the addition of square brackets to procedure resolution, Lua calls now
resolve any JSON path to a procedure. This is applicable to `net.box`
connection objects `call` method as well as `box.schema.func.call`.

Examples of JSON path function calls are provided in the test.
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Apr 26, 2023
With the addition of square brackets, procedure resolution for Lua calls is
essentially parsing a JSON path ('*' placeholder forbidden) with a special
colon case for object methods, which we handle separately: refactor the
existing code to reuse JSON lexer.

Closes tarantool#8604

@TarantoolBot document
Title: JSON paths in procedure resolution for Lua calls

With the addition of square brackets to procedure resolution, Lua calls now
resolve any JSON path to a procedure. This is applicable to `net.box`
connection objects `call` method as well as `box.schema.func.call`.

Examples of JSON path function calls are provided in the test.
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Apr 27, 2023
With the addition of square brackets, procedure resolution for Lua calls is
essentially parsing a JSON path ('*' placeholder forbidden) with a special
colon case for object methods, which we handle separately: refactor the
existing code to reuse JSON lexer.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Apr 27, 2023
Add a lexer for parsing parts of Lua procedure call: basically, it's
copy-paste of JSON path lexer accounting for differences between JSON paths
and Lua procedure calls.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Apr 27, 2023
Add a lexer for parsing parts of Lua procedure call: basically, it's
copy-paste of JSON path lexer accounting for differences between JSON paths
and Lua procedure calls.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Apr 28, 2023
Add a lexer for parsing parts of Lua procedure call: basically, it's
copy-paste of JSON path lexer accounting for differences between JSON paths
and Lua procedure calls.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue May 6, 2023
Add a lexer for parsing parts of Lua procedure call: basically, it's
copy-paste of JSON path lexer accounting for differences between JSON paths
and Lua procedure calls.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue May 7, 2023
Add a lexer for parsing parts of Lua procedure call: basically, it's
copy-paste of JSON path lexer accounting for differences between JSON paths
and Lua procedure calls.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue May 7, 2023
Add a lexer for parsing parts of Lua procedure call: basically, it's
copy-paste of JSON path lexer accounting for differences between JSON paths
and Lua procedure calls.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue May 7, 2023
Add a lexer for parsing parts of Lua procedure call: basically, it's
copy-paste of JSON path lexer accounting for differences between JSON paths
and Lua procedure calls.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue May 7, 2023
Add a lexer for parsing parts of Lua procedure call: basically, it's
copy-paste of JSON path lexer accounting for differences between JSON paths
and Lua procedure calls.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue May 10, 2023
Add a lexer for parsing parts of Lua procedure call: basically, it's
copy-paste of JSON path lexer accounting for differences between JSON paths
and Lua procedure calls.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue May 10, 2023
Add a lexer for parsing parts of Lua procedure call: basically, it's
copy-paste of JSON path lexer accounting for differences between JSON paths
and Lua procedure calls.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue May 10, 2023
Add a lexer for parsing parts of Lua procedure call: basically, it's
copy-paste of JSON path lexer accounting for differences between JSON paths
and Lua procedure calls.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue May 10, 2023
Add a lexer for parsing parts of Lua procedure call: basically, it's
copy-paste of JSON path lexer accounting for differences between JSON paths
and Lua procedure calls.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue May 11, 2023
Add a lexer for parsing parts of Lua procedure call: basically, it's
copy-paste of JSON path lexer accounting for differences between JSON paths
and Lua procedure calls.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue May 12, 2023
Add a lexer for parsing parts of Lua procedure call: basically, it's
copy-paste of JSON path lexer accounting for differences between JSON paths
and Lua procedure calls.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue May 13, 2023
Add a lexer for parsing parts of Lua procedure call: basically, it's
copy-paste of JSON path lexer accounting for differences between JSON paths
and Lua procedure calls.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue May 15, 2023
Add a lexer for parsing parts of Lua procedure call: basically, it's
copy-paste of JSON path lexer accounting for differences between JSON paths
and Lua procedure calls.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue May 15, 2023
Add a lexer for parsing parts of Lua procedure call: basically, it's
copy-paste of JSON path lexer accounting for differences between JSON paths
and Lua procedure calls.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue May 15, 2023
Add a lexer for parsing parts of Lua procedure call: basically, it's
copy-paste of JSON path lexer accounting for differences between JSON paths
and Lua procedure calls.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
alyapunov added a commit to alyapunov/tarantool that referenced this issue May 16, 2023
Fefactor lua name resolution, simplify and comment.
Add an ability to specify path with brackets, for example in
'box.space[512]:get' or 'box.space["test"]:get'.
Only literals (strings and numbers) are supported.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
alyapunov added a commit to alyapunov/tarantool that referenced this issue May 16, 2023
Fefactor lua name resolution, simplify and comment.
Add an ability to specify path with brackets, for example in
'box.space[512]:get' or 'box.space["test"]:get'.
Only literals (strings and numbers) are supported.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
alyapunov added a commit to alyapunov/tarantool that referenced this issue May 16, 2023
Fefactor lua name resolution, simplify and comment.
Add an ability to specify path with brackets, for example in
'box.space[512]:get' or 'box.space["test"]:get'.
Only literals (strings and numbers) are supported.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
@locker locker added the 3.0 Target is 3.0 and all newer release/master branches label May 16, 2023
alyapunov added a commit to alyapunov/tarantool that referenced this issue May 16, 2023
Fefactor lua name resolution, simplify and comment.
Add an ability to specify path with brackets, for example in
'box.space[512]:get' or 'box.space["test"]:get'.
Only literals (strings and numbers) are supported.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
alyapunov added a commit to alyapunov/tarantool that referenced this issue May 16, 2023
Fefactor lua name resolution, simplify and comment.
Add an ability to specify path with brackets, for example in
'box.space[512]:get' or 'box.space["test"]:get'.
Only literals (strings and numbers) are supported.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
alyapunov added a commit to alyapunov/tarantool that referenced this issue May 16, 2023
Fefactor lua name resolution, simplify and comment.
Add an ability to specify path with brackets, for example in
'box.space[512]:get' or 'box.space["test"]:get'.
Only literals (strings and numbers) are supported.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
alyapunov added a commit to alyapunov/tarantool that referenced this issue May 16, 2023
Fefactor lua name resolution, simplify and comment.
Add an ability to specify path with brackets, for example in
'box.space[512]:get' or 'box.space["test"]:get'.
Only literals (strings and numbers) are supported.

Closes tarantool#8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
alyapunov added a commit that referenced this issue May 18, 2023
Fefactor lua name resolution, simplify and comment.
Add an ability to specify path with brackets, for example in
'box.space[512]:get' or 'box.space["test"]:get'.
Only literals (strings and numbers) are supported.

Closes #8604

@TarantoolBot document
Title: square brackets in procedure resolution for Lua calls

Square brackets are now supported in Lua call procedure resolution. This is
applicable to `net.box` connection objects `call` method as well as
`box.schema.func.call`.

Examples of function calls with square brackets can be found in the test to
this patch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0 Target is 3.0 and all newer release/master branches feature A new functionality iproto
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants