Tarantool development patches archive
 help / color / mirror / Atom feed
From: Kirill Shcherbatov <kshcherbatov@tarantool.org>
To: tarantool-patches@freelists.org
Cc: "v.shpilevoy@tarantool.org" <v.shpilevoy@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH v1 1/1] sql: remove unnecessary templates for bindings
Date: Wed, 23 May 2018 18:42:31 +0300	[thread overview]
Message-ID: <061016d3-9a43-35f2-6989-8ab2742a99f3@tarantool.org> (raw)
In-Reply-To: <5c5e8260-38d6-1ae9-eb01-af25124b4dc5@tarantool.org>

> 1. As I said, it is syntax error, not unsupported format.
+++ b/src/box/sql/parse.y
@@ -896,9 +896,10 @@ term(A) ::= INTEGER(X). {
 expr(A) ::= VARIABLE(X).     {
   if( !(X.z[0]=='#' && sqlite3Isdigit(X.z[1])) ){
     u32 n = X.n;
+    Token t = X;
     spanExpr(&A, pParse, TK_VARIABLE, X);
     if (A.pExpr->u.zToken[0] == '?' && n > 1) {
-        sqlite3ErrorMsg(pParse, "Unsupported variable format");
+        sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &t);

> 2. Wrong alignment.
> 3. This function takes already valid identifier. Again - check this in the parser.
> 4. n > 1 is guaranteed by the checks above.
> 5. Why do you need !sqlite3Isalpha(z[1])? '1a' is valid identifier, but your check forbids it. Strictly
> speaking, any number is valid identifier too. So mayby I was wrong, lets allow ':NNNN' syntax. But here
> NNNN will be interpreted as name, not number. It should be documented.
+++ b/src/box/sql/expr.c
@@ -1139,13 +1139,6 @@ sqlite3ExprAssignVarNumber(Parse * pParse, Expr * pExpr, u32 n)
 				x = (ynVar) (++pParse->nVar);
 				doAdd = 1;
 			}
-			if (n > 1 && (!sqlite3Isalpha(z[1]) ||
-			     sqlite3CheckIdentifierName(pParse, &z[1]) !=
-			     SQLITE_OK)) {
-				sqlite3ErrorMsg(pParse,
-						"name '%s' is invalid identifier", z);
-				return;
-			}

> 6. I still do not see TarantoolBot request in the issue comments.

done.

  reply	other threads:[~2018-05-23 15:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16 17:14 [tarantool-patches] " Kirill Shcherbatov
2018-05-16 18:28 ` [tarantool-patches] " Vladislav Shpilevoy
2018-05-17 10:39   ` Kirill Shcherbatov
2018-05-17 11:56     ` Vladislav Shpilevoy
2018-05-23 15:42       ` Kirill Shcherbatov [this message]
2018-05-24 12:20         ` Vladislav Shpilevoy
2018-05-24 12:37           ` Kirill Shcherbatov
2018-05-24 14:51             ` Kirill Yukhin
2018-05-17 14:20 ` Konstantin Osipov
2018-05-18  5:55 ` Konstantin Osipov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=061016d3-9a43-35f2-6989-8ab2742a99f3@tarantool.org \
    --to=kshcherbatov@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='[tarantool-patches] Re: [PATCH v1 1/1] sql: remove unnecessary templates for bindings' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox