From: AKhatskevich <avkhatskevich@tarantool.org> To: korablev@tarantool.org, tarantool-patches@freelists.org Subject: [tarantool-patches] [PATCH 3/3] sql: delete ignore_check_constraints pragma Date: Tue, 2 Oct 2018 13:48:36 +0300 [thread overview] Message-ID: <27d2bf9aa3b316345d3016590e3047c4b204b3ed.1538476785.git.avkhatskevich@tarantool.org> (raw) In-Reply-To: <cover.1538476785.git.avkhatskevich@tarantool.org> In-Reply-To: <cover.1538476785.git.avkhatskevich@tarantool.org> 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
next prev parent reply other threads:[~2018-10-02 10:49 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 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 ` AKhatskevich [this message] 2018-10-02 13:36 ` [tarantool-patches] Re: [PATCH 3/3] sql: delete ignore_check_constraints pragma 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
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=27d2bf9aa3b316345d3016590e3047c4b204b3ed.1538476785.git.avkhatskevich@tarantool.org \ --to=avkhatskevich@tarantool.org \ --cc=korablev@tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='Re: [tarantool-patches] [PATCH 3/3] sql: delete ignore_check_constraints pragma' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox