Tarantool development patches archive
 help / color / mirror / Atom feed
* [tarantool-patches] [PATCH 0/3] Delete foreign_keys and ignore_check_constraints pragmas
@ 2018-10-02 10:48 AKhatskevich
  2018-10-02 10:48 ` [tarantool-patches] [PATCH 1/3] sql: delete unused code AKhatskevich
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: AKhatskevich @ 2018-10-02 10:48 UTC (permalink / raw)
  To: korablev, tarantool-patches

Issue: https://github.com/tarantool/tarantool/issues/3696
Branch: https://github.com/tarantool/tarantool/tree/kh/gh-3696-delete-pragmas-2

Those pragmas let a user turn off constraint checks.
They are considered useless and dangerous.

AKhatskevich (3):
  sql: delete unused code
  sql: delete foreign_keys pragma
  sql: delete ignore_check_constraints pragma

 src/box/sql.c                             |   3 +-
 src/box/sql/CMakeLists.txt                |   1 -
 src/box/sql/fkey.c                        |  21 +--
 src/box/sql/insert.c                      |   7 +-
 src/box/sql/main.c                        | 291 ------------------------------
 src/box/sql/pragma.h                      |  14 --
 src/box/sql/sqliteInt.h                   |  19 +-
 test/sql-tap/check.test.lua               |  15 +-
 test/sql-tap/tkt-b1d3a2e531.test.lua      |   8 +-
 test/sql-tap/triggerC.test.lua            |   5 +-
 test/sql/transitive-transactions.result   |   3 -
 test/sql/transitive-transactions.test.lua |   1 -
 12 files changed, 12 insertions(+), 376 deletions(-)

-- 
2.14.1

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [tarantool-patches] [PATCH 1/3] sql: delete unused code
  2018-10-02 10:48 [tarantool-patches] [PATCH 0/3] Delete foreign_keys and ignore_check_constraints pragmas AKhatskevich
@ 2018-10-02 10:48 ` AKhatskevich
  2018-10-02 13:36   ` [tarantool-patches] " n.pettik
  2018-10-02 10:48 ` [tarantool-patches] [PATCH 2/3] sql: delete foreign_keys pragma AKhatskevich
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: AKhatskevich @ 2018-10-02 10:48 UTC (permalink / raw)
  To: korablev, tarantool-patches

Part of #3696
---
 src/box/sql/main.c      | 291 ------------------------------------------------
 src/box/sql/sqliteInt.h |  15 ---
 2 files changed, 306 deletions(-)

diff --git a/src/box/sql/main.c b/src/box/sql/main.c
index 782f99452..3a01f1207 100644
--- a/src/box/sql/main.c
+++ b/src/box/sql/main.c
@@ -483,105 +483,6 @@ setupLookaside(sqlite3 * db, void *pBuf, int sz, int cnt)
 	return SQLITE_OK;
 }
 
-/*
- * Free up as much memory as we can from the given database
- * connection.
- */
-int
-sqlite3_db_release_memory(sqlite3 * db)
-{
-	(void)db;
-#ifdef SQLITE_ENABLE_API_ARMOR
-	if (!sqlite3SafetyCheckOk(db))
-		return SQLITE_MISUSE_BKPT;
-#endif
-	return SQLITE_OK;
-}
-
-/*
- * Flush any dirty pages in the pager-cache for any attached database
- * to disk.
- */
-int
-sqlite3_db_cacheflush(sqlite3 * db)
-{
-	int rc = SQLITE_OK;
-	int bSeenBusy = 0;
-	(void)db;
-#ifdef SQLITE_ENABLE_API_ARMOR
-	if (!sqlite3SafetyCheckOk(db))
-		return SQLITE_MISUSE_BKPT;
-#endif
-	return ((rc == SQLITE_OK && bSeenBusy) ? SQLITE_BUSY : rc);
-}
-
-/*
- * Configuration settings for an individual database connection
- */
-int
-sqlite3_db_config(sqlite3 * db, int op, ...)
-{
-	va_list ap;
-	int rc;
-	struct session *user_session = current_session();
-
-	va_start(ap, op);
-	switch (op) {
-	case SQLITE_DBCONFIG_LOOKASIDE:{
-			void *pBuf = va_arg(ap, void *);	/* IMP: R-26835-10964 */
-			int sz = va_arg(ap, int);	/* IMP: R-47871-25994 */
-			int cnt = va_arg(ap, int);	/* IMP: R-04460-53386 */
-			rc = setupLookaside(db, pBuf, sz, cnt);
-			break;
-		}
-	default:{
-			static const struct {
-				int op;	/* The opcode */
-				u32 mask;	/* Mask of the bit in sqlite3.flags to set/clear */
-			} aFlagOp[] = {
-				{
-				SQLITE_DBCONFIG_ENABLE_FKEY,
-					    SQLITE_ForeignKeys}, {
-				SQLITE_DBCONFIG_ENABLE_TRIGGER,
-					    SQLITE_EnableTrigger}, {
-			SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE,
-					    SQLITE_NoCkptOnClose},};
-			unsigned int i;
-			rc = SQLITE_ERROR;	/* IMP: R-42790-23372 */
-			for (i = 0; i < ArraySize(aFlagOp); i++) {
-				if (aFlagOp[i].op == op) {
-					int onoff = va_arg(ap, int);
-					int *pRes = va_arg(ap, int *);
-					uint32_t oldFlags =
-					    user_session->sql_flags;
-					if (onoff > 0) {
-						user_session->sql_flags |=
-						    aFlagOp[i].mask;
-					} else if (onoff == 0) {
-						user_session->sql_flags &=
-						    ~aFlagOp[i].mask;
-					}
-					if (oldFlags != user_session->sql_flags) {
-						sqlite3ExpirePreparedStatements
-						    (db);
-					}
-					if (pRes) {
-						*pRes =
-						    (user_session->
-						     sql_flags & aFlagOp[i].
-						     mask) != 0;
-					}
-					rc = SQLITE_OK;
-					break;
-				}
-			}
-			break;
-		}
-	}
-	va_end(ap);
-	return rc;
-}
-
 /*
  * Return the number of changes in the most recent call to sqlite3_exec().
  */
@@ -712,12 +613,6 @@ sqlite3_close(sqlite3 * db)
 	return sqlite3Close(db, 0);
 }
 
