Tarantool development patches archive
 help / color / mirror / Atom feed
* [tarantool-patches] [PATCH] sql: remove useless pragmas
@ 2019-02-06 12:18 Stanislav Zudin
  2019-02-06 13:21 ` [tarantool-patches] " n.pettik
  0 siblings, 1 reply; 6+ messages in thread
From: Stanislav Zudin @ 2019-02-06 12:18 UTC (permalink / raw)
  To: tarantool-patches, korablev; +Cc: Stanislav Zudin

The pragmas "query_only" and "read_uncommitted" didn't affect anything and were removed.

Closes #3733
---
Branch: https://github.com/tarantool/tarantool/tree/stanztt/gh-3733-obsolete-pragmas
Issue: https://github.com/tarantool/tarantool/issues/3733

 src/box/sql/pragma.h    | 10 ----------
 src/box/sql/sqliteInt.h |  3 ---
 2 files changed, 13 deletions(-)

diff --git a/src/box/sql/pragma.h b/src/box/sql/pragma.h
index e60801608..6b27f83c2 100644
--- a/src/box/sql/pragma.h
+++ b/src/box/sql/pragma.h
@@ -153,16 +153,6 @@ static const PragmaName aPragmaName[] = {
 	 /* iArg:      */ 0},
 #endif
 #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
-	{ /* zName:     */ "query_only",
-	 /* ePragTyp:  */ PragTyp_FLAG,
-	 /* ePragFlg:  */ PragFlg_Result0 | PragFlg_NoColumns1,
-	 /* ColNames:  */ 0, 0,
-	 /* iArg:      */ SQLITE_QueryOnly},
-	{ /* zName:     */ "read_uncommitted",
-	 /* ePragTyp:  */ PragTyp_FLAG,
-	 /* ePragFlg:  */ PragFlg_Result0 | PragFlg_NoColumns1,
-	 /* ColNames:  */ 0, 0,
-	 /* iArg:      */ SQLITE_ReadUncommitted},
 	{ /* zName:     */ "recursive_triggers",
 	 /* ePragTyp:  */ PragTyp_FLAG,
 	 /* ePragFlg:  */ PragFlg_Result0 | PragFlg_NoColumns1,
diff --git a/src/box/sql/sqliteInt.h b/src/box/sql/sqliteInt.h
index ee24e0337..db7a20aee 100644
--- a/src/box/sql/sqliteInt.h
+++ b/src/box/sql/sqliteInt.h
@@ -1575,16 +1575,13 @@ struct sqlite3 {
 #define SQLITE_WhereTrace     0x00008000       /* Debug info about optimizer's work */
 #define SQLITE_VdbeListing    0x00000400	/* Debug listings of VDBE programs */
 #define SQLITE_VdbeAddopTrace 0x00001000	/* Trace sqlite3VdbeAddOp() calls */
-#define SQLITE_ReadUncommitted 0x0004000	/* For shared-cache mode */
 #define SQLITE_ReverseOrder   0x00020000	/* Reverse unordered SELECTs */
 #define SQLITE_RecTriggers    0x00040000	/* Enable recursive triggers */
 #define SQLITE_AutoIndex      0x00100000	/* Enable automatic indexes */
 #define SQLITE_PreferBuiltin  0x00200000	/* Preference to built-in funcs */
 #define SQLITE_EnableTrigger  0x01000000	/* True to enable triggers */
 #define SQLITE_DeferFKs       0x02000000	/* Defer all FK constraints */
-#define SQLITE_QueryOnly      0x04000000	/* Disable database changes */
 #define SQLITE_VdbeEQP        0x08000000	/* Debug EXPLAIN QUERY PLAN */
-#define SQLITE_NoCkptOnClose  0x80000000	/* No checkpoint on close()/DETACH */
 
 /*
  * Bits of the sqlite3.dbOptFlags field that are used by the
-- 
2.17.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [tarantool-patches] Re: [PATCH] sql: remove useless pragmas
  2019-02-06 12:18 [tarantool-patches] [PATCH] sql: remove useless pragmas Stanislav Zudin
@ 2019-02-06 13:21 ` n.pettik
  2019-02-08 10:17   ` Stanislav Zudin
  0 siblings, 1 reply; 6+ messages in thread
From: n.pettik @ 2019-02-06 13:21 UTC (permalink / raw)
  To: tarantool-patches; +Cc: szudin



> On 6 Feb 2019, at 15:18, Stanislav Zudin <szudin@tarantool.org> wrote:
> 
> The pragmas "query_only" and "read_uncommitted" didn't affect anything and were removed.

Nit: please, fit commit message into 72 symbols.

What about “busy_timeout”? As I see from code it is also useless.
It may require to delete some code more code.

Moreover, last two arguments of index_list are still unused:

   386	void
   387	sql_pragma_index_list(struct Parse *parse, const char *tbl_name)
   388	{
...
   398			sqlite3VdbeMultiLoad(v, 1, "isisi", i, idx->def->name,
   399					     idx->def->opts.is_unique);

Function expects 5 args (int-string-int-string-int), but only three are passed.
Let’s remove them as well.

Finally, consider comment from P. Gulutzan and my answer attached to ticket.
In a nutshell, at least two points (except for notes above) should be fixed:
a) Raise an error if index_list accepts name of unexisting index;
b) Make sql_default_engine accept only string, not id.

You may expand current patch into patch-set.

> Closes #3733
> ---
> Branch: https://github.com/tarantool/tarantool/tree/stanztt/gh-3733-obsolete-pragmas
> Issue: https://github.com/tarantool/tarantool/issues/3733
> 
> src/box/sql/pragma.h    | 10 ----------
> src/box/sql/sqliteInt.h |  3 ---
> 2 files changed, 13 deletions(-)
> 
> diff --git a/src/box/sql/pragma.h b/src/box/sql/pragma.h
> index e60801608..6b27f83c2 100644
> --- a/src/box/sql/pragma.h
> +++ b/src/box/sql/pragma.h
> @@ -153,16 +153,6 @@ static const PragmaName aPragmaName[] = {
> 	 /* iArg:      */ 0},
> #endif
> #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
> -	{ /* zName:     */ "query_only",
> -	 /* ePragTyp:  */ PragTyp_FLAG,
> -	 /* ePragFlg:  */ PragFlg_Result0 | PragFlg_NoColumns1,
> -	 /* ColNames:  */ 0, 0,
> -	 /* iArg:      */ SQLITE_QueryOnly},
> -	{ /* zName:     */ "read_uncommitted",
> -	 /* ePragTyp:  */ PragTyp_FLAG,
> -	 /* ePragFlg:  */ PragFlg_Result0 | PragFlg_NoColumns1,
> -	 /* ColNames:  */ 0, 0,

Personally I would add very simple tests to make sure
that these pragmas can’t be used anymore.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [tarantool-patches] Re: [PATCH] sql: remove useless pragmas
  2019-02-06 13:21 ` [tarantool-patches] " n.pettik
