[tarantool-patches] [PATCH] sql: make default constraint names be consistent

Nikita Pettik korablev at tarantool.org
Wed Jul 31 13:55:56 MSK 2019


If during creation of constraint its name is not specified, then it is
generated automatically. Occasionally, default names for each type of
constraint turn out to be different. This patch makes them follow the
same pattern: "shortcut"_unnamed_"table_name"_"ordinal_numb". For
instance: fk_unnamed_T1_1 or ck_unnamed_T1_3 etc
---

Branch: https://github.com/tarantool/tarantool/commits/np/fix-constraint-names

 src/box/sql/build.c                   |  9 ++++-----
 test/sql-tap/check.test.lua           | 32 ++++++++++++++++----------------
 test/sql-tap/fkey1.test.lua           |  2 +-
 test/sql-tap/fkey2.test.lua           | 16 ++++++++--------
 test/sql-tap/sql-errors.test.lua      |  4 ++--
 test/sql-tap/table.test.lua           | 16 ++++++++--------
 test/sql/checks.result                | 10 +++++-----
 test/sql/drop-table.result            |  2 +-
 test/sql/foreign-keys.result          |  3 +--
 test/sql/gh-2981-check-autoinc.result |  8 ++++----
 test/sql/types.result                 |  6 +++---
 11 files changed, 53 insertions(+), 55 deletions(-)

diff --git a/src/box/sql/build.c b/src/box/sql/build.c
index 0a6759e41..e02b7f864 100644
--- a/src/box/sql/build.c
+++ b/src/box/sql/build.c
@@ -724,8 +724,7 @@ sql_create_check_contraint(struct Parse *parser)
 	} else {
 		assert(! is_alter);
 		uint32_t ck_idx = ++parser->create_table_def.check_count;
-		name = tt_sprintf("CK_CONSTRAINT_%d_%s", ck_idx,
-				  space->def->name);
+		name = tt_sprintf("ck_unnamed_%s_%d", space->def->name, ck_idx);
 	}
 	size_t name_len = strlen(name);
 
@@ -1973,9 +1972,9 @@ sql_create_foreign_key(struct Parse *parse_context)
 	if (!is_alter) {
 		if (create_def->name.n == 0) {
 			constraint_name =
-				sqlMPrintf(db, "FK_CONSTRAINT_%d_%s",
-					       ++table_def->fkey_count,
-					       space->def->name);
+				sqlMPrintf(db, "fk_unnamed_%s_%d",
+					   space->def->name,
+					   ++table_def->fkey_count);
 		} else {
 			constraint_name =
 				sql_name_from_token(db, &create_def->name);
diff --git a/test/sql-tap/check.test.lua b/test/sql-tap/check.test.lua
index 7bd5f8177..79256ae67 100755
--- a/test/sql-tap/check.test.lua
+++ b/test/sql-tap/check.test.lua
@@ -55,7 +55,7 @@ test:do_catchsql_test(
         INSERT INTO t1 VALUES(6,7, 2);
     ]], {
         -- <check-1.3>
-        1, "Check constraint failed 'CK_CONSTRAINT_1_T1': x<5"
+        1, "Check constraint failed 'ck_unnamed_T1_1': x<5"
         -- </check-1.3>
     })
 
@@ -75,7 +75,7 @@ test:do_catchsql_test(
         INSERT INTO t1 VALUES(4,3, 2);
     ]], {
         -- <check-1.5>
-        1, "Check constraint failed 'CK_CONSTRAINT_2_T1': y>x"
+        1, "Check constraint failed 'ck_unnamed_T1_2': y>x"
         -- </check-1.5>
     })
 
@@ -147,7 +147,7 @@ test:do_catchsql_test(
         UPDATE t1 SET x=7 WHERE x==2
     ]], {
         -- <check-1.12>
-        1, "Check constraint failed 'CK_CONSTRAINT_1_T1': x<5"
+        1, "Check constraint failed 'ck_unnamed_T1_1': x<5"
         -- </check-1.12>
     })
 
@@ -167,7 +167,7 @@ test:do_catchsql_test(
         UPDATE t1 SET x=5 WHERE x==2
     ]], {
         -- <check-1.14>
-        1, "Check constraint failed 'CK_CONSTRAINT_1_T1': x<5"
+        1, "Check constraint failed 'ck_unnamed_T1_1': x<5"
         -- </check-1.14>
     })
 
