- Aug 23, 2022
-
-
Gleb Kashkin authored
When multiline commands were loaded from .tarantool_history, they were treated as a bunch of oneline commands. Now readline is configured to write timestamps in .tarantool_history as delimiters and multiline commands are handled correctly. If there is already a .tarantool_history file, readline will set timestamps automatically, nothing will be lost. Closes #7320 NO_DOC=bugfix NO_TEST=impossible to check readline history from lua
-
- Jul 19, 2022
-
-
Rianov Viacheslav authored
This patch fixes the ctrl+c behavior in multiline mode. The old behavior was ignoring sigint in this mode. The new behavior is quitting this mode and printing the new default prompt. Added a new test for covering the mentioned case. Follows up #2717 Closes #7109 NO_DOC=BUGFIX
-
- Jul 14, 2022
-
-
Ilya Verbin authored
lua_encode can raise an exception (e.g. from luaL_checkfield) or return `nil, err` result. Handle it in lbox_console_format_lua, similar to lbox_console_format_yaml. When fixed, it will expose another issue - nil value can not be serialized: ``` tarantool> \set output lua true; tarantool> 1, nil, 2 1, {error = "console: exception while formatting the output: \"serializer: unexpected data (nd.field.size 0 nd.field.type 5)\""}, 2; tarantool> ``` Fix this too. Part of #6781 Part of #6934 NO_DOC=bugfix NO_TEST=not a visible change NO_CHANGELOG=not a visible change
-
Ilya Verbin authored
This patch adds a missed check for `lua_yaml_encode` return value, similar to the check in `console_dump_plain`. Now Lua error is raised if YAML encoding failed for any reason (e.g. OOM or formatting error). Before: ``` tarantool> box.error.new(box.error.ILLEGAL_PARAMS, '\x80') ~/test$ echo $? 0 ~/test$ ``` After: ``` tarantool> box.error.new(box.error.ILLEGAL_PARAMS, '\x80') --- - error: 'console: an exception occurred when formatting the output: expected SCALAR, SEQUENCE-START, MAPPING-START, or ALIAS' ... tarantool> ``` Part of #6781 Part of #6934 NO_DOC=bugfix NO_TEST=see later commits NO_CHANGELOG=see later commits
-
- Apr 13, 2022
-
-
Vladimir Davydov authored
The trigger is invoked on console eval. The trigger callback is passed the eval expression string. It will be used for auditing console events in the EE version. NO_TEST=ee NO_DOC=internal NO_CHANGELOG=internal
-
- Mar 18, 2022
-
-
Sergey Ostanevich authored
This patch updates the logic in lua_rl_complete() where __index from a metatable apparently expected to be a table, not a function. It is rather simple for a table object, but some of them are userdata, so an __autocomplete method is introduced to be sure it returns a table with all names suitable for tabcompletion. Part of #6305 NO_DOC=internal NO_CHANGELOG=part of a fix
-
- Mar 17, 2022
-
-
vr009 authored
Tarantool console quits if you type Ctrl+C. This patch fixes console behavior on sending SIGINT. Console discards the current input on typing Ctrl+C and invites user to the new line. In daemon mode the process will exit after receiving SIGINT. Test gh-2717 should be skipped on release build, cause it uses error injection which is enabled only on debug mode. Fixes #2717 @TarantoolBot document Title: Use Ctrl+C to discard the input in console The signal SIGINT discards the input in console mode. When tarantool executes with -e flag or runs as a daemon, SIGINT kills the process and tarantool complains about it in log.
-
- Feb 04, 2022
-
-
Vladimir Davydov authored
According to the readline library documentation, the callback passed to rl_callback_handler_install is supposed to free the string passed to it: > As with readline(), the handler function should free the line when it > it finished with it. ( See https://tiswww.case.edu/php/chet/readline/readline.html#SEC41 ) Our callback leaks it. Closes #6817 NO_DOC=bug fix
-
- Jan 19, 2022
-
-
Vladimir Davydov authored
The function creates a plain iostream so let's rename it accordingly.
-
- Nov 11, 2021
-
-
Vladimir Davydov authored
There are just a few places outside coio.cc and coio_buf.h where these functions are used directly (most users use helpers from coio_buf.h or xrow_io.h): popen, console, applier. This is a step towards conversion of coio to C.
-
Vladimir Davydov authored
Use coio_write_timeout_noxc instead.
-
- Jul 07, 2021
-
-
Alexander Turenko authored
It is easier to glance on tightly coupled structures and functions, when they're not mixed with others. Just move without actual changes. Part of #3228
-
- Dec 01, 2020
-
-
Cyrill Gorcunov authored
Since the commit ae7e2103 we use internal serializer thus we no longer need serpent code. The patch removes the references from the source code and .gitmodules file, still one might need to run | git submodule deinit -f third_party/serpent manually to clean up the working tree depending on local git version. Closes #5517 Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com>
-
- May 19, 2020
-
-
Vladislav Shpilevoy authored
Closes #4689 @TarantoolBot document Title: box.session.push() 'sync' is deprecated box.session.push() had two parameters - data to push and 'sync'. The sync was a request ID with which the out of bound data should be pushed into a socket. This was introduced as a workaround for #3450, and is useless since its resolution. A user anyway can't push to different sessions, where that parameter could be useful. And pushing into requests of the same session, on the contrary, is something not really needed anywhere, not portable to non-binary session types (console, background), and is just dangerous since it is easy to add a bug here. The patch removes the parameter. Now there will be thrown a 'Usage' error at attempt to use 'sync' parameter. In version 2.4 it is deprecated, prints warnings into logs, but still works. In 2.5 it is removed completely.
-
- May 18, 2020
-
-
Cyrill Gorcunov authored
I do not drop the serpent module for a while since I need to make sure that everything work as expected as we've not break backward compatibility significantly (though we didn't claim the lua mode output is stable enough). Fixes #4682 Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com>
-
Cyrill Gorcunov authored
As we gonna implement lua output serializer lets rename luaL_yaml_default to serializer_yaml which will be more general name, for other serializers we will use same serializer_ prefix. Part-of #4682 Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com>
-
Cyrill Gorcunov authored
This will allow us to implement own formatter for Lua output mode, so to be precise which exactly formatter is caller lets rename general "format" to "format_yaml". Part-of #4682 Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com>
-
Cyrill Gorcunov authored
For some reason we're using spaces here to adjust code. Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com>
-
Cyrill Gorcunov authored
For better maintainance. Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com>
-
- Apr 14, 2020
-
-
Vladislav Shpilevoy authored
API is different from box.session.push() - sync argument was removed. It will disappear from Lua API as well, because it just is not needed here. Session is omitted as well. Indeed, a user can't push to a foreign session, and the current session can be obtained inside box_session_push(). And anyway session is not in the public C API. Internally dump into iproto is done using obuf_dup(), just like tuple_to_obuf() does. obuf_alloc() would be a bad call here, because it wouldn't be able to split the pushed data into several obuf chunks, and would cause obuf fragmentation. Dump into plain text behaves just like a Lua push - it produces a YAML formatted text or Lua text depending on output format. But to turn MessagePack into YAML or Lua text an intermediate Lua representation is used, because there are no a MessagePack -> YAML and MessagePack -> Lua text translators yet. Closes #4734 @TarantoolBot document Title: box_session_push() C API There is a new function in the public C API: ```C int box_session_push(const char *data, const char *data_end); ``` It takes raw MessagePack, and behaves just like Lua `box.session.push()`.
-
- Apr 13, 2020
-
-
Chris Sosnin authored
box.session.storage is a general-purpose table, which can be used by user. Therefore, we shouldn't store any internal details in it. Needed for #4686
-
Chris Sosnin authored
box.session.push() encodes data as a YAML document independent on the current console output format. This patch adds handling for Lua as well. Closes #4686
-
- Jul 24, 2019
-
-
Cyrill Gorcunov authored
@TarantoolBot document Title: document \set output lua Historically we use YAML format to print results of operation to a console. Moreover our test engine is aiming YAML as a primary format to compare results of test runs. Still we need an ability to print results in a different fasion, in particular one may need to use the console in a REPL way so that the results would be copied and pased back to further processing. For this sake we introduce that named "output" command which allows to specify which exactly output format to use. Currently only yaml and lua formats are supported. To specify lua output format type | tarantool> \set output lua in the console. lua mode supports line oriented output (default) or block mode. For example | tarantool> a={1,2,3} | tarantool> a | --- | - - 1 | - 2 | - 3 | ... | tarantool> \set output lua | true | tarantool> a | {1, 2, 3} | tarantool> \set output lua,block | true | tarantool> a | { | 1, | 2, | 3 | } By default YAML output format is kept for now, simply to not break the test engine. The output is bound to a session, thus every new session should setup own conversion if needed. Since serializing lua data is not a trivial task we use "serpent" third party module to convert data. Part-of #3834
-
- May 29, 2019
-
-
Cyrill Gorcunov authored
Since commit f42596a2 we've started to test if a fiber is cancelled in coio_wait. This may hang interactive console with simple fiber.kill(fiber.self()) call. Sane users don't do such tricks and this affects interactive console mode only but still to be on a safe side lets exit if someone occasionally killed the console fiber. Notes: - such exit may ruine terminals settings and one need to reset it after; - the issue happens on interactive console only so I didn't find a way for automatic test and tested manually.
-
- Jun 08, 2018
-
-
Vladislav Shpilevoy authored
Box.session.push() allows to send a message to a client with no finishing a main request. Tarantool after this patch supports pushes over binary protocol. IProto message is encoded using a new header code - IPROTO_CHUNK. Push works as follows: a user calls box.session.push(message). The message is encoded into currently active obuf in TX thread, and then Kharon notifies IProto thread about new data. Originally Kharon is the ferryman of Hades who carries souls of the newly deceased across the rivers Styx and Acheron that divided the world of the living from the world of the dead. In Tarantool Kharon is a message and does the similar work. It notifies IProto thread about new data in an output buffer carrying pushed messages to IProto. Styx here is cpipe, and the boat is cbus message. One connection has single Kharon for all pushes. But Kharon can not be in two places at the time. So once he got away from TX to IProto, new messages can not send Kharon. They just set a special flag. When Kharon is back to TX and sees the flag is set, he immediately takes the road back to IProto. Herewith a user is not blocked to write to obuf when Kharon is busy. The user just updates obuf and set the flag if not set. There is no waiting for Kharon arrival back. Closes #2677
-
- Jun 07, 2018
-
-
Vladislav Shpilevoy authored
It is quite simple - just use stdout file descriptor as the destination for push messages. It is needed to make remote and local console be similar.
-
- Jun 06, 2018
-
-
Vladislav Shpilevoy authored
box.session.push allows to send some intermediate results in the scope of main request with no finalizing it. Messages can be sent over text and binary protocol. This patch allows to send text pushes. Text push is a YAML document tagged with '!push!' handle and 'tag:tarantool.io/push,2018' prefix. YAML tags is a standard way to define a type of the document. Console received push message just prints it to the stdout (or sends to a next console, if it is remote console too). Part of #2677
-
- May 31, 2018
-
-
Vladislav Shpilevoy authored
box.session.push implementation depends on session type - console session must send YAML tagged text, binary session must send MessagePack via another thread, other sessions must return error. Add virtual table to a session with 'push', 'fd' and 'sync' functions. The same virtual table together with struct session meta can be used to use memory of struct session more effectively. Before the patch session stored sync and fd as attributes, but: * fd was duplicated for iproto, which already has fd in connection; * sync is used only by iproto, and just occupies 8 byte in other sessions; * after the #2677 session additionaly must be able to store iproto connection pointer. Struct session meta uses C union to store either iproto, or console, or another meta, but not all of them together. Part of #2677
-
Vladislav Shpilevoy authored
YAML formatting C API is needed for #2677, where it will be used to send text pushes and prints as tagged YAML documents. Push in the next patches is implemented as a virtual C method of struct session, so it is necessary to be able format YAML from C. Needed for #2677
-
- May 05, 2018
-
-
Vladislav Shpilevoy authored
Spurious wakeups are possible in console, that makes readline think that there are some data on stdin. Waked up readline returns garbage instead of string, that crashes a server on assertion in Lua. Closes #3343
-
- Dec 19, 2017
-
-
Konstantin Osipov authored
-
- Dec 07, 2017
-
-
ivankosenko authored
* Input history improvements. Don't add to input history empty lines and two same lines together (to achieve behavior as in bash, python, etc.) * Coding style fix.
-
- May 04, 2017
-
-
Roman Tsisyk authored
See https://github.com/LuaJIT/LuaJIT/commit/dc320ca70f In context of #2393
-
- Feb 13, 2017
- Jan 31, 2017
-
-
Roman Tsisyk authored
-
- Sep 30, 2016
-
-
Nick Zavaritsky authored
-
- Sep 29, 2016
-
-
Nick Zavaritsky authored
-
- Sep 28, 2016
-
-
Nick Zavaritsky authored
Created Lua bindings for history load/save functions. Lua console module is now responsible for persisting the history. Formerly history setup was done in main, but only when tarantool was invoked sans arguments. Affected tarantoolctl.
-
- Sep 27, 2016
-
-
Nick Zavaritsky authored
-