@ 2019-02-08 10:17   ` Stanislav Zudin
  2019-02-08 14:03     ` n.pettik
  0 siblings, 1 reply; 6+ messages in thread
From: Stanislav Zudin @ 2019-02-08 10:17 UTC (permalink / raw)
  To: tarantool-patches, n.pettik

On 06.02.2019 16:21, n.pettik wrote:
>
>> On 6 Feb 2019, at 15:18, Stanislav Zudin <szudin@tarantool.org> wrote:
>>
>> The pragmas "query_only" and "read_uncommitted" didn't affect anything and were removed.
> Nit: please, fit commit message into 72 symbols.
Mea culpa
>
> What about “busy_timeout”? As I see from code it is also useless.
> It may require to delete some code more code.
It calls sqlite_busy_handler. Does this feature work?
>
> Moreover, last two arguments of index_list are still unused:
>
>     386	void
>     387	sql_pragma_index_list(struct Parse *parse, const char *tbl_name)
>     388	{
> ...
>     398			sqlite3VdbeMultiLoad(v, 1, "isisi", i, idx->def->name,
>     399					     idx->def->opts.is_unique);
>
> Function expects 5 args (int-string-int-string-int), but only three are passed.
> Let’s remove them as well.
Fixed.
>
> Finally, consider comment from P. Gulutzan and my answer attached to ticket.
> In a nutshell, at least two points (except for notes above) should be fixed:
> a) Raise an error if index_list accepts name of unexisting index;
> b) Make sql_default_engine accept only string, not id.
Done.
>
> You may expand current patch into patch-set.
>
>> Closes #3733
>> ---
>> Branch: https://github.com/tarantool/tarantool/tree/stanztt/gh-3733-obsolete-pragmas
>> Issue: https://github.com/tarantool/tarantool/issues/3733
>>
>> src/box/sql/pragma.h    | 10 ----------
>> src/box/sql/sqliteInt.h |  3 ---
>> 2 files changed, 13 deletions(-)
>>
>> diff --git a/src/box/sql/pragma.h b/src/box/sql/pragma.h
>> index e60801608..6b27f83c2 100644
>> --- a/src/box/sql/pragma.h
>> +++ b/src/box/sql/pragma.h
>> @@ -153,16 +153,6 @@ static const PragmaName aPragmaName[] = {
>> 	 /* iArg:      */ 0},
>> #endif
>> #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
>> -	{ /* zName:     */ "query_only",
>> -	 /* ePragTyp:  */ PragTyp_FLAG,
>> -	 /* ePragFlg:  */ PragFlg_Result0 | PragFlg_NoColumns1,
>> -	 /* ColNames:  */ 0, 0,
>> -	 /* iArg:      */ SQLITE_QueryOnly},
>> -	{ /* zName:     */ "read_uncommitted",
>> -	 /* ePragTyp:  */ PragTyp_FLAG,
>> -	 /* ePragFlg:  */ PragFlg_Result0 | PragFlg_NoColumns1,
>> -	 /* ColNames:  */ 0, 0,
> Personally I would add very simple tests to make sure
> that these pragmas can’t be used anymore.
>
Agreed.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [tarantool-patches] Re: [PATCH] sql: remove useless pragmas
  2019-02-08 10:17   ` Stanislav Zudin
@ 2019-02-08 14:03     ` n.pettik
  2019-02-08 16:46       ` Stanislav Zudin
  0 siblings, 1 reply; 6+ messages in thread
From: n.pettik @ 2019-02-08 14:03 UTC (permalink / raw)
  To: tarantool-patches; +Cc: szudin

[-- Attachment #1: Type: text/plain, Size: 643 bytes --]



> On 8 Feb 2019, at 13:17, Stanislav Zudin <szudin@tarantool.org> wrote:
> 
> On 06.02.2019 16:21, n.pettik wrote:
>> 
>>> On 6 Feb 2019, at 15:18, Stanislav Zudin <szudin@tarantool.org <mailto:szudin@tarantool.org>> wrote:
>>> 
>>> The pragmas "query_only" and "read_uncommitted" didn't affect anything and were removed.
>> Nit: please, fit commit message into 72 symbols.
> Mea culpa
>> 
>> What about “busy_timeout”? As I see from code it is also useless.
>> It may require to delete some code more code.
> It calls sqlite_busy_handler. Does this feature work?

No, it doesn’t. You can remove it in a separate patch.

[-- Attachment #2: Type: text/html, Size: 4171 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [tarantool-patches] Re: [PATCH] sql: remove useless pragmas
  2019-02-08 14:03     ` n.pettik
@ 2019-02-08 16:46       ` Stanislav Zudin
  2019-02-10 22:54         ` n.pettik
  0 siblings, 1 reply; 6+ messages in thread
From: Stanislav Zudin @ 2019-02-08 16:46 UTC (permalink / raw)
  To: n.pettik, tarantool-patches

On 08.02.2019 17:03, n.pettik wrote:
>
>
>> On 8 Feb 2019, at 13:17, Stanislav Zudin <szudin@tarantool.org 
>> <mailto:szudin@tarantool.org>> wrote:
>>
>> On 06.02.2019 16:21, n.pettik wrote:
>>>
>>>> On 6 Feb 2019, at 15:18, Stanislav Zudin <szudin@tarantool.org 
>>>> <mailto:szudin@tarantool.org>> wrote:
>>>>
>>>> The pragmas "query_only" and "read_uncommitted" didn't affect 
>>>> anything and were removed.
>>> Nit: please, fit commit message into 72 symbols.
>> Mea culpa
>>>
>>> What about “busy_timeout”? As I see from code it is also useless.
>>> It may require to delete some code more code.
>> It calls sqlite_busy_handler. Does this feature work?
>
> No, it doesn’t. You can remove it in a separate patch.

Below you'll find a commit with removed pragma busy_timeout:


The pragma "busy_timeout" is removed.
SQLite's busyHandler functionality and functions sqlite3_sleep(),
sqlite3OsSleep() were not used and were removed either.

Closes #3733
---
Branch: 
https://github.com/tarantool/tarantool/tree/stanztt/gh-3733-obsolete-pragmas
Issue: https://github.com/tarantool/tarantool/issues/3733

  src/box/sql/main.c      | 76 -----------------------------------------
  src/box/sql/os.c        |  6 ----
  src/box/sql/os.h        |  1 -
  src/box/sql/os_unix.c   | 18 ----------
  src/box/sql/pragma.c    | 23 ++++---------
  src/box/sql/pragma.h    |  8 -----
  src/box/sql/sqliteInt.h |  6 ----
  src/box/sql/vdbe.c      |  1 -
  8 files changed, 6 insertions(+), 133 deletions(-)

diff --git a/src/box/sql/main.c b/src/box/sql/main.c
index 8574d6464..5555cb48e 100644
--- a/src/box/sql/main.c
+++ b/src/box/sql/main.c
@@ -640,43 +640,6 @@ sqlite3ErrStr(int rc)
      return zErr;
  }