@@ -319,7 +319,7 @@ test:do_catchsql_test(
         );
     ]], {
         -- <check-3.1>
-        1, "Failed to create check constraint 'CK_CONSTRAINT_1_T3': Subqueries are prohibited in a ck constraint definition"
+        1, "Failed to create check constraint 'ck_unnamed_T3_1': Subqueries are prohibited in a ck constraint definition"
         -- </check-3.1>
     })
 
@@ -344,7 +344,7 @@ test:do_catchsql_test(
         );
     ]], {
         -- <check-3.3>
-        1, "Failed to create check constraint 'CK_CONSTRAINT_1_T3': Can’t resolve field 'Q'"
+        1, "Failed to create check constraint 'ck_unnamed_T3_1': Can’t resolve field 'Q'"
         -- </check-3.3>
     })
 
@@ -368,7 +368,7 @@ test:do_catchsql_test(
         );
     ]], {
         -- <check-3.5>
-        1, "Failed to create check constraint 'CK_CONSTRAINT_1_T3': Field 'X' was not found in space 'T2' format"
+        1, "Failed to create check constraint 'ck_unnamed_T3_1': Field 'X' was not found in space 'T2' format"
         -- </check-3.5>
     })
 
@@ -413,7 +413,7 @@ test:do_catchsql_test(
         INSERT INTO t3 VALUES(111,222,333);
     ]], {
         -- <check-3.9>
-        1, "Check constraint failed 'CK_CONSTRAINT_1_T3': t3.x<25"
+        1, "Check constraint failed 'ck_unnamed_T3_1': t3.x<25"
         -- </check-3.9>
     })
 
@@ -484,7 +484,7 @@ test:do_catchsql_test(
         UPDATE t4 SET x=0, y=1;
     ]], {
         -- <check-4.6>
-        1, "Check constraint failed 'CK_CONSTRAINT_1_T4': x+y==11 OR x*y==12 OR x/y BETWEEN 5 AND 8 OR -x==y+10"
+        1, "Check constraint failed 'ck_unnamed_T4_1': x+y==11 OR x*y==12 OR x/y BETWEEN 5 AND 8 OR -x==y+10"
         -- </check-4.6>
     })
 
@@ -504,7 +504,7 @@ test:do_catchsql_test(
         UPDATE t4 SET x=0, y=2;
     ]], {
         -- <check-4.9>
-        1, "Check constraint failed 'CK_CONSTRAINT_1_T4': x+y==11 OR x*y==12 OR x/y BETWEEN 5 AND 8 OR -x==y+10"
+        1, "Check constraint failed 'ck_unnamed_T4_1': x+y==11 OR x*y==12 OR x/y BETWEEN 5 AND 8 OR -x==y+10"
         -- </check-4.9>
     })
 
@@ -516,7 +516,7 @@ test:do_catchsql_test(
         );
     ]], {
         -- <check-5.1>
-        1, "Failed to create check constraint 'CK_CONSTRAINT_1_T5': bindings are not allowed in DDL"
+        1, "Failed to create check constraint 'ck_unnamed_T5_1': bindings are not allowed in DDL"
         -- </check-5.1>
     })
 
@@ -528,7 +528,7 @@ test:do_catchsql_test(
         );
     ]], {
         -- <check-5.2>
-        1, "Failed to create check constraint 'CK_CONSTRAINT_1_T5': bindings are not allowed in DDL"
+        1, "Failed to create check constraint 'ck_unnamed_T5_1': bindings are not allowed in DDL"
         -- </check-5.2>
     })
 
@@ -581,7 +581,7 @@ test:do_catchsql_test(
         UPDATE OR FAIL t1 SET x=7-x, y=y+1;
     ]], {
         -- <check-6.5>
-        1, "Check constraint failed 'CK_CONSTRAINT_1_T1': x<5"
+        1, "Check constraint failed 'ck_unnamed_T1_1': x<5"
         -- </check-6.5>
     })
 
@@ -603,7 +603,7 @@ test:do_catchsql_test(
         INSERT OR ROLLBACK INTO t1 VALUES(8,40.0, 10);
     ]], {
         -- <check-6.7>
-        1, "Check constraint failed 'CK_CONSTRAINT_1_T1': x<5"
+        1, "Check constraint failed 'ck_unnamed_T1_1': x<5"
         -- </check-6.7>
     })
 
@@ -636,7 +636,7 @@ test:do_catchsql_test(
         REPLACE INTO t1 VALUES(6,7, 11);
     ]], {
         -- <check-6.12>
-        1, "Check constraint failed 'CK_CONSTRAINT_1_T1': x<5"
+        1, "Check constraint failed 'ck_unnamed_T1_1': x<5"
         -- </check-6.12>
     })
 
