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 828842795C for ; Sun, 5 Aug 2018 20:28:07 -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 FGluUVdhduqt for ; Sun, 5 Aug 2018 20:28:07 -0400 (EDT) Received: from smtp60.i.mail.ru (smtp60.i.mail.ru [217.69.128.40]) (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 D9BED2758D for ; Sun, 5 Aug 2018 20:28:06 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [tarantool-patches] Re: [PATCH 1/5] sql: prohibit creation of FK on unexisting tables From: "n.pettik" In-Reply-To: Date: Mon, 6 Aug 2018 03:27:57 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: <32f36b207de86bf144b16260c9ed434b45cf094c.1531443603.git.korablev@tarantool.org> <0176472E-E0CD-41F9-B794-45E02FA54238@tarantool.org> <33d5fa73-76a8-9402-e535-4612d7b25c62@tarantool.org> 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: tarantool-patches@freelists.org Cc: Vladislav Shpilevoy >>> 1. sql-tap/fkey2.test.lua fails on this commit. Travis fails >>> as well. >> Does it really matter?:) Could you forgive me these fails and >> make me avoid suffering? Anyway, they are completely fixed >> in second patch, but in scope of current patch they can be only >> partially repaired. Hence, it would look like I fix in the second = patch >> fixes made in first one.. >=20 > It had been failing even on the last commit. So it really mattered. Really? On my local machine on last commit all test seem to pass.. On Travis also I don=E2=80=99t see failed tests related to FK = constraints. > On the second commit it fails now as well. These tests are fixed on third commit, not on second. > Please, make it working. It is not okay, that a non-trivial patch > breaks tests, that somehow stop failing after some non-linked > changes. But okay, I fixed them in current commit: +++ b/test/sql-tap/fkey2.test.lua @@ -1,6 +1,6 @@ #!/usr/bin/env tarantool test =3D require("sqltester") -test:plan(121) +test:plan(117) =20 -- This file implements regression tests for foreign keys. =20 @@ -724,14 +724,11 @@ test:do_catchsql_test( test:do_catchsql_test( "fkey2-7.2", [[ - DROP TABLE IF EXISTS c; - DROP TABLE IF EXISTS p; - CREATE VIEW v AS SELECT x AS y FROM c; - CREATE TABLE c(x PRIMARY KEY REFERENCES v(y)); - INSERT INTO c DEFAULT VALUES; + CREATE VIEW v AS SELECT b AS y FROM p; + CREATE TABLE d(x PRIMARY KEY REFERENCES v(y)); ]], { -- - 1, "no such table: C" + 1, "referenced table can't be view" -- }) =20 @@ -740,13 +737,14 @@ test:do_catchsql_test( [[ DROP VIEW v; DROP TABLE IF EXISTS c; + DROP TABLE IF EXISTS p; CREATE TABLE p(a COLLATE binary, b PRIMARY KEY); CREATE UNIQUE INDEX idx ON p(a COLLATE "unicode_ci"); CREATE TABLE c(x PRIMARY KEY REFERENCES p(a)); INSERT INTO c DEFAULT VALUES; ]], { -- - 1, "no such view: V" + 1, "foreign key mismatch - \"C\" referencing \"P\"" -- }) @@ -1053,7 +1051,7 @@ test:do_catchsql_test( CREATE TABLE t1(a PRIMARY KEY, b REFERENCES nosuchtable); ]], { -- - 1, "foreign key constraint references nonexistent table: = NOSUCHTABLE" + 1, "Space 'NOSUCHTABLE' does not exist" -- }) =20 @@ -1080,57 +1078,17 @@ test:do_catchsql_test( -- }) =20 @@ -1083,54 +1081,13 @@ test:do_catchsql_test( test:do_execsql_test( "fkey2-10.9", [[ - DELETE FROM t2; + DROP TABLE t2; DROP TABLE t1; ]], { -- -- }) -test:do_catchsql_test( - "fkey2-10.10", - [[ - INSERT INTO t2 VALUES('x'); - ]], { - -- - 1, "no such table: T1" - -- - }) - -test:do_execsql_test( - "fkey2-10.11", - [[ - CREATE TABLE t1(x PRIMARY KEY); - INSERT INTO t1 VALUES('x'); - INSERT INTO t2 VALUES('x'); - ]], { - -- - -- - }) - -test:do_catchsql_test( - "fkey2-10.12", - [[ - DROP TABLE t1; - ]], { - -- - 1, "FOREIGN KEY constraint failed" - -- - }) - -test:do_execsql_test( - "fkey2-10.13", - [[ - DROP TABLE t2; - DROP TABLE t1; - ]], { - -- - -- - }) - test:do_execsql_test( "fkey2-10.14", [[ @@ -1181,7 +1139,7 @@ test:do_execsql_test( -- }) =20 -test:do_execsql_test( +test:do_catchsql_test( "fkey2-10.18", [[ CREATE TABLE b1(a PRIMARY KEY, b); @@ -1193,7 +1151,7 @@ test:do_execsql_test( -- }) =20 -test:do_execsql_test( +test:do_catchsql_test( "fkey2-10.19", [[ CREATE TABLE b3(a PRIMARY KEY, b REFERENCES b2 DEFERRABLE = INITIALLY DEFERRED); @@ -1204,15 +1162,15 @@ test:do_execsql_test( -- }) =20 -test:do_execsql_test( +test:do_catchsql_test( "fkey2-10.20", [[ DROP VIEW IF EXISTS v; - CREATE VIEW v AS SELECT * FROM t1; - CREATE TABLE t1(x PRIMARY KEY REFERENCES v); - DROP VIEW v; + CREATE VIEW v AS SELECT * FROM b1; + CREATE TABLE t3(x PRIMARY KEY REFERENCES v); ]], { -- + 1, "referenced table can't be view" -- })=