-/*
- * This routine implements a busy callback that sleeps and tries
- * again until a timeout value is reached.  The timeout value is
- * an integer number of milliseconds passed in as the first
- * argument.
- */
-static int
-sqliteDefaultBusyCallback(void *ptr,    /* Database connection */
-              int count)    /* Number of times table has been busy */
-{
-    sqlite3 *db = (sqlite3 *) ptr;
-    int timeout = ((sqlite3 *) ptr)->busyTimeout;
-    if ((count + 1) * 1000 > timeout) {
-        return 0;
-    }
-    sqlite3OsSleep(db->pVfs, 1000000);
-    return 1;
-}
-
-/*
- * This routine sets the busy callback for an Sqlite database to the
- * given callback function with the given argument.
- */
-int
-sqlite3_busy_handler(sqlite3 * db, int (*xBusy) (void *, int), void *pArg)
-{
-#ifdef SQLITE_ENABLE_API_ARMOR
-    if (!sqlite3SafetyCheckOk(db))
-        return SQLITE_MISUSE_BKPT;
-#endif
-    db->busyHandler.xFunc = xBusy;
-    db->busyHandler.pArg = pArg;
-    db->busyHandler.nBusy = 0;
-    db->busyTimeout = 0;
-    return SQLITE_OK;
-}
-
  #ifndef SQLITE_OMIT_PROGRESS_CALLBACK
  /*
   * This routine sets the progress callback for an Sqlite database to the
@@ -705,26 +668,6 @@ sqlite3_progress_handler(sqlite3 * db,
  }
  #endif

-/*
- * This routine installs a default busy handler that waits for the
- * specified number of milliseconds before returning 0.
- */
-int
-sqlite3_busy_timeout(sqlite3 * db, int ms)
-{
-#ifdef SQLITE_ENABLE_API_ARMOR
-    if (!sqlite3SafetyCheckOk(db))
-        return SQLITE_MISUSE_BKPT;
-#endif
-    if (ms > 0) {
-        sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void *)db);
-        db->busyTimeout = ms;
-    } else {
-        sqlite3_busy_handler(db, 0, 0);
-    }
-    return SQLITE_OK;
-}
-
  /*
   * Cause any pending operation to stop at its earliest opportunity.
   */