@@ -700,7 +700,7 @@ test:do_catchsql_test(
     7.3,
     " INSERT INTO t6 VALUES(11) ", {
         -- <7.3>
-        1, "Check constraint failed 'CK_CONSTRAINT_1_T6': myfunc(a)"
+        1, "Check constraint failed 'ck_unnamed_T6_1': myfunc(a)"
         -- </7.3>
     })
 
diff --git a/test/sql-tap/fkey1.test.lua b/test/sql-tap/fkey1.test.lua
index 7000ec0c4..d6ef473aa 100755
--- a/test/sql-tap/fkey1.test.lua
+++ b/test/sql-tap/fkey1.test.lua
@@ -217,7 +217,7 @@ test:do_catchsql_test(
         CREATE TABLE c1(a INT PRIMARY KEY REFERENCES p1(x));
     ]], {
         -- <fkey1-6.1>
-        1, "Failed to create foreign key constraint 'FK_CONSTRAINT_1_C1': referenced fields don't compose unique index"
+        1, "Failed to create foreign key constraint 'fk_unnamed_C1_1': referenced fields don't compose unique index"
         -- </fkey1-6.1>
     })
 
diff --git a/test/sql-tap/fkey2.test.lua b/test/sql-tap/fkey2.test.lua
index c44f1bf7f..264616d75 100755
--- a/test/sql-tap/fkey2.test.lua
+++ b/test/sql-tap/fkey2.test.lua
@@ -362,7 +362,7 @@ test:do_catchsql_test(
         UPDATE ab SET a = 5;
     ]], {
         -- <fkey2-3.2>
-        1, "Check constraint failed 'CK_CONSTRAINT_1_EF': e!=5"
+        1, "Check constraint failed 'ck_unnamed_EF_1': e!=5"
         -- </fkey2-3.2>
     })
 
@@ -382,7 +382,7 @@ test:do_catchsql_test(
         UPDATE ab SET a = 5;
     ]], {
         -- <fkey2-3.4>
-        1, "Check constraint failed 'CK_CONSTRAINT_1_EF': e!=5"
+        1, "Check constraint failed 'ck_unnamed_EF_1': e!=5"
         -- </fkey2-3.4>
     })
 
@@ -722,7 +722,7 @@ test:do_catchsql_test(
         CREATE TABLE c(x INT PRIMARY KEY REFERENCES p(c));
     ]], {
         -- <fkey2-7.1>
-        1, "Failed to create foreign key constraint 'FK_CONSTRAINT_1_C': foreign key refers to nonexistent field C"
+        1, "Failed to create foreign key constraint 'fk_unnamed_C_1': foreign key refers to nonexistent field C"
         -- </fkey2-7.1>
     })
 
@@ -733,7 +733,7 @@ test:do_catchsql_test(
         CREATE TABLE c(x  INT PRIMARY KEY REFERENCES v(y));
     ]], {
         -- <fkey2-7.2>
-        1, "Failed to create foreign key constraint 'FK_CONSTRAINT_1_C': referenced space can't be VIEW"
+        1, "Failed to create foreign key constraint 'fk_unnamed_C_1': referenced space can't be VIEW"
         -- </fkey2-7.2>
     })
 
@@ -748,7 +748,7 @@ test:do_catchsql_test(
         CREATE TABLE c(x TEXT PRIMARY KEY REFERENCES p(a));
     ]], {
         -- <fkey2-7.3>
-        1, "Failed to create foreign key constraint 'FK_CONSTRAINT_1_C': field collation mismatch"
+        1, "Failed to create foreign key constraint 'fk_unnamed_C_1': field collation mismatch"
         -- </fkey2-7.3>
     })
 
@@ -761,7 +761,7 @@ test:do_catchsql_test(
         CREATE TABLE c(x INT PRIMARY KEY REFERENCES p);
     ]], {
         -- <fkey2-7.4>
-        1, "Failed to create foreign key constraint 'FK_CONSTRAINT_1_C': number of columns in foreign key does not match the number of columns in the primary index of referenced table"
+        1, "Failed to create foreign key constraint 'fk_unnamed_C_1': number of columns in foreign key does not match the number of columns in the primary index of referenced table"
         -- </fkey2-7.4>
     })
 