-int
-sqlite3_close_v2(sqlite3 * db)
-{
-	return sqlite3Close(db, 1);
-}
-
 /*
  * Rollback all database files.  If tripCode is not SQLITE_OK, then
  * any write cursors are invalidated ("tripped" - as in "tripping a circuit
@@ -736,192 +631,6 @@ sqlite3RollbackAll(Vdbe * pVdbe)
 	}
 }
 
-/*
- * Return a static string containing the name corresponding to the error code
- * specified in the argument.
- */
-#if defined(SQLITE_NEED_ERR_NAME)
-const char *
-sqlite3ErrName(int rc)
-{
-	const char *zName = 0;
-	int i, origRc = rc;
-	for (i = 0; i < 2 && zName == 0; i++, rc &= 0xff) {
-		switch (rc) {
-		case SQLITE_OK:
-			zName = "SQLITE_OK";
-			break;
-		case SQLITE_ERROR:
-			zName = "SQLITE_ERROR";
-			break;
-		case SQLITE_PERM:
-			zName = "SQLITE_PERM";
-			break;
-		case SQLITE_ABORT:
-			zName = "SQLITE_ABORT";
-			break;
-		case SQLITE_BUSY:
-			zName = "SQLITE_BUSY";
-			break;
-		case SQLITE_LOCKED:
-			zName = "SQLITE_LOCKED";
-			break;
-		case SQLITE_NOMEM:
-			zName = "SQLITE_NOMEM";
-			break;
-		case SQLITE_INTERRUPT:
-			zName = "SQLITE_INTERRUPT";
-			break;
-		case SQLITE_IOERR:
-			zName = "SQLITE_IOERR";
-			break;
-		case SQLITE_IOERR_READ:
-			zName = "SQLITE_IOERR_READ";
-			break;
-		case SQLITE_IOERR_SHORT_READ:
-			zName = "SQLITE_IOERR_SHORT_READ";
-			break;
-		case SQLITE_IOERR_WRITE:
-			zName = "SQLITE_IOERR_WRITE";
-			break;
-		case SQLITE_IOERR_FSYNC:
-			zName = "SQLITE_IOERR_FSYNC";
-			break;
-		case SQLITE_IOERR_DIR_FSYNC:
-			zName = "SQLITE_IOERR_DIR_FSYNC";
-			break;
-		case SQLITE_IOERR_TRUNCATE:
-			zName = "SQLITE_IOERR_TRUNCATE";
-			break;
-		case SQLITE_IOERR_FSTAT:
-			zName = "SQLITE_IOERR_FSTAT";
-			break;
-		case SQLITE_IOERR_UNLOCK:
-			zName = "SQLITE_IOERR_UNLOCK";
-			break;
-		case SQLITE_IOERR_RDLOCK:
-			zName = "SQLITE_IOERR_RDLOCK";
-			break;
-		case SQLITE_IOERR_DELETE:
-			zName = "SQLITE_IOERR_DELETE";
-			break;
-		case SQLITE_IOERR_NOMEM:
-			zName = "SQLITE_IOERR_NOMEM";
-			break;
-		case SQLITE_IOERR_ACCESS:
-			zName = "SQLITE_IOERR_ACCESS";
-			break;
-		case SQLITE_IOERR_CHECKRESERVEDLOCK:
-			zName = "SQLITE_IOERR_CHECKRESERVEDLOCK";
-			break;
-		case SQLITE_IOERR_LOCK:
-			zName = "SQLITE_IOERR_LOCK";
-			break;
-		case SQLITE_IOERR_CLOSE:
-			zName = "SQLITE_IOERR_CLOSE";
-			break;
-		case SQLITE_IOERR_DIR_CLOSE:
-			zName = "SQLITE_IOERR_DIR_CLOSE";
-			break;
-		case SQLITE_IOERR_SHMOPEN:
-			zName = "SQLITE_IOERR_SHMOPEN";
-			break;
-		case SQLITE_IOERR_SHMSIZE:
-			zName = "SQLITE_IOERR_SHMSIZE";
-			break;
-		case SQLITE_IOERR_SHMLOCK:
-			zName = "SQLITE_IOERR_SHMLOCK";
-			break;
-		case SQLITE_IOERR_SHMMAP:
-			zName = "SQLITE_IOERR_SHMMAP";
-			break;
-		case SQLITE_IOERR_SEEK:
-			zName = "SQLITE_IOERR_SEEK";
-			break;
-		case SQLITE_IOERR_DELETE_NOENT:
-			zName = "SQLITE_IOERR_DELETE_NOENT";
-			break;
-		case SQLITE_IOERR_MMAP:
-			zName = "SQLITE_IOERR_MMAP";
-			break;
-		case SQLITE_IOERR_GETTEMPPATH:
-			zName = "SQLITE_IOERR_GETTEMPPATH";
-			break;
-		case SQLITE_IOERR_CONVPATH:
-			zName = "SQLITE_IOERR_CONVPATH";
-			break;
-		case SQLITE_NOTFOUND:
-			zName = "SQLITE_NOTFOUND";
-			break;
-		case SQLITE_FULL:
-			zName = "SQLITE_FULL";
-			break;
-		case SQLITE_CANTOPEN:
-			zName = "SQLITE_CANTOPEN";
-			break;
-		case SQLITE_SCHEMA:
-			zName = "SQLITE_SCHEMA";
-			break;
-		case SQLITE_TOOBIG:
-			zName = "SQLITE_TOOBIG";
-			break;
-		case SQLITE_CONSTRAINT:
-			zName = "SQLITE_CONSTRAINT";
-			break;
-		case SQLITE_CONSTRAINT_UNIQUE:
-			zName = "SQLITE_CONSTRAINT_UNIQUE";
-			break;
-		case SQLITE_CONSTRAINT_TRIGGER:
-			zName = "SQLITE_CONSTRAINT_TRIGGER";
-			break;
-		case SQLITE_CONSTRAINT_FOREIGNKEY:
-			zName = "SQLITE_CONSTRAINT_FOREIGNKEY";
-			break;
-		case SQLITE_CONSTRAINT_CHECK:
-			zName = "SQLITE_CONSTRAINT_CHECK";
-			break;
-		case SQLITE_CONSTRAINT_PRIMARYKEY:
-			zName = "SQLITE_CONSTRAINT_PRIMARYKEY";
-			break;
-		case SQLITE_CONSTRAINT_NOTNULL:
-			zName = "SQLITE_CONSTRAINT_NOTNULL";
-			break;
-		case SQLITE_CONSTRAINT_FUNCTION:
-			zName = "SQLITE_CONSTRAINT_FUNCTION";
-			break;
-		case SQLITE_MISMATCH:
-			zName = "SQLITE_MISMATCH";
-			break;
-		case SQLITE_MISUSE:
-			zName = "SQLITE_MISUSE";
-			break;
-		case SQLITE_RANGE:
-			zName = "SQLITE_RANGE";
-			break;
-		case SQL_TARANTOOL_ERROR:
-			zName = "SQLITE_TARANTOOL_ERROR";
-			break;
-		case SQLITE_ROW:
-			zName = "SQLITE_ROW";
-			break;
-		case SQLITE_WARNING:
-			zName = "SQLITE_WARNING";
-			break;
-		case SQLITE_DONE:
-			zName = "SQLITE_DONE";
-			break;
-		}
-	}
-	if (zName == 0) {
-		static char zBuf[50];
-		sqlite3_snprintf(sizeof(zBuf), zBuf, "SQLITE_UNKNOWN(%d)",
-				 origRc);
-		zName = zBuf;
-	}
-	return zName;
-}
-#endif
-
 /*
  * Return a static string that describes the kind of error specified in the
  * argument.
diff --git a/src/box/sql/sqliteInt.h b/src/box/sql/sqliteInt.h
index 53188e74d..e9c15dbb3 100644
--- a/src/box/sql/sqliteInt.h
+++ b/src/box/sql/sqliteInt.h
@@ -284,17 +284,6 @@ void sqlite3Coverage(int);
 #define NEVER(X)       (X)
 #endif
 
-/*
- * Is the sqlite3ErrName() function needed in the build?  Currently,
- * it is needed by several "test*.c" files (which are
- * compiled using SQLITE_TEST).
- */
-#if defined(SQLITE_TEST)
-#define SQLITE_NEED_ERR_NAME
-#else
-#undef  SQLITE_NEED_ERR_NAME
-#endif
-
 /*
  * Return true (non-zero) if the input is an integer that is too large
  * to fit in 32-bits.  This macro is used inside of various testcase()
@@ -4276,10 +4265,6 @@ void sqlite3SystemError(sqlite3 *, int);
 void *sqlite3HexToBlob(sqlite3 *, const char *z, int n);
 u8 sqlite3HexToInt(int h);
 
-#if defined(SQLITE_NEED_ERR_NAME)
-const char *sqlite3ErrName(int);
-#endif
-
 const char *sqlite3ErrStr(int);
 
 /**
-- 
2.14.1

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [tarantool-patches] [PATCH 2/3] sql: delete foreign_keys pragma
  2018-10-02 10:48 [tarantool-patches] [PATCH 0/3] Delete foreign_keys and ignore_check_constraints pragmas AKhatskevich
  2018-10-02 10:48 ` [tarantool-patches] [PATCH 1/3] sql: delete unused code AKhatskevich
@ 2018-10-02 10:48 ` AKhatskevich
  2018-10-02 13:36   ` [tarantool-patches] " n.pettik
  2018-10-02 10:48 ` [tarantool-patches] [PATCH 3/3] sql: delete ignore_check_constraints pragma AKhatskevich
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: AKhatskevich @ 2018-10-02 10:48 UTC (permalink / raw)
  To: korablev, tarantool-patches

Part of #3696
---
 src/box/sql.c                             |  3 +--
 src/box/sql/CMakeLists.txt                |  1 -
 src/box/sql/fkey.c                        | 21 ++++-----------------
 src/box/sql/insert.c                      |  3 +--
 src/box/sql/pragma.h                      |  7 -------
 src/box/sql/sqliteInt.h                   |  2 +-
 test/sql-tap/tkt-b1d3a2e531.test.lua      |  8 +-------
 test/sql-tap/triggerC.test.lua            |  5 +----
 test/sql/transitive-transactions.result   |  3 ---
 test/sql/transitive-transactions.test.lua |  1 -
 10 files changed, 9 insertions(+), 45 deletions(-)

diff --git a/src/box/sql.c b/src/box/sql.c
index ab4a587a5..a9077dd32 100644
--- a/src/box/sql.c
+++ b/src/box/sql.c
@@ -59,8 +59,7 @@ static const char nil_key[] = { 0x90 }; /* Empty MsgPack array. */
 static const uint32_t default_sql_flags = SQLITE_ShortColNames
 					  | SQLITE_EnableTrigger
 					  | SQLITE_AutoIndex