@@ -1676,25 +1619,6 @@ sqlite3IoerrnomemError(int lineno)
  }
  #endif

-/*
- * Sleep for a little while.  Return the amount of time slept.
- */
-int
-sqlite3_sleep(int ms)
-{
-    sqlite3_vfs *pVfs;
-    int rc;
-    pVfs = sqlite3_vfs_find(0);
-    if (pVfs == 0)
-        return 0;
-
-    /* This function works in milliseconds, but the underlying OsSleep()
-     * API uses microseconds. Hence the 1000's.
-     */
-    rc = (sqlite3OsSleep(pVfs, 1000 * ms) / 1000);
-    return rc;
-}
-
  /*
   * Enable or disable the extended result codes.
   */
diff --git a/src/box/sql/os.c b/src/box/sql/os.c
index 1fa6b332a..3840258dc 100644
--- a/src/box/sql/os.c
+++ b/src/box/sql/os.c
@@ -128,12 +128,6 @@ sqlite3OsRandomness(sqlite3_vfs * pVfs, int nByte, 
char *zBufOut)
      return pVfs->xRandomness(pVfs, nByte, zBufOut);
  }

-int
-sqlite3OsSleep(sqlite3_vfs * pVfs, int nMicro)
-{
-    return pVfs->xSleep(pVfs, nMicro);
-}
-
  int
  sqlite3OsGetLastError(sqlite3_vfs * pVfs)
  {
diff --git a/src/box/sql/os.h b/src/box/sql/os.h
index 947658300..c844fe7fa 100644
--- a/src/box/sql/os.h
+++ b/src/box/sql/os.h
@@ -146,7 +146,6 @@ int sqlite3OsUnfetch(sqlite3_file *, i64, void *);
   */
  int sqlite3OsOpen(sqlite3_vfs *, const char *, sqlite3_file *, int, 
int *);
  int sqlite3OsRandomness(sqlite3_vfs *, int, char *);
-int sqlite3OsSleep(sqlite3_vfs *, int);
  int sqlite3OsGetLastError(sqlite3_vfs *);
  int sqlite3OsCurrentTimeInt64(sqlite3_vfs *, sqlite3_int64 *);

diff --git a/src/box/sql/os_unix.c b/src/box/sql/os_unix.c
index b8816e0f9..2cbcd6db1 100644
--- a/src/box/sql/os_unix.c
+++ b/src/box/sql/os_unix.c
@@ -1988,23 +1988,6 @@ unixRandomness(sqlite3_vfs * NotUsed, int nBuf, 
char *zBuf)
      return nBuf;
  }

