[tarantool-patches] Re: [PATCH] sql: Remove 'BEGIN TRANSACTION'

  • From: "n.pettik" <korablev@xxxxxxxxxxxxx>
  • To: tarantool-patches@xxxxxxxxxxxxx
  • Date: Thu, 19 Jul 2018 03:24:08 +0300


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?

+++ 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.

Other related posts: