/ Check-in [bd06eeb8]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove an incorrect assert() statement from sqlite3Fts3Dequote().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: bd06eeb8d06237dc2d54d8a03e8bf525cb811c9e
User & Date: dan 2015-04-15 09:16:39
Context
2015-04-15
14:52
Add the --msvc command-line option to the releasetest.tcl script. This is only a partial merge from the winTest branch as the OS_TRACE changes are omitted. check-in: b8768f12 user: drh tags: trunk
14:26
Merge all recent trunk enhancements and fixes into the ota-update branch. check-in: 9bd3e445 user: drh tags: ota-update
14:14
Merge all recent trunk fixes and enhancements into the sessions branch. check-in: e65e65f9 user: drh tags: sessions
13:51
Merge recent trunk fixes and enhancements into the apple-osx branch. check-in: bfc7142a user: drh tags: apple-osx
09:16
Remove an incorrect assert() statement from sqlite3Fts3Dequote(). check-in: bd06eeb8 user: dan tags: trunk
08:37
Remove a branch that became unreachable due to one of the earlier check-ins today. check-in: fa0956ed user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ext/fts3/fts3.c.

309
310
311
312
313
314
315







316
317
318
319
320
321
322
...
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
#endif

static int fts3EvalNext(Fts3Cursor *pCsr);
static int fts3EvalStart(Fts3Cursor *pCsr);
static int fts3TermSegReaderCursor(
    Fts3Cursor *, const char *, int, int, Fts3MultiSegReader **);








/* 
** Write a 64-bit variable-length integer to memory starting at p[0].
** The length of data written will be between 1 and FTS3_VARINT_MAX bytes.
** The number of bytes written is returned.
*/
int sqlite3Fts3PutVarint(char *p, sqlite_int64 v){
  unsigned char *q = (unsigned char *) p;
................................................................................
  if( quote=='[' || quote=='\'' || quote=='"' || quote=='`' ){
    int iIn = 1;                  /* Index of next byte to read from input */
    int iOut = 0;                 /* Index of next byte to write to output */

    /* If the first byte was a '[', then the close-quote character is a ']' */
    if( quote=='[' ) quote = ']';  

    while( ALWAYS(z[iIn]) ){
      if( z[iIn]==quote ){
        if( z[iIn+1]!=quote ) break;
        z[iOut++] = quote;
        iIn += 2;
      }else{
        z[iOut++] = z[iIn++];
      }







>
>
>
>
>
>
>







 







|







309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
...
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
#endif

static int fts3EvalNext(Fts3Cursor *pCsr);
static int fts3EvalStart(Fts3Cursor *pCsr);
static int fts3TermSegReaderCursor(
    Fts3Cursor *, const char *, int, int, Fts3MultiSegReader **);

#ifndef SQLITE_AMALGAMATION
# if defined(SQLITE_DEBUG)
int sqlite3Fts3Always(int b) { assert( b ); return b; }
int sqlite3Fts3Never(int b)  { assert( !b ); return b; }
# endif
#endif

/* 
** Write a 64-bit variable-length integer to memory starting at p[0].
** The length of data written will be between 1 and FTS3_VARINT_MAX bytes.
** The number of bytes written is returned.
*/
int sqlite3Fts3PutVarint(char *p, sqlite_int64 v){
  unsigned char *q = (unsigned char *) p;
................................................................................
  if( quote=='[' || quote=='\'' || quote=='"' || quote=='`' ){
    int iIn = 1;                  /* Index of next byte to read from input */
    int iOut = 0;                 /* Index of next byte to write to output */

    /* If the first byte was a '[', then the close-quote character is a ']' */
    if( quote=='[' ) quote = ']';  

    while( z[iIn] ){
      if( z[iIn]==quote ){
        if( z[iIn+1]!=quote ) break;
        z[iOut++] = quote;
        iIn += 2;
      }else{
        z[iOut++] = z[iIn++];
      }

Changes to ext/fts3/fts3Int.h.

130
131
132
133
134
135
136





137
138
139
140
141
142
143
/*
** Macros indicating that conditional expressions are always true or
** false.
*/
#ifdef SQLITE_COVERAGE_TEST
# define ALWAYS(x) (1)
# define NEVER(X)  (0)





#else
# define ALWAYS(x) (x)
# define NEVER(x)  (x)
#endif

/*
** Internal types used by SQLite.







>
>
>
>
>







130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/*
** Macros indicating that conditional expressions are always true or
** false.
*/
#ifdef SQLITE_COVERAGE_TEST
# define ALWAYS(x) (1)
# define NEVER(X)  (0)
#elif defined(SQLITE_DEBUG)
# define ALWAYS(x) sqlite3Fts3Always((x)!=0)
# define NEVER(x) sqlite3Fts3Never((x)!=0)
int sqlite3Fts3Always(int b);
int sqlite3Fts3Never(int b);
#else
# define ALWAYS(x) (x)
# define NEVER(x)  (x)
#endif

/*
** Internal types used by SQLite.

Changes to test/fts3tok1.test.

105
106
107
108
109
110
111










112
113
114
  CREATE VIRTUAL TABLE tX USING fts3tokenize(nosuchtokenizer);
} {1 {unknown tokenizer: nosuchtokenizer}}

do_catchsql_test 2.1 {
  CREATE VIRTUAL TABLE t4 USING fts3tokenize;
  SELECT * FROM t4;
} {1 {SQL logic error or missing database}}












finish_test







>
>
>
>
>
>
>
>
>
>



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
  CREATE VIRTUAL TABLE tX USING fts3tokenize(nosuchtokenizer);
} {1 {unknown tokenizer: nosuchtokenizer}}

do_catchsql_test 2.1 {
  CREATE VIRTUAL TABLE t4 USING fts3tokenize;
  SELECT * FROM t4;
} {1 {SQL logic error or missing database}}

do_catchsql_test 2.2 {
  CREATE VIRTUAL TABLE t USING fts4(tokenize=simple""); 
} {0 {}}

ifcapable fts3_unicode {
  do_catchsql_test 2.3 {
    CREATE VIRTUAL TABLE u USING fts4(tokenize=unicode61""); 
  } {1 {unknown tokenizer}}
}


finish_test