@@ -1100,7 +1100,7 @@ test:do_catchsql_test(
         CREATE TABLE cc(a  INT PRIMARY KEY, b INT , FOREIGN KEY(a, b) REFERENCES pp(x, z));
     ]], {
         -- <fkey2-10.14>
-        1, "Failed to create foreign key constraint 'FK_CONSTRAINT_1_CC': foreign key refers to nonexistent field Z"
+        1, "Failed to create foreign key constraint 'fk_unnamed_CC_1': foreign key refers to nonexistent field Z"
         -- </fkey2-10.14>
     })
 
@@ -1162,7 +1162,7 @@ test:do_catchsql_test(
         CREATE TABLE t1(x INT PRIMARY KEY REFERENCES v);
     ]], {
         -- <fkey2-10.20>
-        1, "Failed to create foreign key constraint 'FK_CONSTRAINT_1_T1': referenced space can't be VIEW"
+        1, "Failed to create foreign key constraint 'fk_unnamed_T1_1': referenced space can't be VIEW"
         -- </fkey2-10.20>
     })
 
diff --git a/test/sql-tap/sql-errors.test.lua b/test/sql-tap/sql-errors.test.lua
index f452e3c6d..d11c5c597 100755
--- a/test/sql-tap/sql-errors.test.lua
+++ b/test/sql-tap/sql-errors.test.lua
@@ -112,7 +112,7 @@ test:do_catchsql_test(
 		CREATE TABLE t10(i INT PRIMARY KEY REFERENCES v0);
 	]], {
 		-- <sql-errors-1.10>
-		1,"Failed to create foreign key constraint 'FK_CONSTRAINT_1_T10': referenced space can't be VIEW"
+		1,"Failed to create foreign key constraint 'fk_unnamed_T10_1': referenced space can't be VIEW"
 		-- </sql-errors-1.10>
 	})
 
@@ -313,7 +313,7 @@ test:do_catchsql_test(
 		CREATE TABLE t27 (i INT PRIMARY KEY, CHECK(i < (SELECT * FROM t0)));
 	]], {
 		-- <sql-errors-1.27>
-		1,"Failed to create check constraint 'CK_CONSTRAINT_1_T27': Subqueries are prohibited in a ck constraint definition"
+		1,"Failed to create check constraint 'ck_unnamed_T27_1': Subqueries are prohibited in a ck constraint definition"
 		-- </sql-errors-1.27>
 	})
 
diff --git a/test/sql-tap/table.test.lua b/test/sql-tap/table.test.lua
index 40d7d6b7e..55187378b 100755
--- a/test/sql-tap/table.test.lua
+++ b/test/sql-tap/table.test.lua
@@ -791,7 +791,7 @@ test:do_catchsql_test(
         );
     ]], {
         -- <table-10.7>
-        1, "Failed to create foreign key constraint 'FK_CONSTRAINT_1_T6': foreign key refers to nonexistent field B"
+        1, "Failed to create foreign key constraint 'fk_unnamed_T6_1': foreign key refers to nonexistent field B"
         -- </table-10.7>
     })
 
@@ -820,7 +820,7 @@ test:do_catchsql_test(
         );
     ]], {
         -- <table-10.9>
-        1, "Failed to create foreign key constraint 'FK_CONSTRAINT_1_T6': number of columns in foreign key does not match the number of columns in the primary index of referenced table"
+        1, "Failed to create foreign key constraint 'fk_unnamed_T6_1': number of columns in foreign key does not match the number of columns in the primary index of referenced table"
         -- </table-10.9>
     })
 
@@ -835,7 +835,7 @@ test:do_test(
         ]]
     end, {
         -- <table-10.10>
-        1, "Failed to create foreign key constraint 'FK_CONSTRAINT_1_T6': number of columns in foreign key does not match the number of columns in the primary index of referenced table"
+        1, "Failed to create foreign key constraint 'fk_unnamed_T6_1': number of columns in foreign key does not match the number of columns in the primary index of referenced table"
         -- </table-10.10>
     })
 
@@ -848,7 +848,7 @@ test:do_test(
         ]]
     end, {
         -- <table-10.11>
-        1, "Failed to create foreign key constraint 'FK_CONSTRAINT_1_T6': number of columns in foreign key does not match the number of columns in the primary index of referenced table"
+        1, "Failed to create foreign key constraint 'fk_unnamed_T6_1': number of columns in foreign key does not match the number of columns in the primary index of referenced table"
         -- </table-10.11>
     })
 
