- Mar 07, 2019
-
-
Nikita Pettik authored
BLOB column type is represented by SCALAR field type in terms of NoSQL. We attempted at emulating BLOB behaviour, but such efforts turn out to be not decent enough. For this reason, we've decided to abandon these attempts and fairly replace it with SCALAR column type. SCALAR column type acts in the same way as it does in NoSQL: it is aggregator-type for INTEGER, NUMBER and STRING types. So, column declared with this type can contain values of these three (available in SQL) types. It is worth mentioning that CAST operator in this case does nothing. Still, we consider BLOB values as entries encoded in msgpack with MP_BIN format. To make this happen, values to be operated should be represented in BLOB form x'...' (e.g. x'000000'). What is more, there are two built-in functions returning BLOBs: randomblob() and zeroblob(). On the other hand, columns with STRING NoSQL type don't accept BLOB values. Closes #4019 Closes #4023 @TarantoolBot document Title: SQL types changes There are couple of recently introduced changes connected with SQL types. Firstly, we've removed support of DATE/TIME types from parser due to confusing behaviour of these types: they were mapped to NUMBER NoSQL type and have nothing in common with generally accepted DATE/TIME types (like in other DBs). In addition, all built-in functions related to these types (julianday(), date(), time(), datetime(), current_time(), current_date() etc) are disabled until we reimplement TIME-like types as a native NoSQL ones (see #3694 issue). Secondly, we've removed CHAR type (i.e. alias to VARCHAR and TEXT). The reason is that according to ANSI SQL CHAR(len) must accept only strings featuring length exactly equal to given in type definition. Obviously, now we don't provide such checks. Types VARCHAR and TEXT are still legal. For the same reason, we've removed NUMERIC and DECIMAL types, which were aliases to NUMBER NoSQL type. REAL, FLOAT and DOUBLE are still exist as aliases. Finally, we've renamed BLOB column type to SCALAR. We've decided that all our attempts to emulate BLOB behaviour using SCALAR NoSQL type don't seem decent enough, i.e. without native NoSQL type BLOB there always will be inconsistency, especially taking into account possible NoSQL-SQL interactions. In SQL SCALAR type works exactly in the same way as in NoSQL: it can store values of INTEGER, FLOAT and TEXT SQL types at the same time. Also, with this change behaviour of CAST operator has been slightly corrected: now cast to SCALAR doesn't affect type of value at all. Couple of examples: CREATE TABLE t1 (a SCALAR PRIMARY KEY); INSERT INTO t1 VALUES ('1'); SELECT * FROM t1 WHERE a = 1; -- [] Result is empty set since column "a" contains string literal value '1', not integer value 1. CAST(123 AS SCALAR); -- Returns 123 (integer) CAST('abc' AS SCALAR); -- Returns 'abc' (string) Note that in NoSQL values of BLOB type defined as ones decoded in msgpack with MP_BIN format. In SQL there are still a few ways to force this format: declaring literal in "BLOB" format (x'...') or using one of two built-in functions (randomblob() and zeroblob()). TEXT and VARCHAR SQL types don't accept BLOB values: CREATE TABLE t (a TEXT PRIMARAY KEY); INSERT INTO t VALUES (randomblob(5)); --- - error: 'Tuple field 1 type does not match one required: expected string' ... BLOB itself is going to be reimplemented in scope of #3650.
-
Nikita Pettik authored
NMERIC and DECIMAL were allowed to be specified as column types. But in fact, they were just synonyms for FLOAT type and mapped to NUMERIC Tarantool NoSQL type. So, we've decided to remove this type from parser and return back when NUMERIC will be implemented as a native type. Part of #4019
-
Nikita Pettik authored
Currently, there is no native (in Tarantool terms) types to represent time-like types. So, until we add implementation of those types, it makes no sense to allow to specify those types in table definition. Note that previously they were mapped to NUMBER type. For the same reason all built-in functions connected with DATE/TIME are disabled as well. Part of #4019
-
- Feb 27, 2019
-
-
Mergen Imeev authored
-
- Feb 21, 2019
-
-
Michał Durak authored
Add optional 'chars' parameter to string.strip, string.lstrip and string.rstrip for specifying the unwanted characters. Behavior modeled after the equivalent Python built-ins. Closes: #2977 @TarantoolBot document Title: string.strip(inp, chars) Update the documentation for string.strip, string.lstrip and string.rstrip to reflect the addition of the optional param.
-
- Feb 13, 2019
-
-
Nikita Pettik authored
Replace all usage of sqlite3_, sqlite, SQLite prefixes with simple sql_ All other occurrences of SQLite are substituted with SQL word. SQL test suit is purified as well.
-
- Feb 11, 2019
-
-
Alexander Turenko authored
Nikita Pettik suggests me that free(NULL) is no-op according to POSIX. This is follow up of 9dbcaa3a.
-
- Jan 30, 2019
-
-
Serge Petrenko authored
Make os.exit() call tarantool_exit(), just like the signal handler does. Now on_shutdown triggers are not run only when a fatal signal is received. Closes #1607 @TarantoolBot document Title: Document box.ctl.on_shutdown triggers on_shutdown triggers may be set similar to space:on_replace triggers: ``` box.ctl.on_shutdown(new_trigger, old_trigger) ``` The triggers will be run when tarantool exits due to receiving one of the signals: `SIGTERM`, `SIGINT`, `SIGHUP` or when user executes `os.exit()`. Note that the triggers will not be run if tarantool receives a fatal signal: `SIGSEGV`, `SIGABORT` or any signal causing immediate program termination.
-
Stanislav Zudin authored
The "box.sql.execute('values(blob)')" causes an accert in the expression processing, because the parser doesn't distinguish the keyword "BLOB" from the binary value (in the form X'hex'). This fix adds an additional checks in the SQL grammar. Thus the expressions such as "VALUES(BLOB)", "SELECT FLOAT" and so on are treated as a syntax errors. Closes #3888
-
- Jan 05, 2019
-
-
Alexander Turenko authored
It catched by ASAN at build time (lemon is executed to generate parse.[ch]), so tarantool couldn't be built with -DENABLE_ASAN=ON.
-
- Dec 13, 2018
-
-
Yaroslav Dynnikov authored
Allow exploring rocks documentation locally with `tarantoolctl rocks doc ...` In context of #3753
-
- Nov 15, 2018
-
-
N.Tatunov authored
GLOB is a legacy extension for LIKE from SQLite. As we want our SQL to be close to ANSI SQL & LIKE to depend on collations, we do not want to support it. This patch totally removes it from Tarantool along with any mentions of it. Part of #3589 Part of #3572
-
- Nov 02, 2018
-
-
Georgy Kirichenko authored
As a main part of introducing strict typing in SQL it is required to prohibit typeless columns in parser's grammar. Originally, SQLite simply assigns typeless columns to BLOB affinity. Moreover, due to historical reasons, all columns were stored with <SCALAR> type in Tarantool core (except for <INTEGER> when it comes to primary key). Column type should be defined on table creation. Allowed data types are: <TEXT>, <VARCHAR>, <CHAR>, <BLOB>, <INT[EGER]>, <REAL>, <FLOAT>, <NUMERIC>, <DECIMAL>, <DOUBLE> <DATE> and <DATETIME>. However, still any declared data type is converted to one of <BLOB>, <TEXT>, <REAL> or <INTEGER> affinities. While affinity reaches space format, it is (again) converted to Tarantool's field type. To be more precise, table of conversions: +----------+----------+------------+ | SQL TYPE | AFFINITY | FIELD TYPE | +----------+----------+------------+ | FLOAT | REAL | NUMBER | | REAL | REAL | NUMBER | | DOUBLE | REAL | NUMBER | | NUMERIC | REAL | NUMBER | | DECIMAL | REAL | NUMBER | | INTEGER | INTEGER | INTEGER | | TEXT | TEXT | STRING | | VARCHAR | TEXT | STRING | | CHAR | TEXT | STRING | | BLOB | BLOB | SCALAR | | DATETIME | REAL | NUMBER | | DATE | REAL | NUMBER | | TIME | REAL | NUMBER | +----------+----------+------------+ <VARCHAR> and <CHAR> types should be specified with length (e.g. name VARCHAR(10)), but this length currently is not used when types are processed. Only purpose is to support ANSI syntax. The same for <NUMERIC> and <DECIMAL> - it is allowed to specify scale and precision, but they don't affect the way they are stored in memory. Note that patch is not self-sufficient: a lot of tests still fail due to wrong types conversions. Fix for that comes as next two patches. Closes #3018 Closes #3104 Closes #2494 Closes #3459
-
- Sep 25, 2018
-
-
Serge Petrenko authored
If space.before_replace returns the old tuple, the operation turns into no-op, but is still written to WAL as IPROTO_NOP for the sake of replication. Such a request doesn't have a body, and tarantoolctl failed to parse such requests in `tarantoolctl cat` and `tarantoolctl play`. Fix this by checking whether a request has a body. Also skip such requests in `play`, since they have no effect, and, while we're at it, make sure `play` and `cat` do not read excess rows with lsn>=to in case these rows are skipped. Closes #3675
-
- Sep 22, 2018
-
-
Vladimir Davydov authored
Closes #3311
-
- Sep 19, 2018
-
-
Nikita Pettik authored
As a part of SQL DD integration it is required to substitute SQLite structure representing index with one from Tarantool internals. To make this happen, lets add surrogate space to Table, which will hold array of indexes. Those indexes are not real copies from Tarantool core, but contain only index_def, since only def is useful during query compilation. Note that in new implementation indexes are held as array and added to that array in straight order. In SQLite indexes are arranged in list and added to the head. Hence, the order of indexes is reversed. It results in different query plans: if planner must make choice of two equal indexes, it chooses simply first one. Due to this change, some tests are fixed. Moreover, alongside with substituting index struct, <REINDEX> statement and routine connected with it has been completely removed. Part of #3561
-
- Sep 06, 2018
-
-
Georgy Kirichenko authored
A possibility to build tarantool with included library dependencies. Use the flag -DBUILD_STATIC=ON to build statically against curl, readline, ncurses, icu and z. Use the flag -DOPENSSL_USE_STATIC_LIBS=ON to build with static openssl Changes: * Add FindOpenSSL.cmake because some distributions do not support the use of openssl static libraries. * Find libssl before curl because of build dependency. * Catch all bundled libraries API and export then it in case of static build. * Rename crc32 internal functions to avoid a name clash with linked libraries. Notes: * Bundled libyaml is not properly exported, use the system one. * Dockerfile to build static with docker is included Fixes #3445
-
- Aug 29, 2018
-
-
Nikita Pettik authored
We disabled ALTER TABLE ADD COLUMN long ago (i.e. banned in parser ability to process this statement), but internal functions for handling this routine have remained. This patch removes them as well. Part of #3561
-
- Aug 21, 2018
-
-
Konstantin Belyavskiy authored
During startup tarantoolctl ignores 'pid_file' option and set it to default value. This cause a fault if user tries to execute config with option set. In case of being started with tarantoolctl shadow this option with additional wrapper around box.cfg. Closes #3214
-
Konstantin Belyavskiy authored
Fixing build under FreeBSD: Undefined symbol "iconv_open" Add compile time build check with FindICONV.cmake and a wrapper to import relevant symbol names with include file. Closes #3441
-
Serge Petrenko authored
Tarantoolctl enter didn't check whether connection to a socket was established if a socket file existed. It just executed a local console. Fix this by adding a check and an error, also add a test case. Closes #3364
-
- Aug 20, 2018
-
-
Vladimir Davydov authored
If `tarantoolctl eval` fails, apart from returning 3 and printing the eval error to stderr, tarantoolctl will also emit the following message: Error while reloading config: This message is quite confusing and useless too, as we have the return code for that. Let's zap it. Closes #3560
-
- Aug 16, 2018
-
-
Mergen Imeev authored
According to #3072 log_nonblock cannot be used in given case. This patch set this option to "false". Closes #3348
-
- Aug 15, 2018
-
-
Eugine Blikh authored
`lua_tostring`/`lua_tolstring` ignores metatable/boolean/nil and return NULL, but sometimes it's needed to have similar behaviour, like lua functions tostring. Lua 5.1 and LuaJIT ignores it by default, Lua 5.2 introduced auxilary function luaL_to(l)string with supporting of __tostring. This function is backport of Lua 5.1 "lauxlib.h"s luaL_tostring in the luaT namespace.
-
- Aug 14, 2018
-
-
Kirill Shcherbatov authored
Resolves #3284.
-
- Aug 07, 2018
-
-
Nikita Pettik authored
We always compile with enabled foreign keys constraints. They still can be turned off by <pragma foreign_keys = false> in runtime. Follow-up #3271
-
Nikita Pettik authored
After introducing separate space for persisting foreign key constraints, nothing prevents us from adding ALTER TABLE statement to add or drop named constraints. According to ANSI syntax is following: ALTER TABLE <referencing table> ADD CONSTRAINT <referential constraint name> FOREIGN KEY <left paren> <referencing columns> <right paren> REFERENCES <referenced table> [ <referenced columns> ] [ MATCH <match type> ] [ <referential triggered action> ] [ <constraint check time> ] ALTER TABLE <referencing table> DROP CONSTRAINT <constrain name> In our terms it looks like: ALTER TABLE t1 ADD CONSTRAINT f1 FOREIGN KEY(id, a) REFERENCES t2 (id, b) MATCH FULL; ALTER TABLE t1 DROP CONSTRAINT f1; FK constraints which come with CREATE TABLE statement are also persisted with auto-generated name. They are coded after space and its indexes. Moreover, we don't use original SQLite foreign keys anymore: those obsolete structs have been removed alongside FK hash. Now FK constraints are stored only in space. Since types of referencing and referenced fields must match, and now in SQL only PK is allowed to feature INT (other fields are always SCALAR), some tests have been corrected to obey this rule. Part of #3271
-
- Aug 02, 2018
-
-
Mergen Imeev authored
This patch allow to use option "--language" with "tarantoolctl enter" command. Also default value for language were added in default configuration file. Language is either SQL or Lua. Closes #2385. @TarantoolBot document Title: Language selection for tarantoolctl "enter". User can select either Lua or SQL when he uses tarantoolctl "enter" command. It can be done using "--language=<language>" syntax. Default language is set in tarantoolctl config file. Usage: tarantoolctl enter <app_name> --language=SQL tarantoolctl enter <app_name> --language=Lua
-
- Jul 31, 2018
-
-
Konstantin Nazarov authored
The subcommands are used to create binary rock distributions. In context of #3525
-
Kirill Yukhin authored
This pragma is dead and produces nothing else but segfault. Along w/ this pragma, remove now dead opcodes which set/read schema_version and all related routines. Also, improve opcode generation script. Part of #3541
-
- Jul 27, 2018
-
-
Kirill Shcherbatov authored
To implement new TRUNCATE operation, we have introduced a new P2 argument for OP_Clear opcode that calles box_truncate instead of tarantoolSqlite3ClearTable. This operation should work faster than DELETE FROM; but have a few restricts. Closes #2201. @TarantoolBot document Title: New TRUNCATE operation TRUNCATE is DDL operation. Removes all rows from a table or specified partitions of a table, without logging the individual row deletions. TRUNCATE TABLE is similar to the DELETE statement with no WHERE clause; however, TRUNCATE TABLE is faster and uses fewer system resources. It couldn't be used with system tables or with tables having FKs. It also couldn't be called in transaction. The triggers on table will have ignored. Example: TRUNCATE TABLE t1;
-
- Jul 20, 2018
-
-
N.Tatunov authored
Previously "BEGIN" / "BEGIN TRANSACTION", "COMMIT TRANSACTION" / "END" / "END TRANSACTION", "ROLLBACK TRANSACTION" could be used to handle transactions. By changing these commands syntax in parser we're aiming on getting closer to ANSI SQL. Also found initialization in ifdef that caused some problems with error messages in occasions when the wrong syntax was used. With the patch applied only following commands can be used: - "START TRANSACTION" to begin transaction. - "COMMIT" to end transaction. - "ROLLBACK" to rollback transaction without savepoints. - "ROLLBACK TO .." to rollback transaction to savepoint. Closes #2164
-
- Jul 13, 2018
-
-
Ivan Kosenko authored
-
- Jul 09, 2018
-
-
Serge Petrenko authored
Net.box usage for console is deprecated in 1.10, replaced it with console. Closes: #3490
-
- Jul 05, 2018
-
-
Ilya Markov authored
Add propagation to luarocks of --only-server, --server keys. Closes #2640
-
Serge Petrenko authored
There are some hacks to know the instance was run by tarantoolctl, none of them are too reliable, though. This patch introduces 2 environment variables set by tarantoolctl for the instance to know when it's being run or restarted. Closes: #3215 @TarantoolBot document Title: tarantoolctl: document setting environment variables tarantoolctl sets the `TARANTOOLCTL` environment variable when starting an instance, and sets the `TARANTOOL_RESTARTED' environment variable when restarting.
-
- Jun 29, 2018
-
-
AKhatskevich authored
`sql_current_time` is exported only in debug mode and used to check builtin datetime sql functions behavior in specific time moments. Extra changes: * table-14.1 test is deleted, as it does not test anything. It was testing ddl inside of a transaction. This case is checked by 14.2 by now. Closes #2646
-
- Jun 28, 2018
-
- Jun 19, 2018
-
-
Nikita Pettik authored
In Tarantool VIEWs are always enabled, so there is no need for such ifdef guards. This patch simply removes them.
-
- May 30, 2018
-
-
Mergen Imeev authored
According to ANSI Standard IS/IS NOT can be used to determine if values is null. At the same time in SQLite3 IS/IS NOT have an additional function - it can be used to check equality of two values. This feature isn't common for different versions of SQL (only in PL/SQL right operand can be NONE, TRUE of FALSE) This patch removes described function.
-