From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 191AA299F2 for ; Tue, 2 Oct 2018 06:49:06 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id us2AWyvLa3bC for ; Tue, 2 Oct 2018 06:49:06 -0400 (EDT) Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id C4CF929B2F for ; Tue, 2 Oct 2018 06:49:05 -0400 (EDT) From: AKhatskevich Subject: [tarantool-patches] [PATCH 3/3] sql: delete ignore_check_constraints pragma Date: Tue, 2 Oct 2018 13:48:36 +0300 Message-Id: <27d2bf9aa3b316345d3016590e3047c4b204b3ed.1538476785.git.avkhatskevich@tarantool.org> In-Reply-To: References: In-Reply-To: References: Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: korablev@tarantool.org, tarantool-patches@freelists.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( -- }) -test:do_execsql_test( - "check-4.8", - [[ - PRAGMA ignore_check_constraints='ON'; - UPDATE t4 SET x=0, y=1; - SELECT * FROM t4; - ]], { - -- - 0, 1 - -- - }) - test:do_catchsql_test( "check-4.9", [[ - PRAGMA ignore_check_constraints='OFF'; UPDATE t4 SET x=0, y=2; ]], { -- -- 2.14.1