@@ -863,7 +863,7 @@ test:do_test(
         ]]
     end, {
         -- <table-10.12>
-        1, [[Failed to create foreign key constraint 'FK_CONSTRAINT_1_T6': unknown column X in foreign key definition]]
+        1, [[Failed to create foreign key constraint 'fk_unnamed_T6_1': unknown column X in foreign key definition]]
         -- </table-10.12>
     })
 
@@ -878,7 +878,7 @@ test:do_test(
         ]]
     end, {
         -- <table-10.13>
-        1, [[Failed to create foreign key constraint 'FK_CONSTRAINT_1_T6': unknown column X in foreign key definition]]
+        1, [[Failed to create foreign key constraint 'fk_unnamed_T6_1': unknown column X in foreign key definition]]
         -- </table-10.13>
     })
 
@@ -1221,7 +1221,7 @@ test:do_catchsql_test(
         INSERT INTO T21 VALUES(2, -1, 1);
     ]], {
         -- <table-21.3>
-        1, "Check constraint failed 'CK_CONSTRAINT_1_T21': B > 0"
+        1, "Check constraint failed 'ck_unnamed_T21_1': B > 0"
         -- </table-21.3>
     })
 
@@ -1231,7 +1231,7 @@ test:do_catchsql_test(
         INSERT INTO T21 VALUES(2, 1, -1);
     ]], {
         -- <table-21.4>
-        1, "Check constraint failed 'CK_CONSTRAINT_2_T21': C > 0"
+        1, "Check constraint failed 'ck_unnamed_T21_2': C > 0"
         -- </table-21.4>
     })
 
diff --git a/test/sql/checks.result b/test/sql/checks.result
index b20514993..4fdf23414 100644
--- a/test/sql/checks.result
+++ b/test/sql/checks.result
@@ -264,8 +264,8 @@ box.space._ck_constraint:select()
 --
 box.execute("CREATE TABLE w2 (s1 INT PRIMARY KEY, CHECK ((SELECT COUNT(*) FROM w2) = 0));")
 ---
-- error: 'Failed to create check constraint ''CK_CONSTRAINT_1_W2'': Subqueries are
-    prohibited in a ck constraint definition'
+- error: 'Failed to create check constraint ''ck_unnamed_W2_1'': Subqueries are prohibited
+    in a ck constraint definition'
 ...
 box.execute("DROP TABLE w2;")
 ---
@@ -276,7 +276,7 @@ box.execute("DROP TABLE w2;")
 --
 box.execute("CREATE TABLE t5(x INT PRIMARY KEY, y INT, CHECK( x*y < ? ));")
 ---
-- error: 'Failed to create check constraint ''CK_CONSTRAINT_1_T5'': bindings are not
+- error: 'Failed to create check constraint ''ck_unnamed_T5_1'': bindings are not
     allowed in DDL'
 ...
 -- Test trim CK constraint code correctness.
@@ -290,11 +290,11 @@ box.space._ck_constraint:select()[1].code
 ...
 box.execute("INSERT INTO t1 VALUES('1 a')")
 ---
-- error: 'Check constraint failed ''CK_CONSTRAINT_1_T1'': x LIKE ''1  a'''
+- error: 'Check constraint failed ''ck_unnamed_T1_1'': x LIKE ''1  a'''
 ...
 box.execute("INSERT INTO t1 VALUES('1   a')")
 ---
-- error: 'Check constraint failed ''CK_CONSTRAINT_1_T1'': x LIKE ''1  a'''
+- error: 'Check constraint failed ''ck_unnamed_T1_1'': x LIKE ''1  a'''
 ...
 box.execute("INSERT INTO t1 VALUES('1  a')")
 ---
diff --git a/test/sql/drop-table.result b/test/sql/drop-table.result
index 48b0010ac..cf19f0364 100644
--- a/test/sql/drop-table.result
+++ b/test/sql/drop-table.result
@@ -180,7 +180,7 @@ box.execute('CREATE TABLE t3(a INTEGER PRIMARY KEY);')
 --
 box.execute('CREATE TABLE t4(x INTEGER PRIMARY KEY REFERENCES t3, a INT UNIQUE, c TEXT REFERENCES t3);')
 ---
-- error: 'Failed to create foreign key constraint ''FK_CONSTRAINT_2_T4'': field type
+- error: 'Failed to create foreign key constraint ''fk_unnamed_T4_2'': field type
     mismatch'
 ...
 box.execute('DROP TABLE t3;')