-/*
- * Sleep for a little while.  Return the amount of time slept.
- * The argument is the number of microseconds we want to sleep.
- * The return value is the number of microseconds of sleep actually
- * requested from the underlying operating system, a number which
- * might be greater than or equal to the argument, but not less
- * than the argument.
- */
-static int
-unixSleep(sqlite3_vfs * NotUsed, int microseconds)
-{
-    int seconds = (microseconds + 999999) / 1000000;
-    sleep(seconds);
-    UNUSED_PARAMETER(NotUsed);
-    return seconds * 1000000;
-}
-
  /* Fake system time in seconds since 1970. */
  int sqlite3_current_time = 0;

@@ -2078,7 +2061,6 @@ unixGetLastError(sqlite3_vfs * NotUsed, int 
NotUsed2, char *NotUsed3)
      unixOpen,             /* xOpen */                       \
      unixDelete,           /* xDelete */                     \
      unixRandomness,       /* xRandomness */                 \
-    unixSleep,            /* xSleep */                      \
      NULL,                 /* xCurrentTime */                \
      unixGetLastError,     /* xGetLastError */               \
      unixCurrentTimeInt64, /* xCurrentTimeInt64 */           \
diff --git a/src/box/sql/pragma.c b/src/box/sql/pragma.c
index 158e6269b..7391f034b 100644
--- a/src/box/sql/pragma.c
+++ b/src/box/sql/pragma.c
@@ -491,7 +491,6 @@ sqlite3Pragma(Parse * pParse, Token * pId,    /* 
First part of [schema.]id field */
          zRight = sqlite3NameFromToken(db, pValue);
      }
      zTable = sqlite3NameFromToken(db, pValue2);
-    db->busyHandler.nBusy = 0;

      /* Locate the pragma in the lookup table */
      pPragma = pragmaLocate(zLeft);
