- Jan 24, 2018
-
-
Kirill Yukhin authored
Macro SQLITE_DEBUG was set unconditionally, so both release build modes had debugging enabled, including all asserts() and TESTCASE(). Move this macro definition under check if mode is Debug and fix all warning which arised after disabling asserts(). Most of them are unused variables.
-
Kirill Yukhin authored
Since asserts were always disbled in src/box/sql.c, number of issues were hidden. This patch enables asserts for mentioned file by disabling set of NDEBUG in box/src/sqliteInt.h. Also this patch fixes incorrect assertions about strlen() and assertion that fieldno should always be less than format->field_count. This assert is not always hold, e.g. for _schema space where max_id is stored behind formatted fields. Closes #3057
-
Kirill Yukhin authored
Add forgotten in previous commit regenerated box/sql/parse.c
-
- Jan 23, 2018
-
-
Kirill Yukhin authored
Currently, only ALTER TABLE RENAME is supported in SQL. Ban ALTER TABLE ADD COLUMN in the grammar until it is supported. Corresponding issue submitted: #3075 Closes #2607
-
- Jan 18, 2018
-
-
Kirill Yukhin authored
There're 3 places where FreeBSD specific routines contained (for compatibility) unused parameters. Mark them w/ unused attribute. Closes #3037
-
- Jan 15, 2018
-
-
Alexander Turenko authored
SQLITE_ENABLE_UNLOCK_NOTIFY assumed to be always disabled. SQLITE_OMIT_SHARED_CACHE assumed to be always enabled. Deleted files ------------- src/box/sql/notify.c src/box/sql/btmutex.c Deleted non-static functions ---------------------------- // btmutex.c sqlite3BtreeEnter() sqlite3BtreeLeave() sqlite3BtreeHoldsMutex() sqlite3BtreeEnterAll() sqlite3BtreeLeaveAll() sqlite3BtreeHoldsAllMutexes() sqlite3SchemaMutexHeld() sqlite3BtreeEnterCursor() sqlite3BtreeLeaveCursor() // btree.c sqlite3BtreeLockTable() sqlite3BtreeSharable() sqlite3BtreeConnectionCount() // notify.c sqlite3_unlock_notify() sqlite3ConnectionBlocked() sqlite3ConnectionUnlocked() sqlite3ConnectionClosed() // vdbeaux.c sqlite3VdbeEnter() sqlite3VdbeLeave() Deleted structure fields ------------------------ // btreeInt.h struct Btree.wantToLock struct Btree.lock struct BtShared.nRef struct BtShared.pNext struct BtShared.pLock struct BtShared.pWriter // sqliteInt.h struct sqlite3.pBlockingConnection struct sqlite3.pUnlockConnection struct sqlite3.pUnlockArg struct sqlite3.xUnlockNotify struct sqlite3.pNextBlocked Deleted asserts --------------- // common assert(sqlite3BtreeHoldsAllMutexes(...)) assert(sqlite3SchemaMutexHeld(...)) assert(sqlite3BtreeHoldsMutex(...)) // btree.c assert(... || sqlite3BtreeConnectionCount(...) > 0) assert(p->wantToLock == 0 && p->locked == 0) assert(hasSharedCacheTableLock(...)) assert(... || !hasReadConflicts(...))
-
- Jan 05, 2018
-
-
khatskevich authored
Part of #2931
-
khatskevich authored
There are some cases where a number of similar tests should be performed. In this scenario, we had to write a lot of redundant symbols. The new method allows one to write the minimal number of code necessary for tests.
-
khatskevich authored
-
AKhatskevich authored
This comit introduces a number of changes: 1. move a transaction state to fiber local struct This is important because the `sqlite3` is a shared structure and it was used to store data related to the transaction. However it was working because yield is called only on commit and it garanteed unique access. (With possible effects on ddl.) NOTE: `nDeferredCons` and `nDeferredImmCons` are stored in vdbe during vdbe execution and moved to sql_txn when it needs to be saved until execution of the next vdbe in the same transaction. 2. support savepoints 2.1. support abort (anonymous savepoints) Abort mechanism was simplified. Instead of storing track of all savepoints without name, this commit introduces `anonymous_savepoint`. `anonymous_savepoint` is a structure which is stored in Vdbe and represents the state of database on the beginning of the current statement. Tarantool disallow multistatement, so a vdbe can have one statement max. That is why having one savepoint is enough to perform abort. 2.2. named savepoints Key points: - It uses Tarantool's savepoints - It allocates savepoints on the "region" (they are destroyed automatically) - There are some crutches around ddl (ddl should not be placed into a transaction) Closes #2989 #2931 #2964
-
- Dec 26, 2017
-
-
Alexander Turenko authored
The header is useless for Tarantool. Fixes #2944.
-
Alexander Turenko authored
There were dozen of test cases which still used ROWID feature. Patch updates such cases.
-
Alexander Turenko authored
-
Alexander Turenko authored
Fixes #2884.
-
Bulat Niatshin authored
Rowid is removed right now from Tarantool SQL. That means that table must have primary key. However, table defined w/o PK field caused Tarantool to a crash instead of raising an error message complaining missing PRIMARY KEY. Fix this and add a regression test Closes #2929
-
- Dec 20, 2017
-
-
Bulat Niatshin authored
Assign is_nullable property for each column in order to fix all sql tests after reverting MP_NIL comparators in previous commit. Closes #3009
-
Bulat Niatshin authored
This reverts commit a2f574e3.
-
Kirill Yukhin authored
After TableLock opcode removal, need to re-generate opcode definitions file.
-
- Dec 18, 2017
-
-
Kirill Yukhin authored
Removed OP_ParseSchema, OP_TableLock. All other dead code connected to locking of open tables (for both reading and writing) removed as well. Remove auth.c file, it is not used anymore.
-
Kirill Yukhin authored
Few opcodes like OpenRead/OpenWrite exepcted 3rd argument to be DB descriptor. Now there's a single DB backend and there's no need for any descriptors. Remove from VDBE, fix code generator, update opcode descriptions. Closes #2855
-
- Dec 15, 2017
-
-
khatskevich authored
Make collation tokens obey ANSI ISO standard rules for identifiers. Related to #2818
-
khatskevich authored
-
khatskevich authored
Closes #2653, #2121
-
khatskevich authored
Thsis patch do two main changes: 1. Delete SQLite's coll structure & replace it with Tarantool's 2. Delere SQLite's create coll mechanism Tarantool can not easily support create collation mechanism of SQLite, because collations must: - be persistent - be the same in tuple comparator and SQL Mem comparator Although new collations are limited, suggested ICU collations cover the main set of use-cases. ICU supports: - Different locales & different strengths & other options... - Nimeruc stringths comparation. That is why we limit collation api at this point. Part of #2121
-
khatskevich authored
collation_list pragma should change as the way collations work changes. To enumerate all collations one have to iterate space for now.
-
khatskevich authored
This feature is required by SQL, because searching collations by name is common operation there. Is implemented by creating extra hash table.
-
khatskevich authored
This is the second attempt to remove encodings. At this point Tarantool SQL supports only UTF-8 encoding. Part of #2295
-
- Dec 08, 2017
-
-
khatskevich authored
Part of #2121
-
- Dec 06, 2017
-
-
Nikita Pettik authored
Deletion of rows from table (which is part of DROP TABLE procedure) is wrapped in transaction now. If any Foreign Key violations occur, then rollback transaction and halt execution of statement. Otherwise, commit changes and continue DROP TABLE routine. This logic is implemented by OP_FkCheckCommit opcode. Added tests for this case. Closes #2953
-
- Dec 05, 2017
-
-
khatskevich authored
There were analogies of those functions in Tarantool. This commit makes SQL reuse them. All crutches (undef) are deleted.
-
Nikita Pettik authored
Added new opcode OP_RenameTable, which implements SQL statment: ALTER TABLE old_name RENAME TO new_name; The main idea is to replace corresponding tuple in _space. New tuple will contain new name and new SQL statement, which creates this table. If it is parent table for foreign key, update SQL statement of child table. Then, remove old name from hash table and by calling callback function from VDBE, update database schema with new table name. After all, in the same way update triggers' statements in _trigger table, if any exist. Closes #2204
-
- Nov 30, 2017
-
-
Vladimir Davydov authored
-
Nikita Pettik authored
Closes #2506
-
Nikita Pettik authored
Opcode OP_FCopy copies integer value of register P1 into register P2. However, if third operand contains flag OPFLAG_NOOP_IF_NULL and reg[P1] == NULL, then it does nothing. It could lead to wrong behaviour, when reg[P2] is undefined: in some cases VDBE uses reg[P2] instantly after OP_FCopy. So, if reg[P2] is undefined, simply assign it to MEM_Null. Closes #2949
-
Nikita Pettik authored
Most tests are converted from original SQLite test suite. Tests for DEFERRED constraint are not included since it is currently broken and there is no opportunity to test it.
-
Roman Tsisyk authored
-
- Nov 29, 2017
-
-
Vladimir Davydov authored
Applier must not update the replication lag upon receiving a packet containing an error, because those packets don't have timestamps. Closes #2965
-
Ilya authored
Remove `message` field from blacklist, because JSON and plain loggers are mutually exclusive. Fixes #2923
-
- Nov 27, 2017
-
-
khatskevich authored
For some reason 'tnum' attribute for pk was set in convertToWithoutRowid function, while for other indexes it was set in sqlite3CreateIndex. The if clause in sqlite3CreateIndex was filtering not only PK, but inline unique indexes too. Now 'tnum' is always set in sqlite3CreateIndex procedure. Closes #2808
-
Ilya authored
* Add pbkdf2 hashing API * Wrapper of OpenSSL Closes #2874
-