чт, 19 июл. 2018 г. в 3:24, n.pettik <korablev@tarantool.org>:

diff --git a/extra/lempar.c b/extra/lempar.c
index 00fd79c..d043e39 100644
--- a/extra/lempar.c
+++ b/extra/lempar.c
@@ -336,8 +336,8 @@ void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE)){
   if( pParser ){
 #ifdef YYTRACKMAXSTACKDEPTH
     pParser->yyhwm = 0;
-    pParser->is_fallback_failed = false;
 #endif
+    pParser->is_fallback_failed = false;

Could you please explain this code movement?

"Also found
initialization in ifdef that caused some problems with error
messages in occasions when the wrong syntax was used."
To be more accurate it's just variable initialization that was in wrong place.
Moreover in most cases (almost always) after allocating memory for this
variable there was non-zero value ('true', basically), that was causing
"keyword 'BEGIN' is reserved" error message if we use "BEGIN" instead
of "START TRANSACTION", after the patch changes are applied.
 

+++ b/test/sql-tap/start-transaction.test.lua
@@ -0,0 +1,266 @@
+#!/usr/bin/env tarantool
+test = require("sqltester")
+test:plan(21)
+
+test:do_catchsql_test(
+ "start-transaction-1.0",
+ [[
+ CREATE TABLE IF NOT EXISTS t(id int PRIMARY KEY);
+ DELETE FROM t;
+ BEGIN;
+ INSERT INTO t VALUES (1);
+ INSERT INTO t VALUES (2);
+ COMMIT;
+ ]], {
+ -- <start-transaction-1.0>
+ 1, "near \"BEGIN\": syntax error"
+ -- <start-transaction-1.0>
+ })
+
+test:do_execsql_test(
+ "start-transaction-1.1",
+ [[
+ SELECT * FROM t;
+ ]], {
+ -- <start-transaction-1.1>
+
+ -- <start-transaction-1.1>
+ })
+
+test:do_catchsql_test(
+ "start-transaction-1.2",
+ [[
+ CREATE TABLE IF NOT EXISTS t(id int primary key);
+ delete from t;

We write SQL queries in upper-case. Fix it in other places too.

Fixed it.

Diff with the previous pushed patch:

diff --git a/test/sql-tap/start-transaction.test.lua b/test/sql-tap/start-transaction.test.lua
index eece4cd..98ca531 100755
--- a/test/sql-tap/start-transaction.test.lua
+++ b/test/sql-tap/start-transaction.test.lua
@@ -30,8 +30,8 @@ test:do_execsql_test(
 test:do_catchsql_test(
  "start-transaction-1.2",
  [[
- CREATE TABLE IF NOT EXISTS t(id int primary key);
- delete from t;
+ CREATE TABLE IF NOT EXISTS t(id INT PRIMARY KEY);
+ DELETE FROM t;
  BEGIN TRANSACTION;
  INSERT INTO t VALUES (1);
  INSERT INTO t VALUES (2);
@@ -256,7 +256,7 @@ test:do_execsql_test(
 test:do_execsql_test(
  "start-transaction-1.20",
  [[
- drop table t;
+ DROP TABLE t;
  ]], {
  -- <start0transaction-1.20>
 
diff --git a/test/sql/tokenizer.result b/test/sql/tokenizer.result
index 7c0ca8f..95063b5 100644
--- a/test/sql/tokenizer.result
+++ b/test/sql/tokenizer.result
@@ -102,9 +102,9 @@ sql_tokenizer.split_sql('select 1; -- test comment\n; select 2;')
 - - select 1;
   - ' select 2;'
 ...
-sql_tokenizer.split_sql("start transaction; insert into table values ('example kek--'); commit;")
+sql_tokenizer.split_sql("START TRANSACTION; insert into table values ('example kek--'); commit;")
 ---
-- - start transaction;
+- - START TRANSACTION;
   - ' insert into table values (''example kek--'');'
   - ' commit;'
 ...
diff --git a/test/sql/tokenizer.test.lua b/test/sql/tokenizer.test.lua
index 5c1cadc..4a4e289 100644
--- a/test/sql/tokenizer.test.lua
+++ b/test/sql/tokenizer.test.lua
@@ -32,7 +32,7 @@ test_run:cmd("setopt delimiter ''");
 
 sql_tokenizer.split_sql('select 1; -- test comment\n; select 2;')
 
-sql_tokenizer.split_sql("start transaction; insert into table values ('example kek--'); commit;")
+sql_tokenizer.split_sql("START TRANSACTION; insert into table values ('example kek--'); commit;")
 
 sql_tokenizer.split_sql("insert into quoted(a) value 'lalala'")