@@ -672,24 +671,14 @@ sqlite3Pragma(Parse * pParse, Token * pId, /* 
First part of [schema.]id field */
          break;
      }

-    /* *   PRAGMA busy_timeout *   PRAGMA busy_timeout = N *
-     *
-     * Call sqlite3_busy_timeout(db, N).  Return the current
-     * timeout value * if one is set.  If no busy handler
-     * or a different busy handler is set * then 0 is
-     * returned.  Setting the busy_timeout to 0 or negative *
-     * disables the timeout.
-     */
-    /* case PragTyp_BUSY_TIMEOUT */
      default:{
-            assert(pPragma->ePragTyp == PragTyp_BUSY_TIMEOUT);
-            if (zRight) {
-                sqlite3_busy_timeout(db, sqlite3Atoi(zRight));
-            }
-            returnSingleInt(v, db->busyTimeout);
-            break;
+        /* We shouldn't get here. */
+        diag_set(ClientError, ER_UNKNOWN);
+        pParse->rc = SQL_TARANTOOL_ERROR;
+        pParse->nErr++;
+        goto pragma_out;
          }
-    }            /* End of the PRAGMA switch */
+    }

      /* The following block is a no-op unless SQLITE_DEBUG is
       * defined. Its only * purpose is to execute assert()
diff --git a/src/box/sql/pragma.h b/src/box/sql/pragma.h
index 168c70561..2857390c4 100644
--- a/src/box/sql/pragma.h
+++ b/src/box/sql/pragma.h
@@ -5,7 +5,6 @@
   */

  /* The various pragma types */
-#define PragTyp_BUSY_TIMEOUT                   1
  #define PragTyp_CASE_SENSITIVE_LIKE            2
  #define PragTyp_COLLATION_LIST                 3
  #define PragTyp_FLAG                           5
@@ -67,8 +66,6 @@ static const char *const pragCName[] = {
      /*  26 */ "on_update",
      /*  27 */ "on_delete",
      /*  28 */ "match",
-    /* Used by: busy_timeout */
-    /*  29 */ "timeout",
  };

  /* Definitions of all built-in pragmas */