-					  | SQLITE_RecTriggers
-					  | SQLITE_ForeignKeys;
+					  | SQLITE_RecTriggers;
 
 void
 sql_init()
diff --git a/src/box/sql/CMakeLists.txt b/src/box/sql/CMakeLists.txt
index 1f852424a..aa57add59 100644
--- a/src/box/sql/CMakeLists.txt
+++ b/src/box/sql/CMakeLists.txt
@@ -16,7 +16,6 @@ include_directories(${SQL_SRC_DIR})
 include_directories(${SQL_BIN_DIR})
 
 add_definitions(-DSQLITE_MAX_WORKER_THREADS=0)
-add_definitions(-DSQLITE_DEFAULT_FOREIGN_KEYS=1)
 add_definitions(-DSQLITE_OMIT_AUTOMATIC_INDEX)
 
 set(TEST_DEFINITIONS
diff --git a/src/box/sql/fkey.c b/src/box/sql/fkey.c
index b2d2a19e7..091778fc8 100644
--- a/src/box/sql/fkey.c
+++ b/src/box/sql/fkey.c
@@ -527,12 +527,6 @@ fkey_emit_check(struct Parse *parser, struct Table *tab, int reg_old,
 	 */
 	assert((reg_old == 0) != (reg_new == 0));
 
-	/*
-	 * If foreign-keys are disabled, this function is a no-op.
-	 */
-	if ((user_session->sql_flags & SQLITE_ForeignKeys) == 0)
-		return;
-
 	/*
 	 * Loop through all the foreign key constraints for which
 	 * tab is the child table.
@@ -674,9 +668,6 @@ fkey_emit_check(struct Parse *parser, struct Table *tab, int reg_old,
 bool
 fkey_is_required(uint32_t space_id, const int *changes)
 {
-	struct session *user_session = current_session();
-	if ((user_session->sql_flags & SQLITE_ForeignKeys) == 0)
-		return false;
 	struct space *space = space_by_id(space_id);
 	if (changes == NULL) {
 		/*
@@ -919,16 +910,12 @@ void
 fkey_emit_actions(struct Parse *parser, struct Table *tab, int reg_old,
 		  const int *changes)
 {
-	struct session *user_session = current_session();
 	/*
-	 * If foreign-key support is enabled, iterate through all
-	 * FKs that refer to table tab. If there is an action
-	 * associated with the FK for this operation (either
-	 * update or delete), invoke the associated trigger
-	 * sub-program.
+	 * Iterate through all FKs that refer to table tab.
+	 * If there is an action associated with the FK for
+	 * this operation (either update or delete),
+	 * invoke the associated trigger sub-program.
 	 */
-	if ((user_session->sql_flags & SQLITE_ForeignKeys) == 0)
-		return;
 	struct space *space = space_by_id(tab->def->id);
 	assert(space != NULL);
 	struct fkey *fk;
diff --git a/src/box/sql/insert.c b/src/box/sql/insert.c
index 03f4e1b14..c696f39f1 100644
--- a/src/box/sql/insert.c
+++ b/src/box/sql/insert.c
@@ -1278,8 +1278,7 @@ xferOptimization(Parse * pParse,	/* Parser context */
 	 * So the extra complication to make this rule less restrictive is probably
 	 * not worth the effort.  Ticket [6284df89debdfa61db8073e062908af0c9b6118e]
 	 */
-	if ((user_session->sql_flags & SQLITE_ForeignKeys) != 0 &&
-	    !rlist_empty(&dest->child_fkey))
+	if (!rlist_empty(&dest->child_fkey))
 		return 0;
 	if ((user_session->sql_flags & SQLITE_CountRows) != 0) {
 		return 0;	/* xfer opt does not play well with PRAGMA count_changes */
diff --git a/src/box/sql/pragma.h b/src/box/sql/pragma.h
index ecc9ee879..c135202d4 100644
--- a/src/box/sql/pragma.h
+++ b/src/box/sql/pragma.h
@@ -135,13 +135,6 @@ static const PragmaName aPragmaName[] = {
 	 PragFlg_NeedSchema | PragFlg_Result1 | PragFlg_SchemaOpt,
 	 /* ColNames:  */ 29, 8,
 	 /* iArg:      */ 0},
-#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
-	{ /* zName:     */ "foreign_keys",
-	 /* ePragTyp:  */ PragTyp_FLAG,
-	 /* ePragFlg:  */ PragFlg_Result0 | PragFlg_NoColumns1,
-	 /* ColNames:  */ 0, 0,
-	 /* iArg:      */ SQLITE_ForeignKeys},
-#endif
 #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
 	{ /* zName:     */ "full_column_names",
 	 /* ePragTyp:  */ PragTyp_FLAG,
diff --git a/src/box/sql/sqliteInt.h b/src/box/sql/sqliteInt.h
index e9c15dbb3..b2d527834 100644
--- a/src/box/sql/sqliteInt.h
+++ b/src/box/sql/sqliteInt.h
@@ -1562,7 +1562,7 @@ struct sqlite3 {
 #define SQLITE_ReadUncommitted 0x0004000	/* For shared-cache mode */
 #define SQLITE_ReverseOrder   0x00020000	/* Reverse unordered SELECTs */
 #define SQLITE_RecTriggers    0x00040000	/* Enable recursive triggers */
-#define SQLITE_ForeignKeys    0x00080000	/* Enforce foreign key constraints  */
+/*                            0x00080000	   Free bit */
 #define SQLITE_AutoIndex      0x00100000	/* Enable automatic indexes */
 #define SQLITE_PreferBuiltin  0x00200000	/* Preference to built-in funcs */
 #define SQLITE_EnableTrigger  0x01000000	/* True to enable triggers */
diff --git a/test/sql-tap/tkt-b1d3a2e531.test.lua b/test/sql-tap/tkt-b1d3a2e531.test.lua
index 85b0f46d7..324ffa0c8 100755
--- a/test/sql-tap/tkt-b1d3a2e531.test.lua
+++ b/test/sql-tap/tkt-b1d3a2e531.test.lua
@@ -1,6 +1,6 @@
 #!/usr/bin/env tarantool
 test = require("sqltester")
-test:plan(12)
+test:plan(11)
 
 --!./tcltestrunner.lua
 -- 2011 August 22
@@ -24,12 +24,6 @@ test:plan(12)
 
 testprefix = "tkt-b1d3a2e531"
 
-test:do_execsql_test(
-    1.0,
-    [[
-        PRAGMA foreign_keys = 'ON'
-    ]])
-
 test:do_execsql_test(
     1.1,
     [[
diff --git a/test/sql-tap/triggerC.test.lua b/test/sql-tap/triggerC.test.lua
index 06e6e5bd2..d5fdc1470 100755
--- a/test/sql-tap/triggerC.test.lua
+++ b/test/sql-tap/triggerC.test.lua
@@ -1146,12 +1146,10 @@ test:do_execsql_test(
 test:do_execsql_test(
     "triggerC-15.1.1",
     [[
-        -- test is not respects fk
-        PRAGMA foreign_keys='false';
         PRAGMA recursive_triggers = 1;
         CREATE TABLE node(
             id not null primary key,
-            pid int not null default 0 references node,
+            pid int not null default 0,
             key varchar not null,
             path varchar default '',
             unique(pid, key)
@@ -1170,7 +1168,6 @@ test:do_execsql_test(
         INSERT INTO node(id, pid, key) VALUES(900, 90, 'test2');
         DELETE FROM node WHERE id=9;
         SELECT * FROM node;
-        PRAGMA foreign_keys='true';
     ]])
 
 -- Tarantool: such indentifiers are not working
diff --git a/test/sql/transitive-transactions.result b/test/sql/transitive-transactions.result
index a01b1d0b0..88685b4c1 100644
--- a/test/sql/transitive-transactions.result
+++ b/test/sql/transitive-transactions.result
@@ -27,9 +27,6 @@ box.sql.execute('START TRANSACTION;') box.commit();
 box.sql.execute('START TRANSACTION;') box.rollback();
 ---
 ...
-box.sql.execute('pragma foreign_keys = 1;');
----
-...
 box.sql.execute('CREATE TABLE parent(id INT PRIMARY KEY, y INT UNIQUE);');
 ---
 ...
diff --git a/test/sql/transitive-transactions.test.lua b/test/sql/transitive-transactions.test.lua
index 1ac2b8d64..5127202e3 100644
--- a/test/sql/transitive-transactions.test.lua
+++ b/test/sql/transitive-transactions.test.lua
@@ -13,7 +13,6 @@ box.begin() box.sql.execute('ROLLBACK');
 box.sql.execute('START TRANSACTION;') box.commit();
 box.sql.execute('START TRANSACTION;') box.rollback();
 
-box.sql.execute('pragma foreign_keys = 1;');
 box.sql.execute('CREATE TABLE parent(id INT PRIMARY KEY, y INT UNIQUE);');
 box.sql.execute('CREATE TABLE child(id INT PRIMARY KEY, x INT REFERENCES parent(y) DEFERRABLE INITIALLY DEFERRED);');
 
-- 
2.14.1

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [tarantool-patches] [PATCH 3/3] sql: delete ignore_check_constraints pragma
  2018-10-02 10:48 [tarantool-patches] [PATCH 0/3] Delete foreign_keys and ignore_check_constraints pragmas AKhatskevich
  2018-10-02 10:48 ` [tarantool-patches] [PATCH 1/3] sql: delete unused code AKhatskevich
  2018-10-02 10:48 ` [tarantool-patches] [PATCH 2/3] sql: delete foreign_keys pragma AKhatskevich
@ 2018-10-02 10:48 ` AKhatskevich
  2018-10-02 13:36   ` [tarantool-patches] " n.pettik
  2018-10-04 16:27 ` [tarantool-patches] Re: [PATCH 0/3] Delete foreign_keys and ignore_check_constraints pragmas n.pettik
  2018-10-05  7:15 ` Kirill Yukhin
  4 siblings, 1 reply; 12+ messages in thread
From: AKhatskevich @ 2018-10-02 10:48 UTC (permalink / raw)
  To: korablev, tarantool-patches

Closes #3696
---
 src/box/sql/insert.c        |  4 +---
 src/box/sql/pragma.h        |  7 -------
 src/box/sql/sqliteInt.h     |  2 +-
 test/sql-tap/check.test.lua | 15 +--------------
 4 files changed, 3 insertions(+), 25 deletions(-)

diff --git a/src/box/sql/insert.c b/src/box/sql/insert.c
index c696f39f1..475f88a14 100644
--- a/src/box/sql/insert.c
+++ b/src/box/sql/insert.c
@@ -853,7 +853,6 @@ vdbe_emit_constraint_checks(struct Parse *parse_context, struct Table *tab,
 			    enum on_conflict_action on_conflict,
 			    int ignore_label, int *upd_cols)
 {
-	struct session *user_session = current_session();
 	struct sqlite3 *db = parse_context->db;
 	struct Vdbe *v = sqlite3GetVdbe(parse_context);
 	assert(v != NULL);
@@ -927,8 +926,7 @@ vdbe_emit_constraint_checks(struct Parse *parse_context, struct Table *tab,
 	enum on_conflict_action on_conflict_check = on_conflict;
 	if (on_conflict == ON_CONFLICT_ACTION_REPLACE)
 		on_conflict_check = ON_CONFLICT_ACTION_ABORT;
-	if (checks != NULL &&
-	    (user_session->sql_flags & SQLITE_IgnoreChecks) == 0) {
+	if (checks != NULL) {
 		parse_context->ckBase = new_tuple_reg;
 		for (int i = 0; i < checks->nExpr; i++) {
 			struct Expr *expr = checks->a[i].pExpr;
diff --git a/src/box/sql/pragma.h b/src/box/sql/pragma.h
index c135202d4..18a05539e 100644
--- a/src/box/sql/pragma.h
+++ b/src/box/sql/pragma.h
@@ -142,13 +142,6 @@ static const PragmaName aPragmaName[] = {
 	 /* ColNames:  */ 0, 0,
 	 /* iArg:      */ SQLITE_FullColNames},
 #endif
-#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
-	{ /* zName:     */ "ignore_check_constraints",
-	 /* ePragTyp:  */ PragTyp_FLAG,
-	 /* ePragFlg:  */ PragFlg_Result0 | PragFlg_NoColumns1,
-	 /* ColNames:  */ 0, 0,
-	 /* iArg:      */ SQLITE_IgnoreChecks},
-#endif
 #if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
 	{ /* zName:     */ "index_info",
 	 /* ePragTyp:  */ PragTyp_INDEX_INFO,
diff --git a/src/box/sql/sqliteInt.h b/src/box/sql/sqliteInt.h
index b2d527834..8883d37ad 100644
--- a/src/box/sql/sqliteInt.h
+++ b/src/box/sql/sqliteInt.h
@@ -1558,7 +1558,7 @@ struct sqlite3 {
 #define SQLITE_WhereTrace     0x00008000       /* Debug info about optimizer's work */
 #define SQLITE_VdbeListing    0x00000400	/* Debug listings of VDBE programs */
 #define SQLITE_VdbeAddopTrace 0x00001000	/* Trace sqlite3VdbeAddOp() calls */
-#define SQLITE_IgnoreChecks   0x00002000	/* Do not enforce check constraints */
+/*                            0x00002000	   Free bit */
 #define SQLITE_ReadUncommitted 0x0004000	/* For shared-cache mode */
 #define SQLITE_ReverseOrder   0x00020000	/* Reverse unordered SELECTs */
 #define SQLITE_RecTriggers    0x00040000	/* Enable recursive triggers */
diff --git a/test/sql-tap/check.test.lua b/test/sql-tap/check.test.lua
index f03ac7b4f..6c81fc523 100755
--- a/test/sql-tap/check.test.lua
+++ b/test/sql-tap/check.test.lua
@@ -1,6 +1,6 @@
 #!/usr/bin/env tarantool
 test = require("sqltester")
-test:plan(61)
+test:plan(60)
 
 --!./tcltestrunner.lua
 -- 2005 November 2
@@ -524,22 +524,9 @@ test:do_execsql_test(
         -- </check-4.7>
     })
 
-test:do_execsql_test(
-    "check-4.8",
-    [[
-        PRAGMA ignore_check_constraints='ON';
-        UPDATE t4 SET x=0, y=1;
-        SELECT * FROM t4;
-    ]], {
-        -- <check-4.8>
-        0, 1
-        -- </check-4.8>
-    })
-
 test:do_catchsql_test(
     "check-4.9",
     [[
-        PRAGMA ignore_check_constraints='OFF';
         UPDATE t4 SET x=0, y=2;
     ]], {
         -- <check-4.9>
-- 
2.14.1

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [tarantool-patches] Re: [PATCH 1/3] sql: delete unused code
  2018-10-02 10:48 ` [tarantool-patches] [PATCH 1/3] sql: delete unused code AKhatskevich
@ 2018-10-02 13:36   ` n.pettik
  2018-10-04 15:16     ` Alex Khatskevich
  0 siblings, 1 reply; 12+ messages in thread
From: n.pettik @ 2018-10-02 13:36 UTC (permalink / raw)
  To: tarantool-patches; +Cc: Alex Khatskevich


> diff --git a/src/box/sql/main.c b/src/box/sql/main.c
> index 782f99452..3a01f1207 100644
> --- a/src/box/sql/main.c
> +++ b/src/box/sql/main.c
> @@ -483,105 +483,6 @@ setupLookaside(sqlite3 * db, void *pBuf, int sz, int cnt)
> 	return SQLITE_OK;
> }
> 
> -/*
> - * Free up as much memory as we can from the given database
> - * connection.
> - */
> -int
> -sqlite3_db_release_memory(sqlite3 * db)

You forgot to delete function declaration from sqliteInt.h

> @@ -712,12 +613,6 @@ sqlite3_close(sqlite3 * db)
> 	return sqlite3Close(db, 0);
> }
> 
> -int
> -sqlite3_close_v2(sqlite3 * db)
> -{
> -	return sqlite3Close(db, 1);
> -}

You deleted not all mentions of sqlite3_close_v2(), just grep it.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [tarantool-patches] Re: [PATCH 2/3] sql: delete foreign_keys pragma
  2018-10-02 10:48 ` [tarantool-patches] [PATCH 2/3] sql: delete foreign_keys pragma AKhatskevich
@ 2018-10-02 13:36   ` n.pettik
  2018-10-04 15:16     ` Alex Khatskevich
  0 siblings, 1 reply; 12+ messages in thread
From: n.pettik @ 2018-10-02 13:36 UTC (permalink / raw)
  To: tarantool-patches; +Cc: Alex Khatskevich


> diff --git a/src/box/sql/sqliteInt.h b/src/box/sql/sqliteInt.h
> index e9c15dbb3..b2d527834 100644
> --- a/src/box/sql/sqliteInt.h
> +++ b/src/box/sql/sqliteInt.h
> @@ -1562,7 +1562,7 @@ struct sqlite3 {
> #define SQLITE_ReadUncommitted 0x0004000	/* For shared-cache mode */
> #define SQLITE_ReverseOrder   0x00020000	/* Reverse unordered SELECTs */
> #define SQLITE_RecTriggers    0x00040000	/* Enable recursive triggers */
> -#define SQLITE_ForeignKeys    0x00080000	/* Enforce foreign key constraints  */
> +/*                            0x00080000	   Free bit */

Don’t do this. It is easy to check that this bit is really free manually.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [tarantool-patches] Re: [PATCH 3/3] sql: delete ignore_check_constraints pragma
  2018-10-02 10:48 ` [tarantool-patches] [PATCH 3/3] sql: delete ignore_check_constraints pragma AKhatskevich
@ 2018-10-02 13:36   ` n.pettik
  2018-10-04 15:16     ` Alex Khatskevich
  0 siblings, 1 reply; 12+ messages in thread
From: n.pettik @ 2018-10-02 13:36 UTC (permalink / raw)
  To: tarantool-patches; +Cc: Alex Khatskevich


> diff --git a/src/box/sql/sqliteInt.h b/src/box/sql/sqliteInt.h
> index b2d527834..8883d37ad 100644
> --- a/src/box/sql/sqliteInt.h
> +++ b/src/box/sql/sqliteInt.h
> @@ -1558,7 +1558,7 @@ struct sqlite3 {
> #define SQLITE_WhereTrace     0x00008000       /* Debug info about optimizer's work */
> #define SQLITE_VdbeListing    0x00000400	/* Debug listings of VDBE programs */
> #define SQLITE_VdbeAddopTrace 0x00001000	/* Trace sqlite3VdbeAddOp() calls */
> -#define SQLITE_IgnoreChecks   0x00002000	/* Do not enforce check constraints */
> +/*                            0x00002000	   Free bit */

The same: don’t do it. Lets simply delete this flag.

The rest is OK.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [tarantool-patches] Re: [PATCH 1/3] sql: delete unused code
  2018-10-02 13:36   ` [tarantool-patches] " n.pettik
@ 2018-10-04 15:16     ` Alex Khatskevich
  0 siblings, 0 replies; 12+ messages in thread
From: Alex Khatskevich @ 2018-10-04 15:16 UTC (permalink / raw)
  To: n.pettik, tarantool-patches



On 02.10.2018 16:36, n.pettik wrote:
> You forgot to delete function declaration from sqliteInt.h
> You deleted not all mentions of sqlite3_close_v2(), just grep it.
Fixed.
Full diff:

commit 253c0d51310c5684da94862bb7f8723cf726b0c2
Author: AKhatskevich <avkhatskevich@tarantool.org>
Date:   Mon Oct 1 14:19:57 2018 +0300

     sql: delete unused code

     Part of #3696

diff --git a/src/box/sql/main.c b/src/box/sql/main.c
index 782f99452..86e9bcfcd 100644
--- a/src/box/sql/main.c
+++ b/src/box/sql/main.c
@@ -483,105 +483,6 @@ setupLookaside(sqlite3 * db, void *pBuf, int sz, 
int cnt)
      return SQLITE_OK;
  }

-/*
- * Free up as much memory as we can from the given database
- * connection.
- */
-int
-sqlite3_db_release_memory(sqlite3 * db)
-{
-    (void)db;
-#ifdef SQLITE_ENABLE_API_ARMOR
-    if (!sqlite3SafetyCheckOk(db))
-        return SQLITE_MISUSE_BKPT;
-#endif
-    return SQLITE_OK;
-}
-
-/*
- * Flush any dirty pages in the pager-cache for any attached database
- * to disk.
- */
-int
-sqlite3_db_cacheflush(sqlite3 * db)
-{
-    int rc = SQLITE_OK;
-    int bSeenBusy = 0;
-    (void)db;
-#ifdef SQLITE_ENABLE_API_ARMOR
-    if (!sqlite3SafetyCheckOk(db))
-        return SQLITE_MISUSE_BKPT;
-#endif
-    return ((rc == SQLITE_OK && bSeenBusy) ? SQLITE_BUSY : rc);
-}
-
-/*
- * Configuration settings for an individual database connection
- */
-int
-sqlite3_db_config(sqlite3 * db, int op, ...)
-{
-    va_list ap;
-    int rc;
-    struct session *user_session = current_session();
-
-    va_start(ap, op);
-    switch (op) {
-    case SQLITE_DBCONFIG_LOOKASIDE:{
-            void *pBuf = va_arg(ap, void *);    /* IMP: R-26835-10964 */
-            int sz = va_arg(ap, int);    /* IMP: R-47871-25994 */
-            int cnt = va_arg(ap, int);    /* IMP: R-04460-53386 */
-            rc = setupLookaside(db, pBuf, sz, cnt);
-            break;
-        }
-    default:{
-            static const struct {
-                int op;    /* The opcode */
-                u32 mask;    /* Mask of the bit in sqlite3.flags to 
set/clear */
-            } aFlagOp[] = {
-                {
-                SQLITE_DBCONFIG_ENABLE_FKEY,
-                        SQLITE_ForeignKeys}, {
-                SQLITE_DBCONFIG_ENABLE_TRIGGER,
-                        SQLITE_EnableTrigger}, {
-            SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE,
-                        SQLITE_NoCkptOnClose},};
-            unsigned int i;
-            rc = SQLITE_ERROR;    /* IMP: R-42790-23372 */
-            for (i = 0; i < ArraySize(aFlagOp); i++) {
-                if (aFlagOp[i].op == op) {
-                    int onoff = va_arg(ap, int);
-                    int *pRes = va_arg(ap, int *);
-                    uint32_t oldFlags =
-                        user_session->sql_flags;
-                    if (onoff > 0) {
-                        user_session->sql_flags |=
-                            aFlagOp[i].mask;
-                    } else if (onoff == 0) {
-                        user_session->sql_flags &=
-                            ~aFlagOp[i].mask;
-                    }
-                    if (oldFlags != user_session->sql_flags) {
-                        sqlite3ExpirePreparedStatements
-                            (db);
-                    }
-                    if (pRes) {
-                        *pRes =
-                            (user_session->
-                             sql_flags & aFlagOp[i].
-                             mask) != 0;
-                    }
-                    rc = SQLITE_OK;
-                    break;
-                }
-            }
-            break;
-        }
-    }
-    va_end(ap);
-    return rc;
-}
-
  /*
   * Return the number of changes in the most recent call to sqlite3_exec().
   */
@@ -660,12 +561,7 @@ connectionIsBusy(sqlite3 * db)
  static int
  sqlite3Close(sqlite3 * db, int forceZombie)
  {
-    if (!db) {
-        /* EVIDENCE-OF: R-63257-11740 Calling sqlite3_close() or
-         * sqlite3_close_v2() with a NULL pointer argument is a 
harmless no-op.
-         */
-        return SQLITE_OK;
-    }
+    assert(db);
      if (!sqlite3SafetyCheckSickOrOk(db)) {
          return SQLITE_MISUSE_BKPT;
      }
@@ -701,10 +597,7 @@ sqlite3Close(sqlite3 * db, int forceZombie)
   * Two variations on the public interface for closing a database
   * connection. The sqlite3_close() version returns SQLITE_BUSY and
   * leaves the connection option if there are unfinalized prepared
- * statements.  The sqlite3_close_v2()
- * version forces the connection to become a zombie if there are
- * unclosed resources, and arranges for deallocation when the last
- * prepare statement.
+ * statements.
   */
  int
  sqlite3_close(sqlite3 * db)
@@ -712,12 +605,6 @@ sqlite3_close(sqlite3 * db)
      return sqlite3Close(db, 0);
  }

-int
-sqlite3_close_v2(sqlite3 * db)
-{
-    return sqlite3Close(db, 1);
-}
-
  /*
   * Rollback all database files.  If tripCode is not SQLITE_OK, then
   * any write cursors are invalidated ("tripped" - as in "tripping a 
circuit
@@ -736,192 +623,6 @@ sqlite3RollbackAll(Vdbe * pVdbe)
      }
  }

-/*
- * Return a static string containing the name corresponding to the 
error code
- * specified in the argument.
- */
-#if defined(SQLITE_NEED_ERR_NAME)
-const char *
-sqlite3ErrName(int rc)
-{
-    const char *zName = 0;
-    int i, origRc = rc;
-    for (i = 0; i < 2 && zName == 0; i++, rc &= 0xff) {
-        switch (rc) {
-        case SQLITE_OK:
-            zName = "SQLITE_OK";
-            break;
-        case SQLITE_ERROR:
-            zName = "SQLITE_ERROR";
-            break;
-        case SQLITE_PERM:
-            zName = "SQLITE_PERM";
-            break;
-        case SQLITE_ABORT:
-            zName = "SQLITE_ABORT";
-            break;
-        case SQLITE_BUSY:
-            zName = "SQLITE_BUSY";
-            break;
-        case SQLITE_LOCKED:
-            zName = "SQLITE_LOCKED";
-            break;
-        case SQLITE_NOMEM:
-            zName = "SQLITE_NOMEM";
-            break;
-        case SQLITE_INTERRUPT:
-            zName = "SQLITE_INTERRUPT";
-            break;
-        case SQLITE_IOERR:
-            zName = "SQLITE_IOERR";
-            break;
-        case SQLITE_IOERR_READ:
-            zName = "SQLITE_IOERR_READ";
-            break;
-        case SQLITE_IOERR_SHORT_READ:
-            zName = "SQLITE_IOERR_SHORT_READ";
-            break;
-        case SQLITE_IOERR_WRITE:
-            zName = "SQLITE_IOERR_WRITE";
-            break;
-        case SQLITE_IOERR_FSYNC:
-            zName = "SQLITE_IOERR_FSYNC";
-            break;
-        case SQLITE_IOERR_DIR_FSYNC:
-            zName = "SQLITE_IOERR_DIR_FSYNC";
-            break;
-        case SQLITE_IOERR_TRUNCATE:
-            zName = "SQLITE_IOERR_TRUNCATE";
-            break;
-        case SQLITE_IOERR_FSTAT:
-            zName = "SQLITE_IOERR_FSTAT";
-            break;
-        case SQLITE_IOERR_UNLOCK:
-            zName = "SQLITE_IOERR_UNLOCK";
-            break;
-        case SQLITE_IOERR_RDLOCK:
-            zName = "SQLITE_IOERR_RDLOCK";
-            break;
-        case SQLITE_IOERR_DELETE:
-            zName = "SQLITE_IOERR_DELETE";
-            break;
-        case SQLITE_IOERR_NOMEM:
-            zName = "SQLITE_IOERR_NOMEM";
-            break;
-        case SQLITE_IOERR_ACCESS:
-            zName = "SQLITE_IOERR_ACCESS";
-            break;
-        case SQLITE_IOERR_CHECKRESERVEDLOCK:
-            zName = "SQLITE_IOERR_CHECKRESERVEDLOCK";
-            break;
-        case SQLITE_IOERR_LOCK:
-            zName = "SQLITE_IOERR_LOCK";
-            break;
-        case SQLITE_IOERR_CLOSE:
-            zName = "SQLITE_IOERR_CLOSE";
-            break;
-        case SQLITE_IOERR_DIR_CLOSE:
-            zName = "SQLITE_IOERR_DIR_CLOSE";
-            break;
-        case SQLITE_IOERR_SHMOPEN:
-            zName = "SQLITE_IOERR_SHMOPEN";
-            break;
-        case SQLITE_IOERR_SHMSIZE:
-            zName = "SQLITE_IOERR_SHMSIZE";
-            break;
-        case SQLITE_IOERR_SHMLOCK:
-            zName = "SQLITE_IOERR_SHMLOCK";
-            break;
-        case SQLITE_IOERR_SHMMAP:
-            zName = "SQLITE_IOERR_SHMMAP";
-            break;
-        case SQLITE_IOERR_SEEK:
-            zName = "SQLITE_IOERR_SEEK";
-            break;
-        case SQLITE_IOERR_DELETE_NOENT:
-            zName = "SQLITE_IOERR_DELETE_NOENT";
-            break;
-        case SQLITE_IOERR_MMAP:
-            zName = "SQLITE_IOERR_MMAP";
-            break;
-        case SQLITE_IOERR_GETTEMPPATH:
-            zName = "SQLITE_IOERR_GETTEMPPATH";
-            break;
-        case SQLITE_IOERR_CONVPATH:
-            zName = "SQLITE_IOERR_CONVPATH";
-            break;
-        case SQLITE_NOTFOUND:
-            zName = "SQLITE_NOTFOUND";
-            break;
-        case SQLITE_FULL:
-            zName = "SQLITE_FULL";
-            break;
-        case SQLITE_CANTOPEN:
-            zName = "SQLITE_CANTOPEN";
-            break;
-        case SQLITE_SCHEMA:
-            zName = "SQLITE_SCHEMA";
-            break;
-        case SQLITE_TOOBIG:
-            zName = "SQLITE_TOOBIG";
-            break;
-        case SQLITE_CONSTRAINT:
-            zName = "SQLITE_CONSTRAINT";
-            break;
-        case SQLITE_CONSTRAINT_UNIQUE:
-            zName = "SQLITE_CONSTRAINT_UNIQUE";
-            break;
-        case SQLITE_CONSTRAINT_TRIGGER:
-            zName = "SQLITE_CONSTRAINT_TRIGGER";
-            break;
-        case SQLITE_CONSTRAINT_FOREIGNKEY:
-            zName = "SQLITE_CONSTRAINT_FOREIGNKEY";
-            break;
-        case SQLITE_CONSTRAINT_CHECK:
-            zName = "SQLITE_CONSTRAINT_CHECK";
-            break;
-        case SQLITE_CONSTRAINT_PRIMARYKEY:
-            zName = "SQLITE_CONSTRAINT_PRIMARYKEY";
-            break;
-        case SQLITE_CONSTRAINT_NOTNULL:
-            zName = "SQLITE_CONSTRAINT_NOTNULL";
-            break;
-        case SQLITE_CONSTRAINT_FUNCTION:
-            zName = "SQLITE_CONSTRAINT_FUNCTION";
-            break;
-        case SQLITE_MISMATCH:
-            zName = "SQLITE_MISMATCH";
-            break;
-        case SQLITE_MISUSE:
-            zName = "SQLITE_MISUSE";
-            break;
-        case SQLITE_RANGE:
-            zName = "SQLITE_RANGE";
-            break;
-        case SQL_TARANTOOL_ERROR:
-            zName = "SQLITE_TARANTOOL_ERROR";
-            break;
-        case SQLITE_ROW:
-            zName = "SQLITE_ROW";
-            break;
-        case SQLITE_WARNING:
-            zName = "SQLITE_WARNING";
-            break;
-        case SQLITE_DONE:
-            zName = "SQLITE_DONE";
-            break;
-        }
-    }
-    if (zName == 0) {
-        static char zBuf[50];
-        sqlite3_snprintf(sizeof(zBuf), zBuf, "SQLITE_UNKNOWN(%d)",
-                 origRc);
-        zName = zBuf;
-    }
-    return zName;
-}
-#endif
-
  /*
   * Return a static string that describes the kind of error specified 
in the
   * argument.
diff --git a/src/box/sql/sqliteInt.h b/src/box/sql/sqliteInt.h
index 53188e74d..dd43f32a8 100644
--- a/src/box/sql/sqliteInt.h
+++ b/src/box/sql/sqliteInt.h
@@ -284,17 +284,6 @@ void sqlite3Coverage(int);
  #define NEVER(X)       (X)
  #endif

-/*
- * Is the sqlite3ErrName() function needed in the build? Currently,
- * it is needed by several "test*.c" files (which are
- * compiled using SQLITE_TEST).
- */
-#if defined(SQLITE_TEST)
-#define SQLITE_NEED_ERR_NAME
-#else
-#undef  SQLITE_NEED_ERR_NAME
-#endif
-
  /*
   * Return true (non-zero) if the input is an integer that is too large
   * to fit in 32-bits.  This macro is used inside of various testcase()
@@ -837,9 +826,6 @@ struct sqlite3_io_methods {
  int
  sqlite3_os_init(void);

-int
-sqlite3_db_release_memory(sqlite3 *);
-
  int
  sqlite3_busy_timeout(sqlite3 *, int ms);

@@ -4276,10 +4262,6 @@ void sqlite3SystemError(sqlite3 *, int);
  void *sqlite3HexToBlob(sqlite3 *, const char *z, int n);
  u8 sqlite3HexToInt(int h);

-#if defined(SQLITE_NEED_ERR_NAME)
-const char *sqlite3ErrName(int);
-#endif
-
  const char *sqlite3ErrStr(int);

  /**
diff --git a/test/sql-tap/triggerC.test.lua b/test/sql-tap/triggerC.test.lua
index 06e6e5bd2..da9872ec5 100755
--- a/test/sql-tap/triggerC.test.lua
+++ b/test/sql-tap/triggerC.test.lua
@@ -42,7 +42,6 @@ testprefix = "triggerC"
  -- Enable recursive triggers for this file.
  --
  test:execsql " PRAGMA recursive_triggers = on "
---sqlite3_db_config_lookaside db 0 0 0
  ---------------------------------------------------------------------------
  -- This block of tests, triggerC-1.*, are not aimed at any specific
  -- property of the triggers sub-system. They were created to debug

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [tarantool-patches] Re: [PATCH 2/3] sql: delete foreign_keys pragma
  2018-10-02 13:36   ` [tarantool-patches] " n.pettik
@ 2018-10-04 15:16     ` Alex Khatskevich
  0 siblings, 0 replies; 12+ messages in thread
From: Alex Khatskevich @ 2018-10-04 15:16 UTC (permalink / raw)
  To: n.pettik, tarantool-patches



On 02.10.2018 16:36, n.pettik wrote:
>> diff --git a/src/box/sql/sqliteInt.h b/src/box/sql/sqliteInt.h
>> index e9c15dbb3..b2d527834 100644
>> --- a/src/box/sql/sqliteInt.h
>> +++ b/src/box/sql/sqliteInt.h
>> @@ -1562,7 +1562,7 @@ struct sqlite3 {
>> #define SQLITE_ReadUncommitted 0x0004000	/* For shared-cache mode */
>> #define SQLITE_ReverseOrder   0x00020000	/* Reverse unordered SELECTs */
>> #define SQLITE_RecTriggers    0x00040000	/* Enable recursive triggers */
>> -#define SQLITE_ForeignKeys    0x00080000	/* Enforce foreign key constraints  */
>> +/*                            0x00080000	   Free bit */
> Don’t do this. It is easy to check that this bit is really free manually.
>
Fixed

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [tarantool-patches] Re: [PATCH 3/3] sql: delete ignore_check_constraints pragma
  2018-10-02 13:36   ` [tarantool-patches] " n.pettik
@ 2018-10-04 15:16     ` Alex Khatskevich
  0 siblings, 0 replies; 12+ messages in thread
From: Alex Khatskevich @ 2018-10-04 15:16 UTC (permalink / raw)
  To: n.pettik, tarantool-patches



On 02.10.2018 16:36, n.pettik wrote:
>> diff --git a/src/box/sql/sqliteInt.h b/src/box/sql/sqliteInt.h
>> index b2d527834..8883d37ad 100644
>> --- a/src/box/sql/sqliteInt.h
>> +++ b/src/box/sql/sqliteInt.h
>> @@ -1558,7 +1558,7 @@ struct sqlite3 {
>> #define SQLITE_WhereTrace     0x00008000       /* Debug info about optimizer's work */
>> #define SQLITE_VdbeListing    0x00000400	/* Debug listings of VDBE programs */
>> #define SQLITE_VdbeAddopTrace 0x00001000	/* Trace sqlite3VdbeAddOp() calls */
>> -#define SQLITE_IgnoreChecks   0x00002000	/* Do not enforce check constraints */
>> +/*                            0x00002000	   Free bit */
> The same: don’t do it. Lets simply delete this flag.
>
> The rest is OK.
Fixed

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [tarantool-patches] Re: [PATCH 0/3] Delete foreign_keys and ignore_check_constraints pragmas
  2018-10-02 10:48 [tarantool-patches] [PATCH 0/3] Delete foreign_keys and ignore_check_constraints pragmas AKhatskevich
                   ` (2 preceding siblings ...)
  2018-10-02 10:48 ` [tarantool-patches] [PATCH 3/3] sql: delete ignore_check_constraints pragma AKhatskevich
@ 2018-10-04 16:27 ` n.pettik
  2018-10-05  7:15 ` Kirill Yukhin
  4 siblings, 0 replies; 12+ messages in thread
From: n.pettik @ 2018-10-04 16:27 UTC (permalink / raw)
  To: tarantool-patches; +Cc: Kirill Yukhin, Alex Khatskevich

Now patchset LGTM.

> Issue: https://github.com/tarantool/tarantool/issues/3696
> Branch: https://github.com/tarantool/tarantool/tree/kh/gh-3696-delete-pragmas-2
> 
> Those pragmas let a user turn off constraint checks.
> They are considered useless and dangerous.
> 
> AKhatskevich (3):
>  sql: delete unused code
>  sql: delete foreign_keys pragma
>  sql: delete ignore_check_constraints pragma

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [tarantool-patches] Re: [PATCH 0/3] Delete foreign_keys and ignore_check_constraints pragmas
  2018-10-02 10:48 [tarantool-patches] [PATCH 0/3] Delete foreign_keys and ignore_check_constraints pragmas AKhatskevich
                   ` (3 preceding siblings ...)
  2018-10-04 16:27 ` [tarantool-patches] Re: [PATCH 0/3] Delete foreign_keys and ignore_check_constraints pragmas n.pettik
@ 2018-10-05  7:15 ` Kirill Yukhin
  4 siblings, 0 replies; 12+ messages in thread
From: Kirill Yukhin @ 2018-10-05  7:15 UTC (permalink / raw)
  To: tarantool-patches; +Cc: korablev

Hello,
On 02 Oct 13:48, AKhatskevich wrote:
> Issue: https://github.com/tarantool/tarantool/issues/3696
> Branch: https://github.com/tarantool/tarantool/tree/kh/gh-3696-delete-pragmas-2
> 
> Those pragmas let a user turn off constraint checks.
> They are considered useless and dangerous.
> 
> AKhatskevich (3):
>   sql: delete unused code
>   sql: delete foreign_keys pragma
>   sql: delete ignore_check_constraints pragma
> 
>  src/box/sql.c                             |   3 +-
>  src/box/sql/CMakeLists.txt                |   1 -
>  src/box/sql/fkey.c                        |  21 +--
>  src/box/sql/insert.c                      |   7 +-
>  src/box/sql/main.c                        | 291 ------------------------------
>  src/box/sql/pragma.h                      |  14 --
>  src/box/sql/sqliteInt.h                   |  19 +-
>  test/sql-tap/check.test.lua               |  15 +-
>  test/sql-tap/tkt-b1d3a2e531.test.lua      |   8 +-
>  test/sql-tap/triggerC.test.lua            |   5 +-
>  test/sql/transitive-transactions.result   |   3 -
>  test/sql/transitive-transactions.test.lua |   1 -
>  12 files changed, 12 insertions(+), 376 deletions(-)
I've checked the patchset of 3 commits into 2.0 branch.
Your branch contained extra commit, which didn't pass review
so far. I've kicked it. (I didn't delete the branch because of
that)

--
Regards, Kirill Yukhin

> 
> -- 
> 2.14.1
> 
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-10-05  7:15 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-02 10:48 [tarantool-patches] [PATCH 0/3] Delete foreign_keys and ignore_check_constraints pragmas AKhatskevich
2018-10-02 10:48 ` [tarantool-patches] [PATCH 1/3] sql: delete unused code AKhatskevich
2018-10-02 13:36   ` [tarantool-patches] " n.pettik
2018-10-04 15:16     ` Alex Khatskevich
2018-10-02 10:48 ` [tarantool-patches] [PATCH 2/3] sql: delete foreign_keys pragma AKhatskevich
2018-10-02 13:36   ` [tarantool-patches] " n.pettik
2018-10-04 15:16     ` Alex Khatskevich
2018-10-02 10:48 ` [tarantool-patches] [PATCH 3/3] sql: delete ignore_check_constraints pragma AKhatskevich
2018-10-02 13:36   ` [tarantool-patches] " n.pettik
2018-10-04 15:16     ` Alex Khatskevich
2018-10-04 16:27 ` [tarantool-patches] Re: [PATCH 0/3] Delete foreign_keys and ignore_check_constraints pragmas n.pettik
2018-10-05  7:15 ` Kirill Yukhin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox