* [tarantool-patches] [PATCH v2 0/2] sql: use diag_set() for errors in SQL
@ 2019-02-15 17:14 imeevma
2019-02-15 17:14 ` [tarantool-patches] [PATCH v2 1/2] sql: remove field suppressErr from struct sql imeevma
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: imeevma @ 2019-02-15 17:14 UTC (permalink / raw)
To: korablev; +Cc: tarantool-patches, kostja
The goal of this patch-set is to rework all SQL errors and make
Tarantool ones from them.
Difference from v1: Added patch that removes field suppressErr.
https://github.com/tarantool/tarantool/issues/3965
https://github.com/tarantool/tarantool/tree/imeevma/gh-3965-use-diag_set-to-describe-error
Previous versions:
https://www.freelists.org/post/tarantool-patches/PATCH-v1-11-sql-rework-no-such-object-and-object-exists-errors
Mergen Imeev (2):
sql: remove field suppressErr from struct sql
sql: rework "no such object" and "object exists" errors
src/box/errcode.h | 7 +--
src/box/lua/schema.lua | 4 +-
src/box/space.h | 2 +-
src/box/sql/build.c | 37 +++++++-------
src/box/sql/delete.c | 3 +-
src/box/sql/expr.c | 5 +-
src/box/sql/pragma.c | 3 +-
src/box/sql/resolve.c | 25 ++++-----
src/box/sql/select.c | 12 +++--
src/box/sql/sqlInt.h | 9 +++-
src/box/sql/update.c | 5 +-
src/box/sql/util.c | 19 ++++---
test/box/misc.result | 5 +-
test/sql-tap/alter.test.lua | 2 +-
test/sql-tap/analyzeF.test.lua | 4 +-
test/sql-tap/check.test.lua | 4 +-
test/sql-tap/e_select1.test.lua | 26 ++++------
test/sql-tap/fkey2.test.lua | 2 +-
test/sql-tap/func.test.lua | 2 +-
test/sql-tap/gh-2367-pragma.test.lua | 2 +-
test/sql-tap/gh-2996-indexed-by.test.lua | 12 ++---
test/sql-tap/gh2130-index-refer-table.test.lua | 4 +-
test/sql-tap/identifier_case.test.lua | 2 +-
test/sql-tap/in1.test.lua | 2 +-
test/sql-tap/in3.test.lua | 2 +-
test/sql-tap/index-info.test.lua | 2 +-
test/sql-tap/index1.test.lua | 6 +--
test/sql-tap/insert1.test.lua | 6 +--
test/sql-tap/insert3.test.lua | 4 +-
test/sql-tap/join.test.lua | 2 +-
test/sql-tap/limit.test.lua | 4 +-
test/sql-tap/lua-tables.test.lua | 2 +-
test/sql-tap/lua_sql.test.lua | 2 +-
test/sql-tap/misc1.test.lua | 4 +-
test/sql-tap/select1.test.lua | 16 +++---
test/sql-tap/select4.test.lua | 10 ++--
test/sql-tap/select5.test.lua | 8 +--
test/sql-tap/selectB.test.lua | 52 ++++++-------------
test/sql-tap/table.test.lua | 16 +++---
test/sql-tap/tkt-4ef7e3cfca.test.lua | 2 +-
test/sql-tap/tkt2822.test.lua | 70 +-------------------------
test/sql-tap/tkt3346.test.lua | 2 +-
test/sql-tap/tkt3442.test.lua | 2 +-
test/sql-tap/triggerB.test.lua | 6 +--
test/sql-tap/update.test.lua | 16 +++---
test/sql-tap/view.test.lua | 24 ++-------
test/sql-tap/with1.test.lua | 13 +----
test/sql-tap/with2.test.lua | 4 +-
test/sql/checks.result | 4 +-
test/sql/delete.result | 4 +-
test/sql/drop-table.result | 4 +-
test/sql/gh-2929-primary-key.result | 2 +-
test/sql/gh-3613-idx-alter-update.result | 2 +-
test/sql/gh-3888-values-blob-assert.result | 4 +-
test/sql/icu-upper-lower.result | 2 +-
test/sql/iproto.result | 2 +-
56 files changed, 197 insertions(+), 300 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* [tarantool-patches] [PATCH v2 1/2] sql: remove field suppressErr from struct sql
2019-02-15 17:14 [tarantool-patches] [PATCH v2 0/2] sql: use diag_set() for errors in SQL imeevma
@ 2019-02-15 17:14 ` imeevma
2019-02-15 17:14 ` [tarantool-patches] [PATCH v2 2/2] sql: rework "no such object" and "object exists" errors imeevma
2019-02-18 16:51 ` [tarantool-patches] Re: [PATCH v2 0/2] sql: use diag_set() for errors in SQL Kirill Yukhin
2 siblings, 0 replies; 6+ messages in thread
From: imeevma @ 2019-02-15 17:14 UTC (permalink / raw)
To: korablev; +Cc: tarantool-patches, kostja
The suppressErr field was used to indicate that most of the errors
during the parsing should be suppressed. There was only one
feature that used it. After deleting this feature, it became
obvious that this field had become unused and should be removed.
The feature in question is: allow to use names and aliases from
input in ORDER BY clause of UNION or INTERSECT. After deleting
of this feature, requests like the one below become invalid:
SELECT 1 AS a UNION ALL SELECT 2 AS b ORDER BY b;
Part of #3965
---
src/box/sql/resolve.c | 6 ----
src/box/sql/sqlInt.h | 1 -
src/box/sql/util.c | 12 +++----
test/sql-tap/e_select1.test.lua | 26 +++++++--------
test/sql-tap/select1.test.lua | 4 +--
test/sql-tap/select4.test.lua | 8 ++---
test/sql-tap/selectB.test.lua | 52 +++++++++---------------------
test/sql-tap/tkt2822.test.lua | 70 +----------------------------------------
test/sql-tap/view.test.lua | 18 +----------
test/sql-tap/with1.test.lua | 13 +-------
10 files changed, 39 insertions(+), 171 deletions(-)
diff --git a/src/box/sql/resolve.c b/src/box/sql/resolve.c
index 3b5e5fc..a1212aa 100644
--- a/src/box/sql/resolve.c
+++ b/src/box/sql/resolve.c
@@ -866,9 +866,7 @@ resolveOrderByTermToExprList(Parse * pParse, /* Parsing context for error messag
int i; /* Loop counter */
ExprList *pEList; /* The columns of the result set */
NameContext nc; /* Name context for resolving pE */
- sql *db; /* Database connection */
int rc; /* Return code from subprocedures */
- u8 savedSuppErr; /* Saved value of db->suppressErr */
assert(sqlExprIsInteger(pE, &i) == 0);
pEList = pSelect->pEList;
@@ -881,11 +879,7 @@ resolveOrderByTermToExprList(Parse * pParse, /* Parsing context for error messag
nc.pEList = pEList;
nc.ncFlags = NC_AllowAgg;
nc.nErr = 0;
- db = pParse->db;
- savedSuppErr = db->suppressErr;
- db->suppressErr = 1;
rc = sqlResolveExprNames(&nc, pE);
- db->suppressErr = savedSuppErr;
if (rc)
return 0;
diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h
index e9a1fd1..f6ac827 100644
--- a/src/box/sql/sqlInt.h
+++ b/src/box/sql/sqlInt.h
@@ -1514,7 +1514,6 @@ struct sql {
u8 mallocFailed; /* True if we have seen a malloc failure */
u8 bBenignMalloc; /* Do not require OOMs if true */
u8 dfltLockMode; /* Default locking-mode for attached dbs */
- u8 suppressErr; /* Do not issue error messages if true */
u8 mTrace; /* zero or more sql_TRACE flags */
u32 magic; /* Magic number for detect library misuse */
/** Value returned by sql_row_count(). */
diff --git a/src/box/sql/util.c b/src/box/sql/util.c
index dadae18..0673cd5 100644
--- a/src/box/sql/util.c
+++ b/src/box/sql/util.c
@@ -236,14 +236,10 @@ sqlErrorMsg(Parse * pParse, const char *zFormat, ...)
va_start(ap, zFormat);
zMsg = sqlVMPrintf(db, zFormat, ap);
va_end(ap);
- if (db->suppressErr) {
- sqlDbFree(db, zMsg);
- } else {
- pParse->nErr++;
- sqlDbFree(db, pParse->zErrMsg);
- pParse->zErrMsg = zMsg;
- pParse->rc = SQL_ERROR;
- }
+ pParse->nErr++;
+ sqlDbFree(db, pParse->zErrMsg);
+ pParse->zErrMsg = zMsg;
+ pParse->rc = SQL_ERROR;
}
/*
diff --git a/test/sql-tap/e_select1.test.lua b/test/sql-tap/e_select1.test.lua
index 271fa15..bd98528 100755
--- a/test/sql-tap/e_select1.test.lua
+++ b/test/sql-tap/e_select1.test.lua
@@ -1,6 +1,6 @@
#!/usr/bin/env tarantool
test = require("sqltester")
-test:plan(520)
+test:plan(516)
--!./tcltestrunner.lua
-- 2010 July 16
@@ -2063,17 +2063,15 @@ test:do_select_tests(
"e_select-8.13",
{
{"1", "SELECT a FROM d5 UNION ALL SELECT c FROM d6 UNION ALL SELECT e FROM d7 ORDER BY a", {1, 2, 3, 4, 5, 6}},
- {"2", "SELECT a FROM d5 UNION ALL SELECT c FROM d6 UNION ALL SELECT e FROM d7 ORDER BY c", {1, 2, 3, 4, 5, 6}},
- {"3", "SELECT a FROM d5 UNION ALL SELECT c FROM d6 UNION ALL SELECT e FROM d7 ORDER BY e", {1, 2, 3, 4, 5, 6}},
- {"4", "SELECT a FROM d5 UNION ALL SELECT c FROM d6 UNION ALL SELECT e FROM d7 ORDER BY 1", {1, 2, 3, 4, 5, 6}},
- {"5", "SELECT a, b FROM d5 UNION ALL SELECT b, a FROM d5 ORDER BY b ", {"f", 1, "c", 4, 4, "c", 1, "f"}},
- {"6", "SELECT a, b FROM d5 UNION ALL SELECT b, a FROM d5 ORDER BY 2 ", {"f", 1, "c", 4, 4, "c", 1, "f"}},
- {"7", "SELECT a, b FROM d5 UNION ALL SELECT b, a FROM d5 ORDER BY a ", {1, "f", 4, "c", "c", 4, "f", 1}},
- {"8", "SELECT a, b FROM d5 UNION ALL SELECT b, a FROM d5 ORDER BY 1 ", {1, "f", 4, "c", "c", 4, "f", 1}},
- {"9", "SELECT a, b FROM d5 UNION ALL SELECT b, a+1 FROM d5 ORDER BY a+1 ", {"f", 2, "c", 5, 4, "c", 1, "f"}},
- {"10", "SELECT a, b FROM d5 UNION ALL SELECT b, a+1 FROM d5 ORDER BY 2 ", {"f", 2, "c", 5, 4, "c", 1, "f"}},
- {"11", "SELECT a+1, b FROM d5 UNION ALL SELECT b, a+1 FROM d5 ORDER BY a+1 ", {2, "f", 5, "c", "c", 5, "f", 2}},
- {"12", "SELECT a+1, b FROM d5 UNION ALL SELECT b, a+1 FROM d5 ORDER BY 1 ", {2, "f", 5, "c", "c", 5, "f", 2}},
+ {"2", "SELECT a FROM d5 UNION ALL SELECT c FROM d6 UNION ALL SELECT e FROM d7 ORDER BY 1", {1, 2, 3, 4, 5, 6}},
+ {"3", "SELECT a, b FROM d5 UNION ALL SELECT b, a FROM d5 ORDER BY b ", {"f", 1, "c", 4, 4, "c", 1, "f"}},
+ {"4", "SELECT a, b FROM d5 UNION ALL SELECT b, a FROM d5 ORDER BY 2 ", {"f", 1, "c", 4, 4, "c", 1, "f"}},
+ {"5", "SELECT a, b FROM d5 UNION ALL SELECT b, a FROM d5 ORDER BY a ", {1, "f", 4, "c", "c", 4, "f", 1}},
+ {"6", "SELECT a, b FROM d5 UNION ALL SELECT b, a FROM d5 ORDER BY 1 ", {1, "f", 4, "c", "c", 4, "f", 1}},
+ {"7", "SELECT a, b FROM d5 UNION ALL SELECT b, a+1 FROM d5 ORDER BY a+1 ", {"f", 2, "c", 5, 4, "c", 1, "f"}},
+ {"8", "SELECT a, b FROM d5 UNION ALL SELECT b, a+1 FROM d5 ORDER BY 2 ", {"f", 2, "c", 5, 4, "c", 1, "f"}},
+ {"9", "SELECT a+1, b FROM d5 UNION ALL SELECT b, a+1 FROM d5 ORDER BY a+1 ", {2, "f", 5, "c", "c", 5, "f", 2}},
+ {"10", "SELECT a+1, b FROM d5 UNION ALL SELECT b, a+1 FROM d5 ORDER BY 1 ", {2, "f", 5, "c", "c", 5, "f", 2}},
})
-- EVIDENCE-OF: R-39265-04070 If no matching expression can be found in
@@ -2101,9 +2099,7 @@ end
test:do_select_tests(
"e_select-8.15",
{
- {"1", "SELECT a, b FROM d5 UNION ALL SELECT c-1, d FROM d6 ORDER BY a, d ", {1, "e", 1, "f", 4, "b", 4, "c"}},
- {"2", "SELECT a, b FROM d5 UNION ALL SELECT c-1, d FROM d6 ORDER BY c-1, b ", {1, "e", 1, "f", 4, "b", 4, "c"}},
- {"3", "SELECT a, b FROM d5 UNION ALL SELECT c-1, d FROM d6 ORDER BY 1, 2 ", {1, "e", 1, "f", 4, "b", 4, "c"}},
+ {"1", "SELECT a, b FROM d5 UNION ALL SELECT c-1, d FROM d6 ORDER BY 1, 2 ", {1, "e", 1, "f", 4, "b", 4, "c"}},
})
---------------------------------------------------------------------------
diff --git a/test/sql-tap/select1.test.lua b/test/sql-tap/select1.test.lua
index bacc2b5..1aa157c 100755
--- a/test/sql-tap/select1.test.lua
+++ b/test/sql-tap/select1.test.lua
@@ -1382,7 +1382,7 @@ test:do_catchsql2_test(
-- </select1-6.22>
})
- test:do_execsql_test(
+ test:do_catchsql_test(
"select1-6.23",
[[
SELECT a FROM t6 WHERE b IN
@@ -1391,7 +1391,7 @@ test:do_catchsql2_test(
ORDER BY a;
]], {
-- <select1-6.23>
- "b", "d"
+ 1,"no such column: X"
-- </select1-6.23>
})
diff --git a/test/sql-tap/select4.test.lua b/test/sql-tap/select4.test.lua
index dd2d68b..22dc599 100755
--- a/test/sql-tap/select4.test.lua
+++ b/test/sql-tap/select4.test.lua
@@ -631,8 +631,8 @@ test:do_execsql_test(
"select4-6.3",
[[
SELECT NULL UNION SELECT NULL UNION
- SELECT 1 UNION SELECT 2 as "X"
- ORDER BY x;
+ SELECT 1 UNION SELECT 2
+ ORDER BY 1;
]], {
-- <select4-6.3>
"", 1, 2
@@ -643,8 +643,8 @@ test:do_execsql_test(
"select4-6.3.1",
[[
SELECT NULL UNION ALL SELECT NULL UNION ALL
- SELECT 1 UNION ALL SELECT 2 as "X"
- ORDER BY x;
+ SELECT 1 UNION ALL SELECT 2
+ ORDER BY 1;
]], {
-- <select4-6.3.1>
"", "", 1, 2
diff --git a/test/sql-tap/selectB.test.lua b/test/sql-tap/selectB.test.lua
index f280d35..7f57cd2 100755
--- a/test/sql-tap/selectB.test.lua
+++ b/test/sql-tap/selectB.test.lua
@@ -1,6 +1,6 @@
#!/usr/bin/env tarantool
test = require("sqltester")
-test:plan(170)
+test:plan(162)
--!./tcltestrunner.lua
-- 2008 June 24
@@ -318,28 +318,6 @@ for ii = 3, 6, 1 do
test:do_execsql_test(
"selectB-"..ii..".9",
[[
- SELECT * FROM (SELECT e FROM t2 UNION ALL SELECT f FROM t2)
- EXCEPT
- SELECT c FROM t1
- ORDER BY c DESC
- ]], {
- 27, 24, 15, 9
- })
-
- test:do_execsql_test(
- "selectB-"..ii..".10",
- [[
- SELECT * FROM (SELECT e FROM t2 UNION ALL SELECT f FROM t2)
- UNION
- SELECT c FROM t1
- ORDER BY c DESC
- ]], {
- 27, 24, 18, 15, 12, 9, 6
- })
-
- test:do_execsql_test(
- "selectB-"..ii..".11",
- [[
SELECT c FROM t1
UNION
SELECT * FROM (SELECT e FROM t2 UNION ALL SELECT f FROM t2)
@@ -349,7 +327,7 @@ for ii = 3, 6, 1 do
})
test:do_execsql_test(
- "selectB-"..ii..".12",
+ "selectB-"..ii..".10",
[[
SELECT c FROM t1 UNION SELECT e FROM t2 UNION ALL SELECT f FROM t2
ORDER BY c
@@ -358,7 +336,7 @@ for ii = 3, 6, 1 do
})
test:do_execsql_test(
- "selectB-"..ii..".13",
+ "selectB-"..ii..".11",
[[
SELECT * FROM (SELECT e FROM t2 UNION ALL SELECT f FROM t2)
UNION
@@ -369,7 +347,7 @@ for ii = 3, 6, 1 do
})
test:do_execsql_test(
- "selectB-"..ii..".14",
+ "selectB-"..ii..".12",
[[
SELECT c FROM t1
INTERSECT
@@ -380,7 +358,7 @@ for ii = 3, 6, 1 do
})
test:do_execsql_test(
- "selectB-"..ii..".15",
+ "selectB-"..ii..".13",
[[
SELECT * FROM (SELECT e FROM t2 UNION ALL SELECT f FROM t2)
INTERSECT
@@ -391,7 +369,7 @@ for ii = 3, 6, 1 do
})
test:do_execsql_test(
- "selectB-"..ii..".16",
+ "selectB-"..ii..".14",
[[
SELECT * FROM (SELECT e FROM t2 UNION ALL SELECT f FROM t2)
INTERSECT
@@ -402,7 +380,7 @@ for ii = 3, 6, 1 do
})
test:do_execsql_test(
- "selectB-"..ii..".17",
+ "selectB-"..ii..".15",
[[
SELECT * FROM (
SELECT a FROM t1 UNION ALL SELECT d FROM t2 LIMIT 4
@@ -412,7 +390,7 @@ for ii = 3, 6, 1 do
})
test:do_execsql_test(
- "selectB-"..ii..".18",
+ "selectB-"..ii..".16",
[[
SELECT * FROM (
SELECT a FROM t1 UNION ALL SELECT d FROM t2 LIMIT 4 OFFSET 2
@@ -422,7 +400,7 @@ for ii = 3, 6, 1 do
})
test:do_execsql_test(
- "selectB-"..ii..".19",
+ "selectB-"..ii..".17",
[[
SELECT * FROM (
SELECT DISTINCT (a/10) FROM t1 UNION ALL SELECT DISTINCT(d%2) FROM t2
@@ -432,7 +410,7 @@ for ii = 3, 6, 1 do
})
test:do_execsql_test(
- "selectB-"..ii..".20",
+ "selectB-"..ii..".18",
[[
SELECT DISTINCT * FROM (
SELECT DISTINCT (a/10) FROM t1 UNION ALL SELECT DISTINCT(d%2) FROM t2
@@ -442,7 +420,7 @@ for ii = 3, 6, 1 do
})
test:do_execsql_test(
- "selectB-"..ii..".21",
+ "selectB-"..ii..".19",
[[
SELECT * FROM (SELECT a,b,c FROM t1 UNION ALL SELECT d,e,f FROM t2) ORDER BY a+b
]], {
@@ -450,7 +428,7 @@ for ii = 3, 6, 1 do
})
test:do_execsql_test(
- "selectB-"..ii..".22",
+ "selectB-"..ii..".20",
[[
SELECT * FROM (SELECT 345 UNION ALL SELECT d FROM t2) ORDER BY 1;
]], {
@@ -458,7 +436,7 @@ for ii = 3, 6, 1 do
})
test:do_execsql_test(
- "selectB-"..ii..".23",
+ "selectB-"..ii..".21",
[[
SELECT x, y FROM (
SELECT a AS x, b AS y FROM t1
@@ -472,7 +450,7 @@ for ii = 3, 6, 1 do
})
test:do_execsql_test(
- "selectB-"..ii..".24",
+ "selectB-"..ii..".22",
[[
SELECT x, y FROM (
SELECT a AS x, b AS y FROM t1
@@ -486,7 +464,7 @@ for ii = 3, 6, 1 do
})
test:do_execsql_test(
- "selectB-"..ii..".25",
+ "selectB-"..ii..".23",
[[
SELECT x+y FROM (
SELECT a AS x, b AS y FROM t1
diff --git a/test/sql-tap/tkt2822.test.lua b/test/sql-tap/tkt2822.test.lua
index 250a196..4212cbd 100755
--- a/test/sql-tap/tkt2822.test.lua
+++ b/test/sql-tap/tkt2822.test.lua
@@ -1,6 +1,6 @@
#!/usr/bin/env tarantool
test = require("sqltester")
-test:plan(36)
+test:plan(30)
--!./tcltestrunner.lua
-- 2007 Dec 4
@@ -163,19 +163,6 @@ test:do_execsql_test(
-- </tkt2822-3.2>
})
--- Test that if a match cannot be found in the leftmost SELECT, an
--- attempt is made to find a match in subsequent SELECT statements.
---
-test:do_execsql_test(
- "tkt2822-3.3",
- [[
- SELECT a, b, c FROM t1 UNION ALL SELECT a AS x, b, c FROM t2 ORDER BY x;
- ]], {
- -- <tkt2822-3.3>
- 1, 3, 9, 2, 6, 18, 3, 9, 27, 4, 12, 36, 5, 15, 45, 6, 18, 54
- -- </tkt2822-3.3>
- })
-
test:do_test(
"tkt2822-3.4",
function()
@@ -295,61 +282,6 @@ test:do_execsql_test(
-- </tkt2822-6.1>
})
-test:do_execsql_test(
- "tkt2822-6.2",
- [[
- SELECT p PX, q QX FROM t6a UNION ALL SELECT x XX, y YX FROM t6b
- ORDER BY PX, YX
- ]], {
- -- <tkt2822-6.2>
- 1, 7, 1, 8, 7, 2, 9, 2
- -- </tkt2822-6.2>
- })
-
-test:do_execsql_test(
- "tkt2822-6.3",
- [[
- SELECT p PX, q QX FROM t6a UNION ALL SELECT x XX, y YX FROM t6b
- ORDER BY XX, QX
- ]], {
- -- <tkt2822-6.3>
- 1, 7, 1, 8, 7, 2, 9, 2
- -- </tkt2822-6.3>
- })
-
-test:do_execsql_test(
- "tkt2822-6.4",
- [[
- SELECT p PX, q QX FROM t6a UNION ALL SELECT x XX, y YX FROM t6b
- ORDER BY QX, XX
- ]], {
- -- <tkt2822-6.4>
- 7, 2, 9, 2, 1, 7, 1, 8
- -- </tkt2822-6.4>
- })
-
-test:do_execsql_test(
- "tkt2822-6.5",
- [[
- SELECT p PX, q QX FROM t6a UNION ALL SELECT x XX, y YX FROM t6b
- ORDER BY t6b.x, QX
- ]], {
- -- <tkt2822-6.5>
- 1, 7, 1, 8, 7, 2, 9, 2
- -- </tkt2822-6.5>
- })
-
-test:do_execsql_test(
- "tkt2822-6.6",
- [[
- SELECT p PX, q QX FROM t6a UNION ALL SELECT x XX, y YX FROM t6b
- ORDER BY t6a.q, XX
- ]], {
- -- <tkt2822-6.6>
- 7, 2, 9, 2, 1, 7, 1, 8
- -- </tkt2822-6.6>
- })
-
-- More error message tests. This is really more of a test of the
-- %r ordinal value formatting capablity added to sql_snprintf()
-- by ticket #2822.
diff --git a/test/sql-tap/view.test.lua b/test/sql-tap/view.test.lua
index 81dc9a4..0824d9d 100755
--- a/test/sql-tap/view.test.lua
+++ b/test/sql-tap/view.test.lua
@@ -1,6 +1,6 @@
#!/usr/bin/env tarantool
test = require("sqltester")
-test:plan(74)
+test:plan(73)
--!./tcltestrunner.lua
-- 2002 February 26
@@ -325,22 +325,6 @@ test:do_execsql2_test(
-- </view-3.4>
})
-
-test:do_execsql2_test(
- "view-3.5",
- [[
- CREATE VIEW v4 AS
- SELECT a, b FROM t1
- UNION
- SELECT b AS x, a AS y FROM t1
- ORDER BY x, y;
- SELECT b FROM v4 ORDER BY b LIMIT 4;
- ]], {
- -- <view-3.5>
- "B", 2, "B", 3, "B", 5, "B", 6
- -- </view-3.5>
- })
-
-- X(237, "X!cmd", [=[["ifcapable","compound"]]=])
test:do_catchsql_test(
"view-4.1",
diff --git a/test/sql-tap/with1.test.lua b/test/sql-tap/with1.test.lua
index 0ec745e..7896483 100755
--- a/test/sql-tap/with1.test.lua
+++ b/test/sql-tap/with1.test.lua
@@ -1,6 +1,6 @@
#!/usr/bin/env tarantool
test = require("sqltester")
-test:plan(65)
+test:plan(64)
--!./tcltestrunner.lua
-- 2014 January 11
@@ -797,17 +797,6 @@ test:do_execsql_test("10.7.2", [[
-- </10.7.2>
})
-test:do_execsql_test("10.7.3", [[
- WITH t(a) AS (
- SELECT 1 AS b UNION ALL SELECT a+1 AS c FROM t WHERE a<5 ORDER BY c
- )
- SELECT * FROM t
-]], {
- -- <10.7.3>
- 1, 2, 3, 4, 5
- -- </10.7.3>
-})
-
-- # Test COLLATE clauses attached to ORDER BY.
-- #
-- insert_into_tree {
--
2.7.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* [tarantool-patches] [PATCH v2 2/2] sql: rework "no such object" and "object exists" errors
2019-02-15 17:14 [tarantool-patches] [PATCH v2 0/2] sql: use diag_set() for errors in SQL imeevma
2019-02-15 17:14 ` [tarantool-patches] [PATCH v2 1/2] sql: remove field suppressErr from struct sql imeevma
@ 2019-02-15 17:14 ` imeevma
2019-02-18 12:14 ` [tarantool-patches] " n.pettik
2019-02-18 16:51 ` [tarantool-patches] Re: [PATCH v2 0/2] sql: use diag_set() for errors in SQL Kirill Yukhin
2 siblings, 1 reply; 6+ messages in thread
From: imeevma @ 2019-02-15 17:14 UTC (permalink / raw)
To: korablev; +Cc: tarantool-patches, kostja
Hi! Thank you for review. My answers and new version below. There
will not be diff between versions because the only meaningful fix
was turned into new patch in the patch-set.
On 2/15/19 3:44 PM, n.pettik wrote:
>
>> diff --git a/src/box/errcode.h b/src/box/errcode.h
>> index f7dbb94..e25e05c 100644
>> --- a/src/box/errcode.h
>> +++ b/src/box/errcode.h
>> @@ -87,7 +87,7 @@ struct errcode_record {
>> /* 32 */_(ER_PROC_LUA, "%s") \
>> /* 33 */_(ER_NO_SUCH_PROC, "Procedure '%.*s' is not defined") \
>> /* 34 */_(ER_NO_SUCH_TRIGGER, "Trigger '%s' doesn't exist") \
>> - /* 35 */_(ER_NO_SUCH_INDEX, "No index #%u is defined in space '%s'") \
>> + /* 35 */_(ER_NO_SUCH_INDEX_ID, "No index #%u is defined in space '%s'") \
>> /* 36 */_(ER_NO_SUCH_SPACE, "Space '%s' does not exist") \
>> /* 37 */_(ER_NO_SUCH_FIELD, "Field %d was not found in the tuple") \
>> /* 38 */_(ER_EXACT_FIELD_COUNT, "Tuple field count %u does not match space field count %u") \
>> @@ -200,12 +200,12 @@ struct errcode_record {
>> /*145 */_(ER_NO_SUCH_SEQUENCE, "Sequence '%s' does not exist") \
>> /*146 */_(ER_SEQUENCE_EXISTS, "Sequence '%s' already exists") \
>> /*147 */_(ER_SEQUENCE_OVERFLOW, "Sequence '%s' has overflowed") \
>> - /*148 */_(ER_UNUSED5, "") \
>> + /*148 */_(ER_NO_SUCH_INDEX_NAME, "No index '%s' is defined in space '%s'") \
>
> I’d better say ’No index with name …’.
> But it is to be discussed.
>
>
Left it as it is for now. I think it still need to be discussed.
>> /*149 */_(ER_SPACE_FIELD_IS_DUPLICATE, "Space field '%s' is duplicate") \
>> /*150 */_(ER_CANT_CREATE_COLLATION, "Failed to initialize collation: %s.") \
>> /*151 */_(ER_WRONG_COLLATION_OPTIONS, "Wrong collation options (field %u): %s") \
>> /*152 */_(ER_NULLABLE_PRIMARY, "Primary index of the space '%s' can not contain nullable parts") \
>> - /*153 */_(ER_UNUSED, "") \
>> + /*153 */_(ER_NO_SUCH_FIELD_NAME, "Field '%s' doesn't exist") \
>
> Mb it is better to split this error into two:
> “Space %s doesn’t feature field with name %s” and
> “Unresolved column name %s”
>
> Again, I’m neither SQL expert nor technical writer, so it is not up to me.
>
Left it as it is for now. But I will leave a comment about this
problem to resolve it in future versions.
>> diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h
>> index 7f17fd8..daeb02c 100644
>> --- a/src/box/sql/sqlInt.h
>> +++ b/src/box/sql/sqlInt.h
>> @@ -3270,6 +3270,14 @@ int sqlKeywordCode(const unsigned char *, int);
>> int sqlRunParser(Parse *, const char *, char **);
>>
>> /**
>> + * Increment error counter if error suppression isn't set.
>> + *
>> + * @param parse_context Current parsing context.
>> + */
>> +void
>> +sql_parser_error(struct Parse *parse_context);
>
> I suggest to incapsulate call of diag set inside this
> function. To achieve this, lets make function take
> variadic params. It would allow us to reduce size
> of refactored code, at least.
>
Left it as it is for now. I think this also need to be discussed.
>> +
>> +/**
>> * This routine is called after a single SQL statement has been
>> * parsed and a VDBE program to execute that statement has been
>> * prepared. This routine puts the finishing touches on the
>> diff --git a/src/box/sql/update.c b/src/box/sql/update.c
>> index ba24283..d203604 100644
>> --- a/src/box/sql/update.c
>> +++ b/src/box/sql/update.c
>> @@ -191,8 +191,9 @@ sqlUpdate(Parse * pParse, /* The parser context */
>> }
>> }
>> if (j >= (int)def->field_count) {
>> - sqlErrorMsg(pParse, "no such column: %s",
>> - pChanges->a[i].zName);
>> + diag_set(ClientError, ER_NO_SUCH_FIELD_NAME,
>> + pChanges->a[i].zName);
>> + sql_parser_error(pParse);
>> goto update_cleanup;
>> }
>> }
>> diff --git a/src/box/sql/util.c b/src/box/sql/util.c
>> index dadae18..ad7bb1e 100644
>> --- a/src/box/sql/util.c
>> +++ b/src/box/sql/util.c
>> @@ -246,6 +246,16 @@ sqlErrorMsg(Parse * pParse, const char *zFormat, ...)
>> }
>> }
>>
>> +void
>> +sql_parser_error(struct Parse *parse_context)
>> +{
>> + if (parse_context->db->suppressErr)
>> + return;
>
> As Konstantin pointed out, seems like we don’t need
> taking into consideration suppressErr here.
>
Removed in previous patch of the patch-set.
>> + parse_context->nErr++;
>> + parse_context->rc = SQL_TARANTOOL_ERROR;
>> +}
>> +
>> +
>
> Extra blank line.
>
Fixed.
>> diff --git a/test/sql/checks.result b/test/sql/checks.result
>> index 12a3aa1..2eafae8 100644
>> --- a/test/sql/checks.result
>> +++ b/test/sql/checks.result
>> @@ -111,11 +111,11 @@ s = box.space._space:insert(t)
>> --
>> box.sql.execute("CREATE TABLE w2 (s1 INT PRIMARY KEY, CHECK ((SELECT COUNT(*) FROM w2) = 0));")
>> ---
>> -- error: 'Failed to create space ''W2'': SQL error: no such table: W2'
>> +- error: 'Failed to create space ''W2'': Space ''W2'' does not exist’
>
> Hm, IMHO looks a bit misleading.
> Could we improve error reporting in this case?
> It would be nice to see smth like “name cannot be resolved” or
> “Misuse of space forward declaration”.
>
Left it as it is for now. But I will leave a comment about this
problem to resolve it in future versions.
New version:
commit 03c4d38a6b676a41d9b9cb094479c90d9a99c12d
Author: Mergen Imeev <imeevma@gmail.com>
Date: Thu Feb 14 20:43:17 2019 +0300
sql: rework "no such object" and "object exists" errors
This patch reworks SQL errors of types "no such object" and
"object exists". After this patch, these error will be set as
Tarantool errors.
Part of #3965
diff --git a/src/box/errcode.h b/src/box/errcode.h
index f7dbb94..e25e05c 100644
--- a/src/box/errcode.h
+++ b/src/box/errcode.h
@@ -87,7 +87,7 @@ struct errcode_record {
/* 32 */_(ER_PROC_LUA, "%s") \
/* 33 */_(ER_NO_SUCH_PROC, "Procedure '%.*s' is not defined") \
/* 34 */_(ER_NO_SUCH_TRIGGER, "Trigger '%s' doesn't exist") \
- /* 35 */_(ER_NO_SUCH_INDEX, "No index #%u is defined in space '%s'") \
+ /* 35 */_(ER_NO_SUCH_INDEX_ID, "No index #%u is defined in space '%s'") \
/* 36 */_(ER_NO_SUCH_SPACE, "Space '%s' does not exist") \
/* 37 */_(ER_NO_SUCH_FIELD, "Field %d was not found in the tuple") \
/* 38 */_(ER_EXACT_FIELD_COUNT, "Tuple field count %u does not match space field count %u") \
@@ -200,12 +200,12 @@ struct errcode_record {
/*145 */_(ER_NO_SUCH_SEQUENCE, "Sequence '%s' does not exist") \
/*146 */_(ER_SEQUENCE_EXISTS, "Sequence '%s' already exists") \
/*147 */_(ER_SEQUENCE_OVERFLOW, "Sequence '%s' has overflowed") \
- /*148 */_(ER_UNUSED5, "") \
+ /*148 */_(ER_NO_SUCH_INDEX_NAME, "No index '%s' is defined in space '%s'") \
/*149 */_(ER_SPACE_FIELD_IS_DUPLICATE, "Space field '%s' is duplicate") \
/*150 */_(ER_CANT_CREATE_COLLATION, "Failed to initialize collation: %s.") \
/*151 */_(ER_WRONG_COLLATION_OPTIONS, "Wrong collation options (field %u): %s") \
/*152 */_(ER_NULLABLE_PRIMARY, "Primary index of the space '%s' can not contain nullable parts") \
- /*153 */_(ER_UNUSED, "") \
+ /*153 */_(ER_NO_SUCH_FIELD_NAME, "Field '%s' doesn't exist") \
/*154 */_(ER_TRANSACTION_YIELD, "Transaction has been aborted by a fiber yield") \
/*155 */_(ER_NO_SUCH_GROUP, "Replication group '%s' does not exist") \
/*156 */_(ER_SQL_BIND_VALUE, "Bind value for parameter %s is out of range for type %s") \
@@ -227,6 +227,7 @@ struct errcode_record {
/*172 */_(ER_ROWID_OVERFLOW, "Rowid is overflowed: too many entries in ephemeral space") \
/*173 */_(ER_DROP_COLLATION, "Can't drop collation %s : %s") \
/*174 */_(ER_ILLEGAL_COLLATION_MIX, "Illegal mix of collations") \
+ /*175 */_(ER_SQL_NO_SUCH_PRAGMA, "Pragma '%s' does not exist") \
/*
* !IMPORTANT! Please follow instructions at start of the file
diff --git a/src/box/lua/schema.lua b/src/box/lua/schema.lua
index 0daf484..6049931 100644
--- a/src/box/lua/schema.lua
+++ b/src/box/lua/schema.lua
@@ -947,7 +947,7 @@ box.schema.index.alter = function(space_id, index_id, options)
box.error(box.error.NO_SUCH_SPACE, '#'..tostring(space_id))
end
if space.index[index_id] == nil then
- box.error(box.error.NO_SUCH_INDEX, index_id, space.name)
+ box.error(box.error.NO_SUCH_INDEX_ID, index_id, space.name)
end
if options == nil then
return
@@ -1175,7 +1175,7 @@ box.internal.check_index_arg = check_index_arg -- for net.box
local function check_primary_index(space)
local pk = space.index[0]
if pk == nil then
- box.error(box.error.NO_SUCH_INDEX, 0, space.name)
+ box.error(box.error.NO_SUCH_INDEX_ID, 0, space.name)
end
return pk
end
diff --git a/src/box/space.h b/src/box/space.h
index 7eb7ae2..ee5ffe6 100644
--- a/src/box/space.h
+++ b/src/box/space.h
@@ -263,7 +263,7 @@ index_find(struct space *space, uint32_t index_id)
{
struct index *index = space_index(space, index_id);
if (index == NULL) {
- diag_set(ClientError, ER_NO_SUCH_INDEX, index_id,
+ diag_set(ClientError, ER_NO_SUCH_INDEX_ID, index_id,
space_name(space));
diag_log();
}
diff --git a/src/box/sql/build.c b/src/box/sql/build.c
index e5bb4df..886b6b7 100644
--- a/src/box/sql/build.c
+++ b/src/box/sql/build.c
@@ -343,8 +343,8 @@ sqlStartTable(Parse *pParse, Token *pName, int noErr)
struct space *space = space_by_name(zName);
if (space != NULL) {
if (!noErr) {
- sqlErrorMsg(pParse, "table %s already exists",
- zName);
+ diag_set(ClientError, ER_SPACE_EXISTS, zName);
+ sql_parser_error(pParse);
} else {
assert(!db->init.busy || CORRUPT_DB);
}
@@ -461,7 +461,8 @@ sqlAddColumn(Parse * pParse, Token * pName, struct type_def *type_def)
sqlNormalizeName(z);
for (uint32_t i = 0; i < def->field_count; i++) {
if (strcmp(z, def->fields[i].name) == 0) {
- sqlErrorMsg(pParse, "duplicate column name: %s", z);
+ diag_set(ClientError, ER_SPACE_FIELD_IS_DUPLICATE, z);
+ sql_parser_error(pParse);
return;
}
}
@@ -1602,12 +1603,10 @@ sql_drop_table(struct Parse *parse_context, struct SrcList *table_name_list,
const char *space_name = table_name_list->a[0].zName;
struct space *space = space_by_name(space_name);
if (space == NULL) {
- if (!is_view && !if_exists)
- sqlErrorMsg(parse_context, "no such table: %s",
- space_name);
- if (is_view && !if_exists)
- sqlErrorMsg(parse_context, "no such view: %s",
- space_name);
+ if (!if_exists) {
+ diag_set(ClientError, ER_NO_SUCH_SPACE, space_name);
+ sql_parser_error(parse_context);
+ }
goto exit_drop_table;
}
/*
@@ -2187,9 +2186,8 @@ sql_create_index(struct Parse *parse, struct Token *token,
goto exit_create_index;
if (sql_space_index_by_name(space, name) != NULL) {
if (!if_not_exist) {
- sqlErrorMsg(parse,
- "index %s.%s already exists",
- def->name, name);
+ diag_set(ClientError, ER_INDEX_EXISTS, name);
+ sql_parser_error(parse);
}
goto exit_create_index;
}
@@ -2447,18 +2445,21 @@ sql_drop_index(struct Parse *parse_context, struct SrcList *index_name_list,
assert(table_token->n > 0);
struct space *space = space_by_name(table_name);
if (space == NULL) {
- if (!if_exists)
- sqlErrorMsg(parse_context, "no such space: %s",
- table_name);
+ if (!if_exists) {
+ diag_set(ClientError, ER_NO_SUCH_SPACE, table_name);
+ sql_parser_error(parse_context);
+ }
goto exit_drop_index;
}
const char *index_name = index_name_list->a[0].zName;
uint32_t index_id = box_index_id_by_name(space->def->id, index_name,
strlen(index_name));
if (index_id == BOX_ID_NIL) {
- if (!if_exists)
- sqlErrorMsg(parse_context, "no such index: %s.%s",
- table_name, index_name);
+ if (!if_exists) {
+ diag_set(ClientError, ER_NO_SUCH_INDEX_NAME,
+ index_name, table_name);
+ sql_parser_error(parse_context);
+ }
goto exit_drop_index;
}
struct index *index = space_index(space, index_id);
diff --git a/src/box/sql/delete.c b/src/box/sql/delete.c
index 4e35b61..95512ea 100644
--- a/src/box/sql/delete.c
+++ b/src/box/sql/delete.c
@@ -42,7 +42,8 @@ sql_lookup_space(struct Parse *parse, struct SrcList_item *space_name)
assert(space_name->space == NULL);
struct space *space = space_by_name(space_name->zName);
if (space == NULL) {
- sqlErrorMsg(parse, "no such table: %s", space_name->zName);
+ diag_set(ClientError, ER_NO_SUCH_SPACE, space_name->zName);
+ sql_parser_error(parse);
return NULL;
}
assert(space != NULL);
diff --git a/src/box/sql/expr.c b/src/box/sql/expr.c
index fd63f22..35145ce 100644
--- a/src/box/sql/expr.c
+++ b/src/box/sql/expr.c
@@ -3936,8 +3936,9 @@ sqlExprCodeTarget(Parse * pParse, Expr * pExpr, int target)
}
#endif
if (pDef == 0 || pDef->xFinalize != 0) {
- sqlErrorMsg(pParse,
- "unknown function: %s()", zId);
+ diag_set(ClientError, ER_NO_SUCH_FUNCTION,
+ zId);
+ sql_parser_error(pParse);
break;
}
diff --git a/src/box/sql/pragma.c b/src/box/sql/pragma.c
index f3e66f5..a82ec9b 100644
--- a/src/box/sql/pragma.c
+++ b/src/box/sql/pragma.c
@@ -453,7 +453,8 @@ sqlPragma(Parse * pParse, Token * pId, /* First part of [schema.]id field */
/* Locate the pragma in the lookup table */
pPragma = pragmaLocate(zLeft);
if (pPragma == 0) {
- sqlErrorMsg(pParse, "no such pragma: %s", zLeft);
+ diag_set(ClientError, ER_SQL_NO_SUCH_PRAGMA, zLeft);
+ sql_parser_error(pParse);
goto pragma_out;
}
/* Register the result column names for pragmas that return results */
diff --git a/src/box/sql/resolve.c b/src/box/sql/resolve.c
index a1212aa..bc208cc 100644
--- a/src/box/sql/resolve.c
+++ b/src/box/sql/resolve.c
@@ -425,16 +425,20 @@ lookupName(Parse * pParse, /* The parsing context */
* cnt==0 means there was not match. cnt>1 means there were two or
* more matches. Either way, we have an error.
*/
- if (cnt != 1) {
- const char *zErr;
- zErr = cnt == 0 ? "no such column" : "ambiguous column name";
+ if (cnt > 1) {
if (zTab) {
- sqlErrorMsg(pParse, "%s: %s.%s", zErr, zTab, zCol);
+ sqlErrorMsg(pParse, "ambiguous column name: %s.%s",
+ zTab, zCol);
} else {
- sqlErrorMsg(pParse, "%s: %s", zErr, zCol);
+ sqlErrorMsg(pParse, "ambiguous column name: %s", zCol);
}
pTopNC->nErr++;
}
+ if (cnt == 0) {
+ diag_set(ClientError, ER_NO_SUCH_FIELD_NAME, zCol);
+ sql_parser_error(pParse);
+ pTopNC->nErr++;
+ }
/* If a column from a table in pSrcList is referenced, then record
* this fact in the pSrcList.a[].colUsed bitmask. Column 0 causes
@@ -697,9 +701,8 @@ resolveExprStep(Walker * pWalker, Expr * pExpr)
&& pParse->explain == 0
#endif
) {
- sqlErrorMsg(pParse,
- "no such function: %.*s", nId,
- zId);
+ diag_set(ClientError, ER_NO_SUCH_FUNCTION, zId);
+ sql_parser_error(pParse);
pNC->nErr++;
} else if (wrong_num_args) {
sqlErrorMsg(pParse,
diff --git a/src/box/sql/select.c b/src/box/sql/select.c
index c90c46e..f469de5 100644
--- a/src/box/sql/select.c
+++ b/src/box/sql/select.c
@@ -4403,8 +4403,9 @@ sqlIndexedByLookup(Parse * pParse, struct SrcList_item *pFrom)
}
}
if (idx == NULL) {
- sqlErrorMsg(pParse, "no such index: %s", zIndexedBy,
- 0);
+ diag_set(ClientError, ER_NO_SUCH_INDEX_NAME,
+ zIndexedBy, space->def->name);
+ sql_parser_error(pParse);
return SQL_ERROR;
}
pFrom->pIBIndex = idx->def;
@@ -5024,9 +5025,10 @@ selectExpander(Walker * pWalker, Select * p)
}
if (!tableSeen) {
if (zTName) {
- sqlErrorMsg(pParse,
- "no such table: %s",
- zTName);
+ diag_set(ClientError,
+ ER_NO_SUCH_SPACE,
+ zTName);
+ sql_parser_error(pParse);
} else {
sqlErrorMsg(pParse,
"no tables specified");
diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h
index f6ac827..191f07b 100644
--- a/src/box/sql/sqlInt.h
+++ b/src/box/sql/sqlInt.h
@@ -3250,6 +3250,14 @@ int sqlKeywordCode(const unsigned char *, int);
int sqlRunParser(Parse *, const char *, char **);
/**
+ * Increment error counter.
+ *
+ * @param parse_context Current parsing context.
+ */
+void
+sql_parser_error(struct Parse *parse_context);
+
+/**
* This routine is called after a single SQL statement has been
* parsed and a VDBE program to execute that statement has been
* prepared. This routine puts the finishing touches on the
diff --git a/src/box/sql/update.c b/src/box/sql/update.c
index e64a106..cb303c1 100644
--- a/src/box/sql/update.c
+++ b/src/box/sql/update.c
@@ -190,8 +190,9 @@ sqlUpdate(Parse * pParse, /* The parser context */
}
}
if (j >= (int)def->field_count) {
- sqlErrorMsg(pParse, "no such column: %s",
- pChanges->a[i].zName);
+ diag_set(ClientError, ER_NO_SUCH_FIELD_NAME,
+ pChanges->a[i].zName);
+ sql_parser_error(pParse);
goto update_cleanup;
}
}
diff --git a/src/box/sql/util.c b/src/box/sql/util.c
index 0673cd5..c89e2e8 100644
--- a/src/box/sql/util.c
+++ b/src/box/sql/util.c
@@ -242,6 +242,13 @@ sqlErrorMsg(Parse * pParse, const char *zFormat, ...)
pParse->rc = SQL_ERROR;
}
+void
+sql_parser_error(struct Parse *parse_context)
+{
+ parse_context->nErr++;
+ parse_context->rc = SQL_TARANTOOL_ERROR;
+}
+
/*
* Convert an SQL-style quoted string into a normal string by removing
* the quote characters. The conversion is done in-place. If the
diff --git a/test/box/misc.result b/test/box/misc.result
index 97189ec..fce6c67 100644
--- a/test/box/misc.result
+++ b/test/box/misc.result
@@ -365,7 +365,7 @@ t;
32: box.error.PROC_LUA
33: box.error.NO_SUCH_PROC
34: box.error.NO_SUCH_TRIGGER
- 35: box.error.NO_SUCH_INDEX
+ 35: box.error.NO_SUCH_INDEX_ID
36: box.error.NO_SUCH_SPACE
37: box.error.NO_SUCH_FIELD
38: box.error.EXACT_FIELD_COUNT
@@ -477,10 +477,12 @@ t;
145: box.error.NO_SUCH_SEQUENCE
146: box.error.SEQUENCE_EXISTS
147: box.error.SEQUENCE_OVERFLOW
+ 148: box.error.NO_SUCH_INDEX_NAME
149: box.error.SPACE_FIELD_IS_DUPLICATE
150: box.error.CANT_CREATE_COLLATION
151: box.error.WRONG_COLLATION_OPTIONS
152: box.error.NULLABLE_PRIMARY
+ 153: box.error.NO_SUCH_FIELD_NAME
154: box.error.TRANSACTION_YIELD
155: box.error.NO_SUCH_GROUP
156: box.error.SQL_BIND_VALUE
@@ -502,6 +504,7 @@ t;
172: box.error.ROWID_OVERFLOW
173: box.error.DROP_COLLATION
174: box.error.ILLEGAL_COLLATION_MIX
+ 175: box.error.SQL_NO_SUCH_PRAGMA
...
test_run:cmd("setopt delimiter ''");
---
diff --git a/test/sql-tap/alter.test.lua b/test/sql-tap/alter.test.lua
index 1aad555..3b2eceb 100755
--- a/test/sql-tap/alter.test.lua
+++ b/test/sql-tap/alter.test.lua
@@ -403,7 +403,7 @@ test:do_catchsql_test(
SELECT * FROM t1;
]], {
-- <alter-7.6>
- 1, "no such table: T1"
+ 1, "Space 'T1' does not exist"
-- </alter-7.6>
})
diff --git a/test/sql-tap/analyzeF.test.lua b/test/sql-tap/analyzeF.test.lua
index 77d53a6..0df4db4 100755
--- a/test/sql-tap/analyzeF.test.lua
+++ b/test/sql-tap/analyzeF.test.lua
@@ -83,7 +83,7 @@ test:do_catchsql_test(
SELECT * FROM t1 WHERE x = substr('145', 2, 1) AND y = func(1, 2, 3);
]], {
-- <2.1>
- 1, "no such function: FUNC"
+ 1, "Function 'FUNC' does not exist"
-- </2.1>
})
@@ -93,7 +93,7 @@ test:do_catchsql_test(
UPDATE t1 SET y=y+1 WHERE x = substr('145', 2, 1) AND y = func(1, 2, 3)
]], {
-- <2.2>
- 1, "no such function: FUNC"
+ 1, "Function 'FUNC' does not exist"
-- </2.2>
})
diff --git a/test/sql-tap/check.test.lua b/test/sql-tap/check.test.lua
index ace35eb..d5c3f2c 100755
--- a/test/sql-tap/check.test.lua
+++ b/test/sql-tap/check.test.lua
@@ -344,7 +344,7 @@ test:do_catchsql_test(
);
]], {
-- <check-3.3>
- 1, "Failed to create space 'T3': SQL error: no such column: Q"
+ 1, "Failed to create space 'T3': Field 'Q' doesn't exist"
-- </check-3.3>
})
@@ -368,7 +368,7 @@ test:do_catchsql_test(
);
]], {
-- <check-3.5>
- 1, "Failed to create space 'T3': SQL error: no such column: T2.X"
+ 1, "Failed to create space 'T3': Field 'X' doesn't exist"
-- </check-3.5>
})
diff --git a/test/sql-tap/fkey2.test.lua b/test/sql-tap/fkey2.test.lua
index 03bf025..d347e5a 100755
--- a/test/sql-tap/fkey2.test.lua
+++ b/test/sql-tap/fkey2.test.lua
@@ -309,7 +309,7 @@ test:do_catchsql_test(
INSERT INTO t9 VALUES(1, 3);
]], {
-- <fkey2-1.29>
- 1, "no such table: T9"
+ 1, "Space 'T9' does not exist"
-- </fkey2-1.29>
})
diff --git a/test/sql-tap/func.test.lua b/test/sql-tap/func.test.lua
index e6b7956..2336fe1 100755
--- a/test/sql-tap/func.test.lua
+++ b/test/sql-tap/func.test.lua
@@ -2550,7 +2550,7 @@ test:do_test(
]])
end, {
-- <func-28.1>
- 1, "unknown function: NOSUCHFUNC()"
+ 1, "Function 'NOSUCHFUNC' does not exist"
-- </func-28.1>
})
diff --git a/test/sql-tap/gh-2367-pragma.test.lua b/test/sql-tap/gh-2367-pragma.test.lua
index c0792c9..d874bce 100755
--- a/test/sql-tap/gh-2367-pragma.test.lua
+++ b/test/sql-tap/gh-2367-pragma.test.lua
@@ -8,7 +8,7 @@ test:do_catchsql_test(
[[
PRAGMA kek = 'ON';
]], {
- 1, "no such pragma: KEK"
+ 1, "Pragma 'KEK' does not exist"
})
---
diff --git a/test/sql-tap/gh-2996-indexed-by.test.lua b/test/sql-tap/gh-2996-indexed-by.test.lua
index 7ee86be..1039ac1 100755
--- a/test/sql-tap/gh-2996-indexed-by.test.lua
+++ b/test/sql-tap/gh-2996-indexed-by.test.lua
@@ -60,7 +60,7 @@ test:do_catchsql_test(
"indexed-by-1.3",
"SELECT b FROM t1 INDEXED BY t1ix1 WHERE b <= 5", {
-- <indexed-by-1.3>
- 1, "no such index: T1IX1"
+ 1, "No index 'T1IX1' is defined in space 'T1'"
-- <indexed-by-1.3>
})
@@ -68,7 +68,7 @@ test:do_catchsql_test(
"indexed-by-1.4",
"SELECT b FROM t1 INDEXED BY t1ix2 WHERE b <= 5", {
-- <indexed-by-1.4>
- 1, "no such index: T1IX2"
+ 1, "No index 'T1IX2' is defined in space 'T1'"
-- <indexed-by-1.4>
})
@@ -103,7 +103,7 @@ test:do_catchsql_test(
"indexed-by-1.7",
"DELETE FROM t1 INDEXED BY t1ix1 WHERE b <= 5", {
-- <indexed-by-1.7>
- 1, "no such index: T1IX1"
+ 1, "No index 'T1IX1' is defined in space 'T1'"
-- <indexed-by-1.7>
})
@@ -111,7 +111,7 @@ test:do_catchsql_test(
"indexed-by-1.8",
"DELETE FROM t1 INDEXED BY t1ix2 WHERE b <= 5", {
-- <indexed-by-1.8>
- 1, "no such index: T1IX2"
+ 1, "No index 'T1IX2' is defined in space 'T1'"
-- <indexed-by-1.8>
})
@@ -145,7 +145,7 @@ test:do_catchsql_test(
"indexed-by-1.11",
"UPDATE t1 INDEXED BY t1ix1 SET b = 20 WHERE b = 10", {
-- <indexed-by-1.11>
- 1, "no such index: T1IX1"
+ 1, "No index 'T1IX1' is defined in space 'T1'"
-- <indexed-by-1.11>
})
@@ -153,7 +153,7 @@ test:do_catchsql_test(
"indexed-by-1.12",
"UPDATE t1 INDEXED BY t1ix2 SET b = 20 WHERE b = 10", {
-- <indexed-by-1.12>
- 1, "no such index: T1IX2"
+ 1, "No index 'T1IX2' is defined in space 'T1'"
-- <indexed-by-1.12>
})
diff --git a/test/sql-tap/gh2130-index-refer-table.test.lua b/test/sql-tap/gh2130-index-refer-table.test.lua
index b3bf519..99a7579 100755
--- a/test/sql-tap/gh2130-index-refer-table.test.lua
+++ b/test/sql-tap/gh2130-index-refer-table.test.lua
@@ -41,7 +41,7 @@ test:do_catchsql_test(
]],
{
-- <index-1.3>
- 1, "index T1.SAME_INDEX_NAME already exists"
+ 1, "Index 'SAME_INDEX_NAME' already exists"
-- <index-1.3>
})
@@ -52,7 +52,7 @@ test:do_catchsql_test(
]],
{
-- <index-1.4>
- 1, "index T2.SAME_INDEX_NAME already exists"
+ 1, "Index 'SAME_INDEX_NAME' already exists"
-- <index-1.4>
})
diff --git a/test/sql-tap/identifier_case.test.lua b/test/sql-tap/identifier_case.test.lua
index f26399e..923d5e6 100755
--- a/test/sql-tap/identifier_case.test.lua
+++ b/test/sql-tap/identifier_case.test.lua
@@ -75,7 +75,7 @@ data = {
{ 4, [[ "COLUMNN" ]], {0} },
{ 5, [[ "columnn" ]], {0} },
{ 6, [[ "Columnn" ]], {0} },
- { 7, [[ "columNN" ]], {1, "/duplicate column name/"} }
+ { 7, [[ "columNN" ]], {1, "Space field 'columNN' is duplicate"} }
}
for _, row in ipairs(data) do
diff --git a/test/sql-tap/in1.test.lua b/test/sql-tap/in1.test.lua
index e46ecb7..d32506c 100755
--- a/test/sql-tap/in1.test.lua
+++ b/test/sql-tap/in1.test.lua
@@ -220,7 +220,7 @@ test:do_catchsql_test(
SELECT a FROM t1 WHERE c IN (10,20)
]], {
-- <in-2.11>
- 1, "no such column: C"
+ 1, "Field 'C' doesn't exist"
-- </in-2.11>
})
diff --git a/test/sql-tap/in3.test.lua b/test/sql-tap/in3.test.lua
index 3f69a77..41f08c8 100755
--- a/test/sql-tap/in3.test.lua
+++ b/test/sql-tap/in3.test.lua
@@ -469,7 +469,7 @@ test:do_catchsql_test(
(SELECT folderid FROM Folder WHERE path LIKE 'C:\MP3\Albums\' || '%');
]], {
-- <in3-5.2>
- 1, "no such table: FOLDER"
+ 1, "Space 'FOLDER' does not exist"
-- </in3-5.2>
})
diff --git a/test/sql-tap/index-info.test.lua b/test/sql-tap/index-info.test.lua
index 17f7414..d052e8c 100755
--- a/test/sql-tap/index-info.test.lua
+++ b/test/sql-tap/index-info.test.lua
@@ -18,7 +18,7 @@ test:do_catchsql_test(
"index-info-1.1",
"PRAGMA index_xinfo (t1.a);",
{
- 1, "no such pragma: INDEX_XINFO",
+ 1, "Pragma 'INDEX_XINFO' does not exist",
})
-- Case: old index_info syntax is banned.
diff --git a/test/sql-tap/index1.test.lua b/test/sql-tap/index1.test.lua
index 117a4a5..3979fe0 100755
--- a/test/sql-tap/index1.test.lua
+++ b/test/sql-tap/index1.test.lua
@@ -97,7 +97,7 @@ test:do_test(
return test:catchsql "CREATE INDEX index1 ON test1(f4)"
end, {
-- <index-2.1b>
- 1, "no such column: F4"
+ 1, "Field 'F4' doesn't exist"
-- </index-2.1b>
})
@@ -115,7 +115,7 @@ test:do_test(
return table.insert(v,msg) or v
end, {
-- <index-2.2>
- 1, "no such column: F4"
+ 1, "Field 'F4' doesn't exist"
-- </index-2.2>
})
@@ -411,7 +411,7 @@ test:do_catchsql_test(
DROP INDEX index1 ON test1
]], {
-- <index-8.1>
- 1, "no such index: TEST1.INDEX1"
+ 1, "No index 'INDEX1' is defined in space 'TEST1'"
-- </index-8.1>
})
diff --git a/test/sql-tap/insert1.test.lua b/test/sql-tap/insert1.test.lua
index 86cb141..b1c8957 100755
--- a/test/sql-tap/insert1.test.lua
+++ b/test/sql-tap/insert1.test.lua
@@ -26,7 +26,7 @@ test:do_catchsql_test("insert-1.1", [[
INSERT INTO test1 VALUES(1,2,3)
]], {
-- <insert-1.1>
- 1, "no such table: TEST1"
+ 1, "Space 'TEST1' does not exist"
-- </insert-1.1>
})
@@ -240,7 +240,7 @@ end, {
SELECT * FROM t3 ORDER BY a;
]], {
-- <insert-4.3>
- 1, "no such column: T3.A"
+ 1, "Field 'A' doesn't exist"
-- </insert-4.3>
})
@@ -268,7 +268,7 @@ test:do_catchsql_test("insert-4.6", [[
INSERT INTO t3 VALUES(notafunc(2,3),2,3);
]], {
-- <insert-4.6>
- 1, "no such function: NOTAFUNC"
+ 1, "Function 'NOTAFUNC' does not exist"
-- </insert-4.6>
})
diff --git a/test/sql-tap/insert3.test.lua b/test/sql-tap/insert3.test.lua
index 1bcc71d..46f6399 100755
--- a/test/sql-tap/insert3.test.lua
+++ b/test/sql-tap/insert3.test.lua
@@ -172,7 +172,7 @@ test:do_catchsql_test(
INSERT INTO t3 (a,b,c)VALUES(1,2,3)
]], {
-- <insert3-3.2>
- 1, "no such column: NOSUCHCOL"
+ 1, "Field 'NOSUCHCOL' doesn't exist"
-- </insert3-3.2>
})
@@ -195,7 +195,7 @@ test:do_catchsql_test(
INSERT INTO t4 (a,b,c)VALUES(1,2,3)
]], {
-- <insert3-3.4>
- 1, "no such column: NOSUCHCOL"
+ 1, "Field 'NOSUCHCOL' doesn't exist"
-- </insert3-3.4>
})
diff --git a/test/sql-tap/join.test.lua b/test/sql-tap/join.test.lua
index fbcfb0c..b531bbd 100755
--- a/test/sql-tap/join.test.lua
+++ b/test/sql-tap/join.test.lua
@@ -580,7 +580,7 @@ test:do_catchsql_test(
SELECT * FROM t1 JOIN t2 ON t3.a=t2.b;
]], {
-- <join-3.6>
- 1, "no such column: T3.A"
+ 1, "Field 'A' doesn't exist"
-- </join-3.6>
})
diff --git a/test/sql-tap/limit.test.lua b/test/sql-tap/limit.test.lua
index 788823f..033a345 100755
--- a/test/sql-tap/limit.test.lua
+++ b/test/sql-tap/limit.test.lua
@@ -795,7 +795,7 @@ test:do_catchsql_test(
SELECT * FROM t1 LIMIT x
]], {
-- <limit-12.3>
- 1, "no such column: X"
+ 1, "Field 'X' doesn't exist"
-- </limit-12.3>
})
@@ -805,7 +805,7 @@ test:do_catchsql_test(
SELECT * FROM t1 LIMIT 1 OFFSET x
]], {
-- <limit-12.4>
- 1, "no such column: X"
+ 1, "Field 'X' doesn't exist"
-- </limit-12.4>
})
diff --git a/test/sql-tap/lua-tables.test.lua b/test/sql-tap/lua-tables.test.lua
index 409976b..aa10c70 100755
--- a/test/sql-tap/lua-tables.test.lua
+++ b/test/sql-tap/lua-tables.test.lua
@@ -40,7 +40,7 @@ test:do_execsql_test(
test:do_catchsql_test(
"lua-tables-4",
[[SELECT * from t1]],
- {1, "no such table: T1"}
+ {1, "Space 'T1' does not exist"}
)
test:do_catchsql_test(
diff --git a/test/sql-tap/lua_sql.test.lua b/test/sql-tap/lua_sql.test.lua
index 0ef0837..1b10b0b 100755
--- a/test/sql-tap/lua_sql.test.lua
+++ b/test/sql-tap/lua_sql.test.lua
@@ -53,7 +53,7 @@ test:do_test(
test:do_catchsql_test(
"lua_sql-1.0",
"select func3(1)",
- {1, "no such function: FUNC3"})
+ {1, "Function 'FUNC3' does not exist"})
-- check for different types
diff --git a/test/sql-tap/misc1.test.lua b/test/sql-tap/misc1.test.lua
index e9b5e1c..4358b58 100755
--- a/test/sql-tap/misc1.test.lua
+++ b/test/sql-tap/misc1.test.lua
@@ -423,7 +423,7 @@ test:do_catchsql_test(
SELECT t1.*;
]], {
-- <misc1-8.2>
- 1, "no such table: T1"
+ 1, "Space 'T1' does not exist"
-- </misc1-8.2>
})
@@ -887,7 +887,7 @@ test:do_catchsql_test(
CREATE TABLE test(a integer, primary key(a));
]], {
-- <misc1-16.2>
- 1, "table TEST already exists"
+ 1, "Space 'TEST' already exists"
-- </misc1-16.2>
})
diff --git a/test/sql-tap/select1.test.lua b/test/sql-tap/select1.test.lua
index 1aa157c..e21cf7b 100755
--- a/test/sql-tap/select1.test.lua
+++ b/test/sql-tap/select1.test.lua
@@ -13,7 +13,7 @@ test:do_catchsql_test(
SELECT * FROM test1
]], {
-- <select1-1.1>
- 1, "no such table: TEST1"
+ 1, "Space 'TEST1' does not exist"
-- </select1-1.1>
})
@@ -25,7 +25,7 @@ test:do_catchsql_test(
SELECT * FROM test1, test2
]], {
-- <select1-1.2>
- 1, "no such table: TEST2"
+ 1, "Space 'TEST2' does not exist"
-- </select1-1.2>
})
@@ -35,7 +35,7 @@ test:do_catchsql_test(
SELECT * FROM test2, test1
]], {
-- <select1-1.3>
- 1, "no such table: TEST2"
+ 1, "Space 'TEST2' does not exist"
-- </select1-1.3>
})
@@ -519,7 +519,7 @@ test:do_catchsql_test(
SELECT XYZZY(f1) FROM test1
]], {
-- <select1-2.18>
- 1, "no such function: XYZZY"
+ 1, "Function 'XYZZY' does not exist"
-- </select1-2.18>
})
@@ -1391,7 +1391,7 @@ test:do_catchsql2_test(
ORDER BY a;
]], {
-- <select1-6.23>
- 1,"no such column: X"
+ 1,"Field 'X' doesn't exist"
-- </select1-6.23>
})
@@ -1795,7 +1795,7 @@ test:do_catchsql_test(
SELECT t5.* FROM t3, t4;
]], {
-- <select1-11.10>
- 1, "no such table: T5"
+ 1, "Space 'T5' does not exist"
-- </select1-11.10>
})
@@ -1805,7 +1805,7 @@ test:do_catchsql_test(
SELECT t3.* FROM t3 AS x, t4;
]], {
-- <select1-11.11>
- 1, "no such table: T3"
+ 1, "Space 'T3' does not exist"
-- </select1-11.11>
})
diff --git a/test/sql-tap/select4.test.lua b/test/sql-tap/select4.test.lua
index 22dc599..bd2ada9 100755
--- a/test/sql-tap/select4.test.lua
+++ b/test/sql-tap/select4.test.lua
@@ -411,7 +411,7 @@ test:do_catchsql_test(
ORDER BY log;
]], {
-- <select4-5.1>
- 1, "no such table: T2"
+ 1, "Space 'T2' does not exist"
-- </select4-5.1>
})
diff --git a/test/sql-tap/select5.test.lua b/test/sql-tap/select5.test.lua
index 053e4c8..0d132db 100755
--- a/test/sql-tap/select5.test.lua
+++ b/test/sql-tap/select5.test.lua
@@ -88,7 +88,7 @@ test:do_catchsql_test(
SELECT y, count(*) FROM t1 GROUP BY z ORDER BY y
]], {
-- <select5-2.1.1>
- 1, "no such column: Z"
+ 1, "Field 'Z' doesn't exist"
-- </select5-2.1.1>
})
@@ -98,7 +98,7 @@ test:do_catchsql_test(
SELECT y, count(*) FROM t1 GROUP BY z(y) ORDER BY y
]], {
-- <select5-2.2>
- 1, "no such function: Z"
+ 1, "Function 'Z' does not exist"
-- </select5-2.2>
})
@@ -118,7 +118,7 @@ test:do_catchsql_test(
SELECT y, count(*) FROM t1 GROUP BY y HAVING z(y)<3 ORDER BY y
]], {
-- <select5-2.4>
- 1, "no such function: Z"
+ 1, "Function 'Z' does not exist"
-- </select5-2.4>
})
@@ -128,7 +128,7 @@ test:do_catchsql_test(
SELECT y, count(*) FROM t1 GROUP BY y HAVING count(*)<z ORDER BY y
]], {
-- <select5-2.5>
- 1, "no such column: Z"
+ 1, "Field 'Z' doesn't exist"
-- </select5-2.5>
})
diff --git a/test/sql-tap/table.test.lua b/test/sql-tap/table.test.lua
index 851e574..2bcc5aa 100755
--- a/test/sql-tap/table.test.lua
+++ b/test/sql-tap/table.test.lua
@@ -131,7 +131,7 @@ test:do_test(
return test:catchsql "CREATE TABLE test2(id primary key, two text default 'hi')"
end, {
-- <table-2.1>
- 1, "table TEST2 already exists"
+ 1, "Space 'TEST2' already exists"
-- </table-2.1>
})
@@ -266,7 +266,7 @@ test:do_catchsql_test(
CREATE TABLE BIG(xyz int primary key)
]], {
-- <table-3.2>
- 1, "table BIG already exists"
+ 1, "Space 'BIG' already exists"
-- </table-3.2>
})
@@ -276,7 +276,7 @@ test:do_catchsql_test(
CREATE TABLE biG(xyz int primary key)
]], {
-- <table-3.3>
- 1, "table BIG already exists"
+ 1, "Space 'BIG' already exists"
-- </table-3.3>
})
@@ -286,7 +286,7 @@ test:do_catchsql_test(
CREATE TABLE bIg(xyz int primary key)
]], {
-- <table-3.4>
- 1, "table BIG already exists"
+ 1, "Space 'BIG' already exists"
-- </table-3.4>
})
@@ -377,7 +377,7 @@ test:do_catchsql_test(
DROP TABLE test009
]], {
-- <table-5.1.1>
- 1, "no such table: TEST009"
+ 1, "Space 'TEST009' does not exist"
-- </table-5.1.1>
})
@@ -650,7 +650,7 @@ test:do_catchsql_test(
SELECT * FROM t5;
]], {
-- <table-8.7>
- 1, "no such table: T5"
+ 1, "Space 'T5' does not exist"
-- </table-8.7>
})
@@ -697,7 +697,7 @@ test:do_catchsql_test(
CREATE TABLE t6(a int primary key,b int,a int);
]], {
-- <table-9.1>
- 1, "duplicate column name: A"
+ 1, "Space field 'A' is duplicate"
-- </table-9.1>
})
@@ -707,7 +707,7 @@ test:do_catchsql_test(
CREATE TABLE t6(a varchar(100) primary key, b blob, a integer);
]], {
-- <table-9.2>
- 1, "duplicate column name: A"
+ 1, "Space field 'A' is duplicate"
-- </table-9.2>
})
diff --git a/test/sql-tap/tkt-4ef7e3cfca.test.lua b/test/sql-tap/tkt-4ef7e3cfca.test.lua
index 29484dd..a30c45c 100755
--- a/test/sql-tap/tkt-4ef7e3cfca.test.lua
+++ b/test/sql-tap/tkt-4ef7e3cfca.test.lua
@@ -31,7 +31,7 @@ test:do_catchsql_test(
INSERT INTO x VALUES('assert');
]], {
-- <1.1>
- 1, "no such column: ABC.A"
+ 1, "Field 'A' doesn't exist"
-- </1.1>
})
diff --git a/test/sql-tap/tkt3346.test.lua b/test/sql-tap/tkt3346.test.lua
index 5774d29..bcd4d41 100755
--- a/test/sql-tap/tkt3346.test.lua
+++ b/test/sql-tap/tkt3346.test.lua
@@ -94,7 +94,7 @@ test:do_catchsql_test(
SELECT * FROM (SELECT a,b FROM t1 WHERE 1=x.a) AS x;
]], {
-- <tkt3346-2.1>
- 1, "no such column: X.A"
+ 1, "Field 'A' doesn't exist"
-- </tkt3346-2.1>
})
diff --git a/test/sql-tap/tkt3442.test.lua b/test/sql-tap/tkt3442.test.lua
index 8b03f6d..743045d 100755
--- a/test/sql-tap/tkt3442.test.lua
+++ b/test/sql-tap/tkt3442.test.lua
@@ -75,7 +75,7 @@ test:do_catchsql_test(
SELECT node FROM listhash WHERE id="5000" LIMIT 1;
]], {
-- <tkt3442-1.5>
- 1, "no such column: 5000"
+ 1, "Field '5000' doesn't exist"
-- </tkt3442-1.5>
})
diff --git a/test/sql-tap/triggerB.test.lua b/test/sql-tap/triggerB.test.lua
index 30207f0..24f75b7 100755
--- a/test/sql-tap/triggerB.test.lua
+++ b/test/sql-tap/triggerB.test.lua
@@ -60,7 +60,7 @@ test:do_catchsql_test(
INSERT INTO x VALUES(3,1,2);
]], {
-- <triggerB-2.1>
- 1, "no such column: WEN.X"
+ 1, "Field 'X' doesn't exist"
-- </triggerB-2.1>
})
@@ -73,7 +73,7 @@ test:do_catchsql_test(
UPDATE x SET y=y+1;
]], {
-- <triggerB-2.2>
- 1, "no such column: DLO.X"
+ 1, "Field 'X' doesn't exist"
-- </triggerB-2.2>
})
@@ -111,7 +111,7 @@ test:do_test(
]]
end, {
-- <triggerB-2.4>
- 1, "no such column: OLD.C"
+ 1, "Field 'C' doesn't exist"
-- </triggerB-2.4>
})
diff --git a/test/sql-tap/update.test.lua b/test/sql-tap/update.test.lua
index 5e242c0..c911969 100755
--- a/test/sql-tap/update.test.lua
+++ b/test/sql-tap/update.test.lua
@@ -25,7 +25,7 @@ test:do_catchsql_test("update-1.1", [[
UPDATE test1 SET f2=5 WHERE f1<1
]], {
-- <update-1.1>
- 1, "no such table: TEST1"
+ 1, "Space 'TEST1' does not exist"
-- </update-1.1>
})
@@ -58,7 +58,7 @@ test:do_catchsql_test("update-3.2", [[
UPDATE test1 SET f1=f3*2 WHERE f2==32
]], {
-- <update-3.2>
- 1, "no such column: F3"
+ 1, "Field 'F3' doesn't exist"
-- </update-3.2>
})
@@ -66,7 +66,7 @@ test:do_catchsql_test("update-3.3", [[
UPDATE test1 SET f1=test2.f1*2 WHERE f2==32
]], {
-- <update-3.3>
- 1, "no such column: TEST2.F1"
+ 1, "Field 'F1' doesn't exist"
-- </update-3.3>
})
@@ -74,7 +74,7 @@ test:do_catchsql_test("update-3.4", [[
UPDATE test1 SET f3=f1*2 WHERE f2==32
]], {
-- <update-3.4>
- 1, "no such column: F3"
+ 1, "Field 'F3' doesn't exist"
-- </update-3.4>
})
@@ -854,7 +854,7 @@ test:do_catchsql_test("update-9.1", [[
UPDATE test1 SET x=11 WHERE f1=1025
]], {
-- <update-9.1>
- 1, "no such column: X"
+ 1, "Field 'X' doesn't exist"
-- </update-9.1>
})
@@ -862,7 +862,7 @@ test:do_catchsql_test("update-9.2", [[
UPDATE test1 SET f1=x(11) WHERE f1=1025
]], {
-- <update-9.2>
- 1, "no such function: X"
+ 1, "Function 'X' does not exist"
-- </update-9.2>
})
@@ -870,7 +870,7 @@ test:do_catchsql_test("update-9.3", [[
UPDATE test1 SET f1=11 WHERE x=1025
]], {
-- <update-9.3>
- 1, "no such column: X"
+ 1, "Field 'X' doesn't exist"
-- </update-9.3>
})
@@ -878,7 +878,7 @@ test:do_catchsql_test("update-9.4", [[
UPDATE test1 SET f1=11 WHERE x(f1)=1025
]], {
-- <update-9.4>
- 1, "no such function: X"
+ 1, "Function 'X' does not exist"
-- </update-9.4>
})
diff --git a/test/sql-tap/view.test.lua b/test/sql-tap/view.test.lua
index 0824d9d..49916d6 100755
--- a/test/sql-tap/view.test.lua
+++ b/test/sql-tap/view.test.lua
@@ -69,7 +69,7 @@ if (0 > 0)
SELECT * FROM v1 ORDER BY a;
]], {
-- <view-1.2>
- 1, "no such table: v1"
+ 1, "Space 'V1' does not exist"
-- </view-1.2>
})
@@ -106,7 +106,7 @@ test:do_catchsql_test(
SELECT * FROM v1 ORDER BY a;
]], {
-- <view-1.4>
- 1, "no such table: V1"
+ 1, "Space 'V1' does not exist"
-- </view-1.4>
})
@@ -951,7 +951,7 @@ test:do_catchsql_test(
DROP VIEW nosuchview
]], {
-- <view-17.1>
- 1, "no such view: NOSUCHVIEW"
+ 1, "Space 'NOSUCHVIEW' does not exist"
-- </view-17.1>
})
diff --git a/test/sql-tap/with2.test.lua b/test/sql-tap/with2.test.lua
index d43076c..5b00dfd 100755
--- a/test/sql-tap/with2.test.lua
+++ b/test/sql-tap/with2.test.lua
@@ -537,7 +537,7 @@ test:do_catchsql_test("6.3.2", [[
INSERT INTO t2 SELECT a, b FROM abc;
]], {
-- <6.3>
- 1, "no such table: ABC"
+ 1, "Space 'ABC' does not exist"
-- </6.3>
})
@@ -600,7 +600,7 @@ test:do_catchsql_test("6.10", [[
SELECT * FROM x
]], {
-- <6.10>
- 1, "no such column: C"
+ 1, "Field 'C' doesn't exist"
-- </6.10>
})
diff --git a/test/sql/checks.result b/test/sql/checks.result
index 12a3aa1..2eafae8 100644
--- a/test/sql/checks.result
+++ b/test/sql/checks.result
@@ -111,11 +111,11 @@ s = box.space._space:insert(t)
--
box.sql.execute("CREATE TABLE w2 (s1 INT PRIMARY KEY, CHECK ((SELECT COUNT(*) FROM w2) = 0));")
---
-- error: 'Failed to create space ''W2'': SQL error: no such table: W2'
+- error: 'Failed to create space ''W2'': Space ''W2'' does not exist'
...
box.sql.execute("DROP TABLE w2;")
---
-- error: 'no such table: W2'
+- error: Space 'W2' does not exist
...
--
-- gh-3653: Dissallow bindings for DDL
diff --git a/test/sql/delete.result b/test/sql/delete.result
index 9071434..e024dd6 100644
--- a/test/sql/delete.result
+++ b/test/sql/delete.result
@@ -44,7 +44,7 @@ box.sql.execute("DROP TABLE t1;");
--
box.sql.execute("DELETE FROM t1;")
---
-- error: 'no such table: T1'
+- error: Space 'T1' does not exist
...
box.sql.execute("CREATE TABLE t2 (s1 INT PRIMARY KEY);")
---
@@ -54,7 +54,7 @@ box.sql.execute("CREATE TRIGGER t2 BEFORE INSERT ON t2 BEGIN DELETE FROM t1; END
...
box.sql.execute("INSERT INTO t2 VALUES (0);")
---
-- error: 'no such table: T1'
+- error: Space 'T1' does not exist
...
box.sql.execute("DROP TABLE t2;")
---
diff --git a/test/sql/drop-table.result b/test/sql/drop-table.result
index 29318a8..0e14d8a 100644
--- a/test/sql/drop-table.result
+++ b/test/sql/drop-table.result
@@ -27,7 +27,7 @@ box.sql.execute("DROP TABLE zzzoobar")
-- Table does not exist anymore. Should error here.
box.sql.execute("INSERT INTO zzzoobar VALUES (111, 222, 'c3', 444)")
---
-- error: 'no such table: ZZZOOBAR'
+- error: Space 'ZZZOOBAR' does not exist
...
-- gh-3712: if space features sequence, data from _sequence_data
-- must be deleted before space is dropped.
@@ -92,7 +92,7 @@ box.sql.execute('CREATE TABLE t1 (id INT PRIMARY KEY, a INT)')
-- Error: no such table.
box.sql.execute('DROP TABLE t1')
---
-- error: 'no such table: T1'
+- error: Space 'T1' does not exist
...
box.session.su('admin')
---
diff --git a/test/sql/gh-2929-primary-key.result b/test/sql/gh-2929-primary-key.result
index 5d95d41..aa91813 100644
--- a/test/sql/gh-2929-primary-key.result
+++ b/test/sql/gh-2929-primary-key.result
@@ -40,5 +40,5 @@ box.sql.execute("DROP TABLE t1")
--
box.sql.execute("CREATE TABLE tx (a INT, PRIMARY KEY (b));")
---
-- error: 'no such column: B'
+- error: Field 'B' doesn't exist
...
diff --git a/test/sql/gh-3613-idx-alter-update.result b/test/sql/gh-3613-idx-alter-update.result
index ac62b5f..2815428 100644
--- a/test/sql/gh-3613-idx-alter-update.result
+++ b/test/sql/gh-3613-idx-alter-update.result
@@ -28,7 +28,7 @@ box.snapshot()
test_run:cmd('restart server default')
box.sql.execute('DROP INDEX i ON j3')
---
-- error: 'no such index: J3.I'
+- error: No index 'I' is defined in space 'J3'
...
box.sql.execute('CREATE INDEX i ON j3 (s1)')
---
diff --git a/test/sql/gh-3888-values-blob-assert.result b/test/sql/gh-3888-values-blob-assert.result
index 75152bb..95a81c7 100644
--- a/test/sql/gh-3888-values-blob-assert.result
+++ b/test/sql/gh-3888-values-blob-assert.result
@@ -34,12 +34,12 @@ box.sql.execute('SELECT float')
-- check 'VALUES' against ID (should fail)
box.sql.execute('VALUES(TheColumnName)')
---
-- error: 'no such column: THECOLUMNNAME'
+- error: Field 'THECOLUMNNAME' doesn't exist
...
-- check 'SELECT' against ID (should fail)
box.sql.execute('SELECT TheColumnName')
---
-- error: 'no such column: THECOLUMNNAME'
+- error: Field 'THECOLUMNNAME' doesn't exist
...
-- check 'VALUES' well-formed expression (returns value)
box.sql.execute('VALUES(-0.5e-2)')
diff --git a/test/sql/icu-upper-lower.result b/test/sql/icu-upper-lower.result
index 6ca44b9..0ecfd23 100644
--- a/test/sql/icu-upper-lower.result
+++ b/test/sql/icu-upper-lower.result
@@ -163,7 +163,7 @@ box.sql.execute("select upper('1', 2)")
...
box.sql.execute("select upper(\"1\")")
---
-- error: 'no such column: 1'
+- error: Field '1' doesn't exist
...
box.sql.execute("select upper()")
---
diff --git a/test/sql/iproto.result b/test/sql/iproto.result
index b0736b0..562e068 100644
--- a/test/sql/iproto.result
+++ b/test/sql/iproto.result
@@ -92,7 +92,7 @@ cn:execute('delete from test where a = 12')
-- SQL errors.
cn:execute('insert into not_existing_table values ("kek")')
---
-- error: 'Failed to execute SQL statement: no such table: NOT_EXISTING_TABLE'
+- error: 'Failed to execute SQL statement: Space ''NOT_EXISTING_TABLE'' does not exist'
...
cn:execute('insert qwerty gjsdjq q qwd qmq;; q;qwd;')
---
--
2.7.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* [tarantool-patches] Re: [PATCH v2 2/2] sql: rework "no such object" and "object exists" errors
2019-02-15 17:14 ` [tarantool-patches] [PATCH v2 2/2] sql: rework "no such object" and "object exists" errors imeevma
@ 2019-02-18 12:14 ` n.pettik
2019-02-19 15:04 ` Konstantin Osipov
0 siblings, 1 reply; 6+ messages in thread
From: n.pettik @ 2019-02-18 12:14 UTC (permalink / raw)
To: tarantool-patches; +Cc: Imeev Mergen, Konstantin Osipov, Kirill Yukhin
> On 15 Feb 2019, at 20:14, imeevma@tarantool.org wrote:
>
> Hi! Thank you for review. My answers and new version below. There
> will not be diff between versions because the only meaningful fix
> was turned into new patch in the patch-set.
Ok, if Konstantin and you consider my comments as minor ones,
then I don’t mind if this part is pushed to 2.1 (Travis is OK, refactoring
is obvious).
Kirill, could you do this?
^ permalink raw reply [flat|nested] 6+ messages in thread
* [tarantool-patches] Re: [PATCH v2 0/2] sql: use diag_set() for errors in SQL
2019-02-15 17:14 [tarantool-patches] [PATCH v2 0/2] sql: use diag_set() for errors in SQL imeevma
2019-02-15 17:14 ` [tarantool-patches] [PATCH v2 1/2] sql: remove field suppressErr from struct sql imeevma
2019-02-15 17:14 ` [tarantool-patches] [PATCH v2 2/2] sql: rework "no such object" and "object exists" errors imeevma
@ 2019-02-18 16:51 ` Kirill Yukhin
2 siblings, 0 replies; 6+ messages in thread
From: Kirill Yukhin @ 2019-02-18 16:51 UTC (permalink / raw)
To: tarantool-patches; +Cc: korablev, kostja
Hello,
On 15 Feb 20:14, imeevma@tarantool.org wrote:
> The goal of this patch-set is to rework all SQL errors and make
> Tarantool ones from them.
>
> Difference from v1: Added patch that removes field suppressErr.
>
> https://github.com/tarantool/tarantool/issues/3965
> https://github.com/tarantool/tarantool/tree/imeevma/gh-3965-use-diag_set-to-describe-error
I've checked yout patch set into 2.1 branch.
--
Regards, Kirill Yukhin
^ permalink raw reply [flat|nested] 6+ messages in thread
* [tarantool-patches] Re: [PATCH v2 2/2] sql: rework "no such object" and "object exists" errors
2019-02-18 12:14 ` [tarantool-patches] " n.pettik
@ 2019-02-19 15:04 ` Konstantin Osipov
0 siblings, 0 replies; 6+ messages in thread
From: Konstantin Osipov @ 2019-02-19 15:04 UTC (permalink / raw)
To: tarantool-patches; +Cc: Imeev Mergen, Kirill Yukhin
* n.pettik <korablev@tarantool.org> [19/02/18 15:16]:
>
>
> > On 15 Feb 2019, at 20:14, imeevma@tarantool.org wrote:
> >
> > Hi! Thank you for review. My answers and new version below. There
> > will not be diff between versions because the only meaningful fix
> > was turned into new patch in the patch-set.
>
> Ok, if Konstantin and you consider my comments as minor ones,
> then I don’t mind if this part is pushed to 2.1 (Travis is OK, refactoring
> is obvious).
>
> Kirill, could you do this?
I assume your comments are being worked on in separate commits.
>
--
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-02-19 15:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-15 17:14 [tarantool-patches] [PATCH v2 0/2] sql: use diag_set() for errors in SQL imeevma
2019-02-15 17:14 ` [tarantool-patches] [PATCH v2 1/2] sql: remove field suppressErr from struct sql imeevma
2019-02-15 17:14 ` [tarantool-patches] [PATCH v2 2/2] sql: rework "no such object" and "object exists" errors imeevma
2019-02-18 12:14 ` [tarantool-patches] " n.pettik
2019-02-19 15:04 ` Konstantin Osipov
2019-02-18 16:51 ` [tarantool-patches] Re: [PATCH v2 0/2] sql: use diag_set() for errors in SQL Kirill Yukhin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox