-
Notifications
You must be signed in to change notification settings - Fork 24
An exception is thrown while creating a tube #26
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
Comments
This mis a server-side error: msgpack can't represent a Lua function object returned by crate_tube. 'call' is designed to have calling convention similar to select and return an array of tuples. To do server-side code execution, we added 'eval' to the binary protocol in 1.6, it can return arbitrary msgpack. We need to make eval available in PHP. Note, that eval requiers a different set of grants compared to call - it requires global 'execute' privilege, as it allows to execute arbitrary Lua code. |
So I would consider it an enhancement request to support eval in PHP driver. |
Thanks for the detailed answer. I wonder if it make sense to throw a proper exception for these sort of errors, something like |
Yes, I agree. @bigbes ? |
@kostja, Yes, i agree, it's part of next branch 0.1.* . |
Another option could be to return a special |
|
@kostja @bigbes The same problem with $t->eval('return queue.create_tube', ['foo', 'fifo']);
Exception: Query error 32: unsupported Lua type 'function'
$t->eval('queue.create_tube', ['foo', 'fifo']);
Exception: Query error 32: eval:1: '=' expected near '<eof>' Also, $t->call('queue.statistics')
Query error 22: Tuple/Key must be MsgPack array but the result of the |
You apparently are misusing eval. Should be $t->eval("return queue.create_tube('foo', 'fifo')") http://tarantool.org - a NoSQL database in a Lua script |
Ah, my bad. But could you please explain why |
Wednesday, June 24, 2015 12:41 AM -07:00 from Eugene Leonovich [email protected]:
Try $t->eval('return queue.create_tube(...)', ['foo', 'fifo']); Eval uses loadstring() under the hood: fun = loadstrring("eval expression") WBR, |
@rtsisyk Any hint why |
Could you please show here the output of queue.statistics() from http://tarantool.org - a NoSQL database in a Lua script |
|
Output:
The tube is created though.
The text was updated successfully, but these errors were encountered: