SQLite

Changes On Branch natsort
Login

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

Changes In Branch natsort Excluding Merge-Ins

This is equivalent to a diff from 85d3dc8c50 to cc56cbdb61

2020-04-16
11:35
Improve corruption detection in fts3 shadow tables earlier in order to prevent an assert() from failing. (check-in: a9ec8c8f80 user: dan tags: trunk)
2020-04-14
15:48
Add the UINT collating sequence extension. The implementation is copied out of the "natsort" branch. (check-in: 6f46c6e3e3 user: drh tags: trunk)
15:35
Change the name from NATSORT to UINT. Provide an OMIT compile-time option. (Leaf check-in: cc56cbdb61 user: drh tags: natsort)
15:24
Merge trunk enhancements. (check-in: f1c284dd1e user: drh tags: natsort)
2020-04-09
18:51
Merge recent trunk changes into the apple-osx branch. (Leaf check-in: d6fda470fe user: drh tags: apple-osx)
18:46
Merge recent trunk enhancements into the wal2 branch. (check-in: 6fb870625c user: drh tags: wal2)
18:44
Merge recent trunk enhancements into the begin-concurrent-pnu branch. (check-in: cedd138c74 user: drh tags: begin-concurrent-pnu)
18:29
Merge recent trunk enhancements into the begin-concurrent branch. (check-in: 92f71a88c4 user: drh tags: begin-concurrent)
15:31
When compiling the shell for WinRT, avoid using Win32 APIs that are unavailable. (check-in: 85d3dc8c50 user: mistachkin tags: trunk)
2020-04-07
15:07
Limit LIKE/GLOB pattern length to 100 bytes (default is 50K) when running dbsql cases in the fuzzcheck utility. (check-in: 10306118e8 user: drh tags: trunk)

Changes to src/main.c.
987
988
989
990
991
992
993














































994
995
996
997
998
999
1000
  UNUSED_PARAMETER(NotUsed);
  if( 0==r ){
    r = nKey1-nKey2;
  }
  return r;
}















































