* n.pettik <korablev@xxxxxxxxxxxxx> [19/02/15 15:46]:
+ /*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.
+ /*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.
/**
+ * 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.
}
+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.
+ parse_context->nErr++;
+ parse_context->rc = SQL_TARANTOOL_ERROR;
+}
+
+
Extra blank line.
--
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”.