diff --git a/test/sql/foreign-keys.result b/test/sql/foreign-keys.result
index f3cca5c80..e5acfedca 100644
--- a/test/sql/foreign-keys.result
+++ b/test/sql/foreign-keys.result
@@ -364,8 +364,7 @@ box.execute('SELECT row_count();')
 box.space._fk_constraint:select{}
 ---
 - - ['FK1', 518, 517, false, 'partial', 'cascade', 'set_null', [0], [0]]
-  - ['FK_CONSTRAINT_1_TC', 518, 517, false, 'full', 'set_null', 'no_action', [1],
-    [1]]
+  - ['fk_unnamed_TC_1', 518, 517, false, 'full', 'set_null', 'no_action', [1], [1]]
 ...
 box.execute('ALTER TABLE tc DROP CONSTRAINT fk1;')
 ---
diff --git a/test/sql/gh-2981-check-autoinc.result b/test/sql/gh-2981-check-autoinc.result
index f03858a7c..7073c5059 100644
--- a/test/sql/gh-2981-check-autoinc.result
+++ b/test/sql/gh-2981-check-autoinc.result
@@ -29,7 +29,7 @@ box.execute("insert into t1 values (18, null);")
 ...
 box.execute("insert into t1(s2) values (null);")
 ---
-- error: 'Check constraint failed ''CK_CONSTRAINT_1_T1'': s1 <> 19'
+- error: 'Check constraint failed ''ck_unnamed_T1_1'': s1 <> 19'
 ...
 box.execute("insert into t2 values (18, null);")
 ---
@@ -37,7 +37,7 @@ box.execute("insert into t2 values (18, null);")
 ...
 box.execute("insert into t2(s2) values (null);")
 ---
-- error: 'Check constraint failed ''CK_CONSTRAINT_1_T2'': s1 <> 19 AND s1 <> 25'
+- error: 'Check constraint failed ''ck_unnamed_T2_1'': s1 <> 19 AND s1 <> 25'
 ...
 box.execute("insert into t2 values (24, null);")
 ---
@@ -45,7 +45,7 @@ box.execute("insert into t2 values (24, null);")
 ...
 box.execute("insert into t2(s2) values (null);")
 ---
-- error: 'Check constraint failed ''CK_CONSTRAINT_1_T2'': s1 <> 19 AND s1 <> 25'
+- error: 'Check constraint failed ''ck_unnamed_T2_1'': s1 <> 19 AND s1 <> 25'
 ...
 box.execute("insert into t3 values (9, null)")
 ---
@@ -53,7 +53,7 @@ box.execute("insert into t3 values (9, null)")
 ...
 box.execute("insert into t3(s2) values (null)")
 ---
-- error: 'Check constraint failed ''CK_CONSTRAINT_1_T3'': s1 < 10'
+- error: 'Check constraint failed ''ck_unnamed_T3_1'': s1 < 10'
 ...
 box.execute("DROP TABLE t1")
 ---
diff --git a/test/sql/types.result b/test/sql/types.result
index 780a23d51..c4a979ea6 100644
--- a/test/sql/types.result
+++ b/test/sql/types.result
@@ -744,7 +744,7 @@ box.execute("CREATE TABLE t1 (id INT PRIMARY KEY, a BOOLEAN CHECK (a = true));")
 ...
 box.execute("INSERT INTO t1 VALUES (1, false);")
 ---
-- error: 'Check constraint failed ''CK_CONSTRAINT_1_T1'': a = true'
+- error: 'Check constraint failed ''ck_unnamed_T1_1'': a = true'
 ...
 box.execute("INSERT INTO t1 VALUES (1, true);")
 ---
@@ -1595,11 +1595,11 @@ box.execute("CREATE TABLE t1 (id INT PRIMARY KEY, a INT CHECK (a > 1844674407370
 ...
 box.execute("INSERT INTO t1 VALUES (1, 18446744073709551611);")
 ---
-- error: 'Check constraint failed ''CK_CONSTRAINT_1_T1'': a > 18446744073709551612'
+- error: 'Check constraint failed ''ck_unnamed_T1_1'': a > 18446744073709551612'
 ...
 box.execute("INSERT INTO t1 VALUES (1, -1);")
 ---
-- error: 'Check constraint failed ''CK_CONSTRAINT_1_T1'': a > 18446744073709551612'
+- error: 'Check constraint failed ''ck_unnamed_T1_1'': a > 18446744073709551612'
 ...
 box.space.T1:drop()
 ---
-- 
2.15.1





More information about the Tarantool-patches mailing list