/*
** Return the ROWID of the most recent insert
*/
sqlite_int64 sqlite3_last_insert_rowid(sqlite3 *db){
#ifdef SQLITE_ENABLE_API_ARMOR
  if( !sqlite3SafetyCheckOk(db) ){
    (void)SQLITE_MISUSE_BKPT;







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







987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
  UNUSED_PARAMETER(NotUsed);
  if( 0==r ){
    r = nKey1-nKey2;
  }
  return r;
}

#ifndef SQLITE_OMIT_UINT_COLLSEQ
/*
** The UINT collating function that compares text byte-by-byte but compares
** digits in numeric order.
*/
static int uintCollFunc(
  void *notUsed,
  int nKey1, const void *pKey1,
  int nKey2, const void *pKey2
){
  const unsigned char *zA = (const unsigned char*)pKey1;
  const unsigned char *zB = (const unsigned char*)pKey2;
  int i=0, j=0, x;
  while( i<nKey1 && j<nKey2 ){
    x = zA[i] - zB[j];
    if( sqlite3Isdigit(zA[i]) ){
      int k;
      if( !sqlite3Isdigit(zB[j]) ) return x;
      while( i<nKey1 && zA[i]=='0' ){ i++; }
      while( j<nKey2 && zB[j]=='0' ){ j++; }
      k = 0;
      while( i+k<nKey1 && sqlite3Isdigit(zA[i+k])
             && j+k<nKey2 && sqlite3Isdigit(zB[j+k]) ){
        k++;
      }
      if( i+k<nKey1 && sqlite3Isdigit(zA[i+k]) ){
        return +1;
      }else if( j+k<nKey2 && sqlite3Isdigit(zB[j+k]) ){
        return -1;
      }else{
        x = memcmp(zA+i, zB+j, k);
        if( x ) return x;
        i += k;
        j += k;
      }
    }else if( x ){
      return x;
    }else{
      i++;
      j++;
    }
  }
  return (nKey1 - i) - (nKey2 - j);
}
#endif /* SQLITE_OMIT_UINT_COLLSEQ */

/*
** Return the ROWID of the most recent insert
*/
sqlite_int64 sqlite3_last_insert_rowid(sqlite3 *db){
#ifdef SQLITE_ENABLE_API_ARMOR
  if( !sqlite3SafetyCheckOk(db) ){
    (void)SQLITE_MISUSE_BKPT;
3204
3205
3206
3207
3208
3209
3210



3211
3212
3213
3214
3215
3216
3217
  ** functions:
  */
  createCollation(db, sqlite3StrBINARY, SQLITE_UTF8, 0, binCollFunc, 0);
  createCollation(db, sqlite3StrBINARY, SQLITE_UTF16BE, 0, binCollFunc, 0);
  createCollation(db, sqlite3StrBINARY, SQLITE_UTF16LE, 0, binCollFunc, 0);
  createCollation(db, "NOCASE", SQLITE_UTF8, 0, nocaseCollatingFunc, 0);
  createCollation(db, "RTRIM", SQLITE_UTF8, 0, rtrimCollFunc, 0);



  if( db->mallocFailed ){
    goto opendb_out;
  }

  /* Parse the filename/URI argument
  **
  ** Only allow sensible combinations of bits in the flags argument.  







>
>
>







3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
  ** functions:
  */
  createCollation(db, sqlite3StrBINARY, SQLITE_UTF8, 0, binCollFunc, 0);
  createCollation(db, sqlite3StrBINARY, SQLITE_UTF16BE, 0, binCollFunc, 0);
  createCollation(db, sqlite3StrBINARY, SQLITE_UTF16LE, 0, binCollFunc, 0);
  createCollation(db, "NOCASE", SQLITE_UTF8, 0, nocaseCollatingFunc, 0);
  createCollation(db, "RTRIM", SQLITE_UTF8, 0, rtrimCollFunc, 0);
#ifndef SQLITE_OMIT_UINT_COLLSEQ
  createCollation(db, "UINT", SQLITE_UTF8, 0, uintCollFunc, 0);
#endif
  if( db->mallocFailed ){
    goto opendb_out;
  }

  /* Parse the filename/URI argument
  **
  ** Only allow sensible combinations of bits in the flags argument.  
Changes to tool/omittest.tcl.
238
239
240
241
242
243
244

245
246
247
248
249
250
251
    SQLITE_OMIT_SUBQUERY \
    SQLITE_OMIT_TCL_VARIABLE \
    SQLITE_OMIT_TEMPDB \
    SQLITE_OMIT_TEST_CONTROL \
    SQLITE_OMIT_TRACE \
    SQLITE_OMIT_TRIGGER \
    SQLITE_OMIT_TRUNCATE_OPTIMIZATION \

    SQLITE_OMIT_UPSERT \
    SQLITE_OMIT_UTF16 \
    SQLITE_OMIT_VACUUM \
    SQLITE_OMIT_VIEW \
    SQLITE_OMIT_VIRTUALTABLE \
    SQLITE_OMIT_WAL \
    SQLITE_OMIT_WINDOWFUNC \







>







238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
    SQLITE_OMIT_SUBQUERY \
    SQLITE_OMIT_TCL_VARIABLE \
    SQLITE_OMIT_TEMPDB \
    SQLITE_OMIT_TEST_CONTROL \
    SQLITE_OMIT_TRACE \
    SQLITE_OMIT_TRIGGER \
    SQLITE_OMIT_TRUNCATE_OPTIMIZATION \
    SQLITE_OMIT_UINT_COLLSEQ \
    SQLITE_OMIT_UPSERT \
    SQLITE_OMIT_UTF16 \
    SQLITE_OMIT_VACUUM \
    SQLITE_OMIT_VIEW \
    SQLITE_OMIT_VIRTUALTABLE \
    SQLITE_OMIT_WAL \
    SQLITE_OMIT_WINDOWFUNC \