SQLite

Check-in [49ffbc11c5]
Login

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

Overview
Comment:Change the ICU tokenizer so that it does not attempt to call strlen(NULL). This is a cherry-pick of the fix in [04298f1ac42c40c] on 2012-03-31 first appearing in release 3.7.12.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | branch-3.7.9
Files: files | file ages | folders
SHA1: 49ffbc11c5ea7e3cefd0370f39832dbfc7276ffe
User & Date: drh 2012-10-15 23:15:45.151
Context
2012-10-25
17:21
Use a constant string "BINARY" for the unspecified collating sequence. This is part of check-in [635e3a762dd] that is being back-ported. (check-in: 9078ea75f5 user: drh tags: branch-3.7.9)
2012-10-15
23:15
Change the ICU tokenizer so that it does not attempt to call strlen(NULL). This is a cherry-pick of the fix in [04298f1ac42c40c] on 2012-03-31 first appearing in release 3.7.12. (check-in: 49ffbc11c5 user: drh tags: branch-3.7.9)
2012-10-05
19:10
Add QNX-specific performance tweaks to the unix VFS. (check-in: b02849e7bd user: drh tags: branch-3.7.9)
Changes
Unified Diff Ignore Whitespace Patch
Changes to ext/fts3/fts3_icu.c.
106
107
108
109
110
111
112



113
114
115
116
117
118
119
120

  UChar32 c;
  int iInput = 0;
  int iOut = 0;

  *ppCursor = 0;




  if( nInput<0 ){
    nInput = strlen(zInput);
  }
  nChar = nInput+1;
  pCsr = (IcuCursor *)sqlite3_malloc(
      sizeof(IcuCursor) +                /* IcuCursor */
      nChar * sizeof(UChar) +            /* IcuCursor.aChar[] */
      (nChar+1) * sizeof(int)            /* IcuCursor.aOffset[] */







>
>
>
|







106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123

  UChar32 c;
  int iInput = 0;
  int iOut = 0;

  *ppCursor = 0;

  if( zInput==0 ){
    nInput = 0;
    zInput = "";
  }else if( nInput<0 ){
    nInput = strlen(zInput);
  }
  nChar = nInput+1;
  pCsr = (IcuCursor *)sqlite3_malloc(
      sizeof(IcuCursor) +                /* IcuCursor */
      nChar * sizeof(UChar) +            /* IcuCursor.aChar[] */
      (nChar+1) * sizeof(int)            /* IcuCursor.aOffset[] */
Changes to test/fts3defer.test.
485
486
487
488
489
490
491


































492
493
  INSERT INTO x2 VALUES('a b c d e f g h i j k l m n o p q r s t u v w x y m');
  COMMIT;
}
do_execsql_test 4.2 {
  SELECT * FROM x2 WHERE x2 MATCH 'a b c d e f g h i j k l m n o p q r s';
} {{a b c d e f g h i j k l m n o p q r s t u v w x y m}}




































finish_test







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
  INSERT INTO x2 VALUES('a b c d e f g h i j k l m n o p q r s t u v w x y m');
  COMMIT;
}
do_execsql_test 4.2 {
  SELECT * FROM x2 WHERE x2 MATCH 'a b c d e f g h i j k l m n o p q r s';
} {{a b c d e f g h i j k l m n o p q r s t u v w x y m}}

set tokenizers {1 simple}
ifcapable icu { lappend tokenizers 2 {icu en_US} }
foreach {tn tokenizer} $tokenizers {
  do_execsql_test 5.$tn.1 "
    CREATE VIRTUAL TABLE x3 USING FTS4(a, b, TOKENIZE $tokenizer)
  "
  do_execsql_test 5.$tn.2 {
    BEGIN;
    INSERT INTO x3 VALUES('b b b b b b b b b b b', 'b b b b b b b b b b b b b');
    INSERT INTO x3 SELECT * FROM x3;
    INSERT INTO x3 SELECT * FROM x3;
    INSERT INTO x3 SELECT * FROM x3;
    INSERT INTO x3 SELECT * FROM x3;
    INSERT INTO x3 SELECT * FROM x3;
    INSERT INTO x3 SELECT * FROM x3;
    INSERT INTO x3 SELECT * FROM x3;
    INSERT INTO x3 SELECT * FROM x3;
    INSERT INTO x3 SELECT * FROM x3;
    INSERT INTO x3 SELECT * FROM x3;
    INSERT INTO x3 SELECT * FROM x3;
    INSERT INTO x3 SELECT * FROM x3;
    INSERT INTO x3 SELECT * FROM x3;
    INSERT INTO x3 SELECT * FROM x3;
    INSERT INTO x3 SELECT * FROM x3;
    INSERT INTO x3 SELECT * FROM x3;
    INSERT INTO x3 VALUES('a b c', NULL);
    INSERT INTO x3 VALUES('a x c', NULL);
    COMMIT;

    SELECT * FROM x3 WHERE x3 MATCH 'a b';
  } {{a b c} {}}

  do_execsql_test 5.$tn.3 { DROP TABLE x3 }
}

finish_test