@@ -85,11 +82,6 @@ typedef struct PragmaName {
   * to be sorted. For more info see pragma_locate function.
   */
  static const PragmaName aPragmaName[] = {
-    { /* zName:     */ "busy_timeout",
-     /* ePragTyp:  */ PragTyp_BUSY_TIMEOUT,
-     /* ePragFlg:  */ PragFlg_Result0,
-     /* ColNames:  */ 29, 1,
-     /* iArg:      */ 0},
      { /* zName:     */ "case_sensitive_like",
       /* ePragTyp:  */ PragTyp_CASE_SENSITIVE_LIKE,
       /* ePragFlg:  */ PragFlg_NoColumns,
diff --git a/src/box/sql/sqliteInt.h b/src/box/sql/sqliteInt.h
index db7a20aee..50668b775 100644
--- a/src/box/sql/sqliteInt.h
+++ b/src/box/sql/sqliteInt.h
@@ -329,7 +329,6 @@ struct sqlite3_vfs {
                int flags, int *pOutFlags);
      int (*xDelete) (sqlite3_vfs *, const char *zName, int syncDir);
      int (*xRandomness) (sqlite3_vfs *, int nByte, char *zOut);
-    int (*xSleep) (sqlite3_vfs *, int microseconds);
      int (*xCurrentTime) (sqlite3_vfs *, double *);
      int (*xGetLastError) (sqlite3_vfs *, int, char *);
      /*
@@ -835,9 +834,6 @@ struct sqlite3_io_methods {
  int
  sqlite3_os_init(void);

-int
-sqlite3_busy_timeout(sqlite3 *, int ms);
-
  sqlite3_int64
  sqlite3_soft_heap_limit64(sqlite3_int64 N);

@@ -1554,8 +1550,6 @@ struct sqlite3 {
      unsigned nProgressOps;    /* Number of opcodes for progress 
callback */
  #endif
      Hash aFunc;        /* Hash table of connection functions */
-    BusyHandler busyHandler;    /* Busy callback */
-    int busyTimeout;    /* Busy handler timeout, in msec */
      int *pnBytesFreed;    /* If not NULL, increment this in DbFree() */
  };

diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c
index 9fc362f0a..481727b5e 100644
--- a/src/box/sql/vdbe.c
+++ b/src/box/sql/vdbe.c
@@ -666,7 +666,6 @@ int sqlite3VdbeExec(Vdbe *p)
      p->iCurrentTime = 0;
      assert(p->explain==0);
      p->pResultSet = 0;
-    db->busyHandler.nBusy = 0;
      if (db->u1.isInterrupted) goto abort_due_to_interrupt;
      sqlite3VdbeIOTraceSql(p);
  #ifndef SQLITE_OMIT_PROGRESS_CALLBACK
-- 
2.17.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [tarantool-patches] Re: [PATCH] sql: remove useless pragmas
  2019-02-08 16:46       ` Stanislav Zudin
@ 2019-02-10 22:54         ` n.pettik
  0 siblings, 0 replies; 6+ messages in thread
From: n.pettik @ 2019-02-10 22:54 UTC (permalink / raw)
  To: tarantool-patches; +Cc: szudin



> On 8 Feb 2019, at 19:46, Stanislav Zudin <szudin@tarantool.org> wrote:
> 
> On 08.02.2019 17:03, n.pettik wrote:
>> 
>> 
>>> On 8 Feb 2019, at 13:17, Stanislav Zudin <szudin@tarantool.org <mailto:szudin@tarantool.org>> wrote:
>>> 
>>> On 06.02.2019 16:21, n.pettik wrote:
>>>> 
>>>>> On 6 Feb 2019, at 15:18, Stanislav Zudin <szudin@tarantool.org <mailto:szudin@tarantool.org>> wrote:
>>>>> 
>>>>> The pragmas "query_only" and "read_uncommitted" didn't affect anything and were removed.
>>>> Nit: please, fit commit message into 72 symbols.
>>> Mea culpa
>>>> 
>>>> What about “busy_timeout”? As I see from code it is also useless.
>>>> It may require to delete some code more code.
>>> It calls sqlite_busy_handler. Does this feature work?
>> 
>> No, it doesn’t. You can remove it in a separate patch.
> 
> Below you'll find a commit with removed pragma busy_timeout:
> 

Please, fix commit message subject. I checked out your branch
and it turned out to be the same as in previous commit.

> The pragma "busy_timeout" is removed.
> SQLite's busyHandler functionality and functions sqlite3_sleep(),
> sqlite3OsSleep() were not used and were removed either.
> 
> Closes #3733
> ---
> Branch: https://github.com/tarantool/tarantool/tree/stanztt/gh-3733-obsolete-pragmas
> Issue: https://github.com/tarantool/tarantool/issues/3733
> 
>  src/box/sql/main.c      | 76 -----------------------------------------
>  src/box/sql/os.c        |  6 ----
>  src/box/sql/os.h        |  1 -
>  src/box/sql/os_unix.c   | 18 ----------
>  src/box/sql/pragma.c    | 23 ++++---------
>  src/box/sql/pragma.h    |  8 -----
>  src/box/sql/sqliteInt.h |  6 ----
>  src/box/sql/vdbe.c      |  1 -
>  8 files changed, 6 insertions(+), 133 deletions(-)
> 
> diff --git a/src/box/sql/main.c b/src/box/sql/main.c
> index 8574d6464..5555cb48e 100644
> --- a/src/box/sql/main.c
> +++ b/src/box/sql/main.c
> @@ -640,43 +640,6 @@ sqlite3ErrStr(int rc)
>      return zErr;
>  }

It seems that remains of busy_handle still exist in source (sqliteInt.h):

Macros SQLITE_FCNTL_BUSYHANDLER;
struct BusyHandler itself;
A couple of mentions in comments.

Please remove them as well.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-02-10 22:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-06 12:18 [tarantool-patches] [PATCH] sql: remove useless pragmas Stanislav Zudin
2019-02-06 13:21 ` [tarantool-patches] " n.pettik
2019-02-08 10:17   ` Stanislav Zudin
2019-02-08 14:03     ` n.pettik
2019-02-08 16:46       ` Stanislav Zudin
2019-02-10 22:54         ` n.pettik

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