Skip to content

Commit 00dbcf0

Browse files
committed
Snapshot of upstream SQLite 3.38.5
1 parent 814b062 commit 00dbcf0

12 files changed

Lines changed: 152 additions & 33 deletions

File tree

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.38.3
1+
3.38.5

configure

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.69 for sqlite 3.38.3.
3+
# Generated by GNU Autoconf 2.69 for sqlite 3.38.5.
44
#
55
#
66
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -726,8 +726,8 @@ MAKEFLAGS=
726726
# Identity of this package.
727727
PACKAGE_NAME='sqlite'
728728
PACKAGE_TARNAME='sqlite'
729-
PACKAGE_VERSION='3.38.3'
730-
PACKAGE_STRING='sqlite 3.38.3'
729+
PACKAGE_VERSION='3.38.5'
730+
PACKAGE_STRING='sqlite 3.38.5'
731731
PACKAGE_BUGREPORT=''
732732
PACKAGE_URL=''
733733

@@ -1468,7 +1468,7 @@ if test "$ac_init_help" = "long"; then
14681468
# Omit some internal or obsolete options to make the list less imposing.
14691469
# This message is too long to be a string in the A/UX 3.1 sh.
14701470
cat <<_ACEOF
1471-
\`configure' configures sqlite 3.38.3 to adapt to many kinds of systems.
1471+
\`configure' configures sqlite 3.38.5 to adapt to many kinds of systems.
14721472
14731473
Usage: $0 [OPTION]... [VAR=VALUE]...
14741474
@@ -1533,7 +1533,7 @@ fi
15331533

15341534
if test -n "$ac_init_help"; then
15351535
case $ac_init_help in
1536-
short | recursive ) echo "Configuration of sqlite 3.38.3:";;
1536+
short | recursive ) echo "Configuration of sqlite 3.38.5:";;
15371537
esac
15381538
cat <<\_ACEOF
15391539
@@ -1661,7 +1661,7 @@ fi
16611661
test -n "$ac_init_help" && exit $ac_status
16621662
if $ac_init_version; then
16631663
cat <<\_ACEOF
1664-
sqlite configure 3.38.3
1664+
sqlite configure 3.38.5
16651665
generated by GNU Autoconf 2.69
16661666
16671667
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2080,7 +2080,7 @@ cat >config.log <<_ACEOF
20802080
This file contains any messages produced by compilers while
20812081
running configure, to aid debugging if configure makes a mistake.
20822082
2083-
It was created by sqlite $as_me 3.38.3, which was
2083+
It was created by sqlite $as_me 3.38.5, which was
20842084
generated by GNU Autoconf 2.69. Invocation command line was
20852085
20862086
$ $0 $@
@@ -12390,7 +12390,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
1239012390
# report actual input values of CONFIG_FILES etc. instead of their
1239112391
# values after options handling.
1239212392
ac_log="
12393-
This file was extended by sqlite $as_me 3.38.3, which was
12393+
This file was extended by sqlite $as_me 3.38.5, which was
1239412394
generated by GNU Autoconf 2.69. Invocation command line was
1239512395
1239612396
CONFIG_FILES = $CONFIG_FILES
@@ -12456,7 +12456,7 @@ _ACEOF
1245612456
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1245712457
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1245812458
ac_cs_version="\\
12459-
sqlite config.status 3.38.3
12459+
sqlite config.status 3.38.5
1246012460
configured by $0, generated by GNU Autoconf 2.69,
1246112461
with options \\"\$ac_cs_config\\"
1246212462

manifest

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
C Version\s3.38.3
2-
D 2022-04-27T12:03:15.047
1+
C Version\s3.38.5
2+
D 2022-05-06T15:25:27.476
33
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
44
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
55
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
66
F Makefile.in b210ad2733317f1a4353085dfb9d385ceec30b0e6a61d20a5accabecac6b1949
77
F Makefile.linux-gcc f609543700659711fbd230eced1f01353117621dccae7b9fb70daa64236c5241
88
F Makefile.msc b28a8a7a977e7312f6859f560348e1eb110c21bd6cf9fab0d16537c0a514eef3
99
F README.md 2dd87a5c1d108b224921f3dd47dea567973f706e1f6959386282a626f459a70c
10-
F VERSION b09048f5104cef7fbc4405635ec966be2481d532c0dbd46afd5c17f957de2dc0
10+
F VERSION 2cef599294698e267cbcdadf44f14a0637a0015c1872cb37a16fe723d7c7add0
1111
F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50
1212
F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2
1313
F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90
@@ -34,7 +34,7 @@ F autoconf/tea/win/rules.vc c511f222b80064096b705dbeb97060ee1d6b6d63
3434
F config.guess 883205ddf25b46f10c181818bf42c09da9888884af96f79e1719264345053bd6
3535
F config.h.in 6376abec766e9a0785178b1823b5a587e9f1ccbc
3636
F config.sub c2d0260f17f3e4bc0b6808fccf1b291cb5e9126c14fc5890efc77b9fd0175559
37-
F configure 1290cbee049f2db602990f1ed2a4eed248c36d1e41d23eed37ccdfd7b8bed13e x
37+
F configure d616d46e32a1c2324a561b464175907b976ff62e8946b14e9954268841fc0bb8 x
3838
F configure.ac 3ef6eeff4387585bfcab76b0c3f6e15a0618587bb90245dd5d44e4378141bb35
3939
F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
4040
F doc/F2FS.txt c1d4a0ae9711cfe0e1d8b019d154f1c29e0d3abfe820787ba1e9ed7691160fcd
@@ -547,13 +547,13 @@ F src/pcache.h 4f87acd914cef5016fae3030343540d75f5b85a1877eed1a2a19b9f284248586
547547
F src/pcache1.c 54881292a9a5db202b2c0ac541c5e3ef9a5e8c4f1c1383adb2601d5499a60e65
548548
F src/pragma.c 7c024d690a3dc93f61830f11f900e4af2357f31d081b0c79099ca5e28919cba7
549549
F src/pragma.h 87330ed2fbfa2a1274de93ca0ab850fba336189228cb256089202c3b52766fad
550-
F src/prepare.c fd940149c691684e7c1073c3787a7170e44852b02d1275d2e30a5b58e89cfcaf
550+
F src/prepare.c c62820c15dcb63013519c8e41d9f928d7478672cc902cfd0581c733c271dbf45
551551
F src/printf.c 05d8dfd2018bc4fc3ddb8b37eb97ccef7abf985643fa1caebdcf2916ca90fa32
552552
F src/random.c 097dc8b31b8fba5a9aca1697aeb9fd82078ec91be734c16bffda620ced7ab83c
553553
F src/resolve.c ea935b87d6fb36c78b70cdc7b28561dc8f33f2ef37048389549c7b5ef9b0ba5e
554554
F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92
555555
F src/select.c ba0cd3d264fa788c8d65f063d5ec3e1d65b0dac206c822a564a59ba550210cfc
556-
F src/shell.c.in ec4b952f7d9c02919e8e8394be16bcbff55c105fd080895602d10fc8fa5328b8
556+
F src/shell.c.in e2bc31eca23a1d1d2aaea02dcfde6dfe0ee96bdfa6cbcc36c79f02e457bef18c
557557
F src/sqlite.h.in b93deee892f1bc4030e5c8712df9e21d786a1bf8e921ab8dc987eaf1e44c676f
558558
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
559559
F src/sqlite3ext.h a95cb9ed106e3d39e2118e4dcc15a14faec3fa50d0093425083d340d9dfd96e6
@@ -624,7 +624,7 @@ F src/upsert.c 8789047a8f0a601ea42fa0256d1ba3190c13746b6ba940fe2d25643a7e991937
624624
F src/utf.c ee39565f0843775cc2c81135751ddd93eceb91a673ea2c57f61c76f288b041a0
625625
F src/util.c 602fe229f32a96ceccae4f40824129669582096f7c355f53dbac156c9fecef23
626626
F src/vacuum.c 6c38ddc52f0619865c91dae9c441d4d48bf3040d7dc1bc5b22da1e45547ed0b3
627-
F src/vdbe.c 8239c69f3cb6fa27bac30d60c5a1ebac723abc007ff870ffc3af93e5159c7216
627+
F src/vdbe.c dafb1c9c2f58555bf6f384fe049a4b4fc2408b500216b37769f8faa82a46e57a
628628
F src/vdbe.h 25dabb25c7e157b84e59260cfb5b466c3ac103ede9f36f4db371332c47601abe
629629
F src/vdbeInt.h b45599a2b59f1ce042512ab6786b0b82a8cf3002f6b0fa60b4834e2cd3ac61d8
630630
F src/vdbeapi.c 8863ffb5a7bac42fe9a68aaa3526ee29fc18fb02a9b27188b756de41e33856e9
@@ -641,7 +641,7 @@ F src/wal.h c3aa7825bfa2fe0d85bef2db94655f99870a285778baa36307c0a16da32b226a
641641
F src/walker.c f890a3298418d7cba3b69b8803594fdc484ea241206a8dfa99db6dd36f8cbb3b
642642
F src/where.c be30bf0151f5cc77b2d75a664f2ab60632974165ad2bab6df9deca2fc3284264
643643
F src/whereInt.h 15d2975c3b4c193c78c26674400a840da8647fe1777ae3b026e2d15937b38a03
644-
F src/wherecode.c 84be340684393248b9f3ecbce9b87c8a6f818149b52302702ea0b8d2a9d51faf
644+
F src/wherecode.c eae0a5778fa0ffe398cb4ecb55d3e20ee9b85a985c8c1aa9cea03d0a3069c213
645645
F src/whereexpr.c 2a71f5491798460c9590317329234d332d9eb1717cba4f3403122189a75c465e
646646
F src/window.c 8546f510dfff88e4627f004969940c648acf91c13aa155229849f926a8137b9c
647647
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
@@ -1114,7 +1114,7 @@ F test/index7.test b238344318e0b4e42126717f6554f0e7dfd0b39cecad4b736039b43e1e3b6
11141114
F test/index8.test caa097735c91dbc23d8a402f5e63a2a03c83840ba3928733ed7f9a03f8a912a3
11151115
F test/index9.test 0aa3e509dddf81f93380396e40e9bb386904c1054924ba8fa9bcdfe85a8e7721
11161116
F test/indexedby.test f21eca4f7a6ffe14c8500a7ad6cd53166666c99e5ccd311842a28bc94a195fe0
1117-
F test/indexexpr1.test 8f7241410e351679010f14cd7cd30357622d04a784508ff54ba5ce99f64a2228
1117+
F test/indexexpr1.test 3360c2a29a8844e7c4b13293567025281257f9e13a31854cfff6959cede11502
11181118
F test/indexexpr2.test 2c7abe3c48f8aaa5a448615ab4d13df3662185d28419c00999670834a3f0b484
11191119
F test/indexfault.test 98d78a8ff1f5335628b62f886a1cb7c7dac1ef6d48fa39c51ec871c87dce9811
11201120
F test/init.test 15c823093fdabbf7b531fe22cf037134d09587a7
@@ -1143,7 +1143,7 @@ F test/join.test 25cf0ac11c3b81fedfd166f9062166bdb39dea92f5a7c16cacbf6dc1f7f6702
11431143
F test/join2.test 9bdc615841b91c97a16d68bad9508aea11fa0c6b34e5689847bcc4dac70e4990
11441144
F test/join3.test 6f0c774ff1ba0489e6c88a3e77b9d3528fb4fda0
11451145
F test/join4.test 1a352e4e267114444c29266ce79e941af5885916
1146-
F test/join5.test 0d63c7e43b3160b9d4b93f196ef83b6efc7751b9edd0d18c53a46fbec7a49cfc
1146+
F test/join5.test e1ada8581c279fa210ce6c301bcd286cf0b42bfd0f0a2036b1ee0301e245ab75
11471147
F test/join6.test f809c025fa253f9e150c0e9afd4cef8813257bceeb6f46e04041228c9403cc2c
11481148
F test/journal1.test c7b768041b7f494471531e17abc2f4f5ebf9e5096984f43ed17c4eb80ba34497
11491149
F test/journal2.test 9dac6b4ba0ca79c3b21446bbae993a462c2397c4
@@ -1388,11 +1388,11 @@ F test/sharedA.test 49d87ec54ab640fbbc3786ee3c01de94aaa482a3a9f834ad3fe92770eb69
13881388
F test/sharedB.test 16cc7178e20965d75278f410943109b77b2e645e
13891389
F test/shared_err.test 32634e404a3317eeb94abc7a099c556a346fdb8fb3858dbe222a4cbb8926a939
13901390
F test/sharedlock.test 5ede3c37439067c43b0198f580fd374ebf15d304
1391-
F test/shell1.test b224e0793c5f48aa3749e65d8c64b93a30731bd206f2e41e6c5f1bee1bdb16c6
1391+
F test/shell1.test f7a2ef8260aa01f20be3185118213b1ae70518fdcd2105f3e25b021b5ca800ac
13921392
F test/shell2.test 7a3a23a9f57b99453f1679b1fe8072cb30e382a622874c0c4d97695fadb0a787
13931393
F test/shell3.test a50628ab1d78d90889d9d3f32fb2c084ee15674771e96afe954aaa0accd1de3c
13941394
F test/shell4.test 8f6c0fce4abed19a8a7f7262517149812a04caa905d01bdc8f5e92573504b759
1395-
F test/shell5.test 0a9920d81fae28c45cd5dbd1deb809487a23c5f4b422a49f9d31c85f926d4a9c
1395+
F test/shell5.test 78a7a8516b1e7de560748881424f621321549023d3e5f7ed2e1c56497f64c06c
13961396
F test/shell6.test 1ceb51b2678c472ba6cf1e5da96679ce8347889fe2c3bf93a0e0fa73f00b00d3
13971397
F test/shell7.test 115132f66d0463417f408562cc2cf534f6bbc6d83a6d50f0072a9eb171bae97f
13981398
F test/shell8.test 388471d16e4de767333107e30653983f186232c0e863f4490bb230419e830aae
@@ -1944,10 +1944,10 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
19441944
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
19451945
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
19461946
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
1947-
P b9c7d2c1bdc529b8c367e4a0894f4c966957cfa4b427175d5aa10af6a25f4f12
1948-
R 3239c458ee20a7ad3be4e144155c5ad4
1949-
T +sym-relese *
1950-
T +sym-version-3.38.3 *
1947+
P 7fcdb760a4df8c5c11e94cecdc61bb8f40c86b70aa05f48e17520443a3d3b451
1948+
R c70a3244d878106624c489b9bff97d77
1949+
T +sym-release *
1950+
T +sym-version-3.38.5 *
19511951
U drh
1952-
Z 3eea06f2546971f0d6539e228b8fb587
1952+
Z 54d3523b3ce9c5f872539bc3270e6853
19531953
# Remove this line to create a well-formed Fossil manifest.

manifest.uuid

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9547e2c38a1c6f751a77d4d796894dec4dc5d8f5d79b1cd39e1ffc50df7b3be4
1+
78d9c993d404cdfaa7fdd2973fa1052e3da9f66215cff9c5540ebe55c407d9fe

src/prepare.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,14 @@ void sqlite3ParseObjectInit(Parse *pParse, sqlite3 *db){
663663
if( db->mallocFailed ) sqlite3ErrorMsg(pParse, "out of memory");
664664
}
665665

666+
/*
667+
** Maximum number of times that we will try again to prepare a statement
668+
** that returns SQLITE_ERROR_RETRY.
669+
*/
670+
#ifndef SQLITE_MAX_PREPARE_RETRY
671+
# define SQLITE_MAX_PREPARE_RETRY 25
672+
#endif
673+
666674
/*
667675
** Compile the UTF-8 encoded SQL statement zSql into a statement handle.
668676
*/
@@ -837,7 +845,7 @@ static int sqlite3LockAndPrepare(
837845
rc = sqlite3Prepare(db, zSql, nBytes, prepFlags, pOld, ppStmt, pzTail);
838846
assert( rc==SQLITE_OK || *ppStmt==0 );
839847
if( rc==SQLITE_OK || db->mallocFailed ) break;
840-
}while( rc==SQLITE_ERROR_RETRY
848+
}while( (rc==SQLITE_ERROR_RETRY && (cnt++)<SQLITE_MAX_PREPARE_RETRY)
841849
|| (rc==SQLITE_SCHEMA && (sqlite3ResetOneSchema(db,-1), cnt++)==0) );
842850
sqlite3BtreeLeaveAll(db);
843851
rc = sqlite3ApiExit(db, rc);

src/shell.c.in

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3346,6 +3346,8 @@ static void exec_prepared_stmt_columnar(
33463346
int bNextLine = 0;
33473347
int bMultiLineRowExists = 0;
33483348
int bw = p->cmOpts.bWordWrap;
3349+
const char *zEmpty = "";
3350+
const char *zShowNull = p->nullValue;
33493351

33503352
rc = sqlite3_step(pStmt);
33513353
if( rc!=SQLITE_ROW ) return;
@@ -3407,12 +3409,14 @@ static void exec_prepared_stmt_columnar(
34073409
if( wx<0 ) wx = -wx;
34083410
if( useNextLine ){
34093411
uz = azNextLine[i];
3412+
if( uz==0 ) uz = (u8*)zEmpty;
34103413
}else if( p->cmOpts.bQuote ){
34113414
sqlite3_free(azQuoted[i]);
34123415
azQuoted[i] = quoted_column(pStmt,i);
34133416
uz = (const unsigned char*)azQuoted[i];
34143417
}else{
34153418
uz = (const unsigned char*)sqlite3_column_text(pStmt,i);
3419+
if( uz==0 ) uz = (u8*)zShowNull;
34163420
}
34173421
azData[nRow*nColumn + i]
34183422
= translateForDisplayAndDup(uz, &azNextLine[i], wx, bw);
@@ -3426,7 +3430,7 @@ static void exec_prepared_stmt_columnar(
34263430
nTotal = nColumn*(nRow+1);
34273431
for(i=0; i<nTotal; i++){
34283432
z = azData[i];
3429-
if( z==0 ) z = p->nullValue;
3433+
if( z==0 ) z = (char*)zEmpty;
34303434
n = strlenChar(z);
34313435
j = i%nColumn;
34323436
if( n>p->actualWidth[j] ) p->actualWidth[j] = n;
@@ -3530,7 +3534,10 @@ columnar_end:
35303534
utf8_printf(p->out, "Interrupt\n");
35313535
}
35323536
nData = (nRow+1)*nColumn;
3533-
for(i=0; i<nData; i++) free(azData[i]);
3537+
for(i=0; i<nData; i++){
3538+
z = azData[i];
3539+
if( z!=zEmpty && z!=zShowNull ) free(azData[i]);
3540+
}
35343541
sqlite3_free(azData);
35353542
sqlite3_free((void*)azNextLine);
35363543
sqlite3_free(abRowDiv);
@@ -7956,12 +7963,12 @@ SELECT\
79567963
','||iif((cpos-1)%4>0, ' ', x'0a'||' '))\
79577964
||')' AS ColsSpec \
79587965
FROM (\
7959-
SELECT cpos, printf('\"%w\"',printf('%.*s%s', nlen-chop,name,suff)) AS cname \
7966+
SELECT cpos, printf('\"%w\"',printf('%!.*s%s', nlen-chop,name,suff)) AS cname \
79607967
FROM ColNames ORDER BY cpos\
79617968
)";
79627969
static const char * const zRenamesDone =
79637970
"SELECT group_concat("
7964-
" printf('\"%w\" to \"%w\"',name,printf('%.*s%s', nlen-chop, name, suff)),"
7971+
" printf('\"%w\" to \"%w\"',name,printf('%!.*s%s', nlen-chop, name, suff)),"
79657972
" ','||x'0a')"
79667973
"FROM ColNames WHERE suff<>'' OR chop!=0"
79677974
;

src/vdbe.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,8 @@ case OP_Gosub: { /* jump */
987987
/* Most jump operations do a goto to this spot in order to update
988988
** the pOp pointer. */
989989
jump_to_p2:
990+
assert( pOp->p2>0 ); /* There are never any jumps to instruction 0 */
991+
assert( pOp->p2<p->nOp ); /* Jumps must be in range */
990992
pOp = &aOp[pOp->p2 - 1];
991993
break;
992994
}

src/wherecode.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,6 +1235,7 @@ static void preserveExpr(IdxExprTrans *pTrans, Expr *pExpr){
12351235
static int whereIndexExprTransNode(Walker *p, Expr *pExpr){
12361236
IdxExprTrans *pX = p->u.pIdxTrans;
12371237
if( sqlite3ExprCompare(0, pExpr, pX->pIdxExpr, pX->iTabCur)==0 ){
1238+
pExpr = sqlite3ExprSkipCollate(pExpr);
12381239
preserveExpr(pX, pExpr);
12391240
pExpr->affExpr = sqlite3ExprAffinity(pExpr);
12401241
pExpr->op = TK_COLUMN;
@@ -1394,6 +1395,8 @@ static SQLITE_NOINLINE void filterPullDown(
13941395
/* ,--- Because sqlite3ConstructBloomFilter() has will not have set
13951396
** vvvvv--' pLevel->regFilter if this were true. */
13961397
if( NEVER(pLoop->prereq & notReady) ) continue;
1398+
assert( pLevel->addrBrk==0 );
1399+
pLevel->addrBrk = addrNxt;
13971400
if( pLoop->wsFlags & WHERE_IPK ){
13981401
WhereTerm *pTerm = pLoop->aLTerm[0];
13991402
int regRowid;
@@ -1420,6 +1423,7 @@ static SQLITE_NOINLINE void filterPullDown(
14201423
VdbeCoverage(pParse->pVdbe);
14211424
}
14221425
pLevel->regFilter = 0;
1426+
pLevel->addrBrk = 0;
14231427
}
14241428
}
14251429

test/indexexpr1.test

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,4 +487,23 @@ ifcapable like_match_blobs {
487487
} {2.0}
488488
}
489489

490+
# 2022-04-30 https://sqlite.org/forum/info/7efabf4b03328e57
491+
# Assertion fault during a DELETE INDEXED BY.
492+
#
493+
reset_db
494+
do_execsql_test indexexpr-1900 {
495+
CREATE TABLE t1(x TEXT PRIMARY KEY, y TEXT, z INT);
496+
INSERT INTO t1(x,y,z) VALUES('alpha','ALPHA',1),('bravo','charlie',1);
497+
CREATE INDEX i1 ON t1(+y COLLATE NOCASE);
498+
SELECT * FROM t1;
499+
} {alpha ALPHA 1 bravo charlie 1}
500+
do_execsql_test indexexpr-1910 {
501+
DELETE FROM t1 INDEXED BY i1
502+
WHERE x IS +y COLLATE NOCASE IN (SELECT z FROM t1)
503+
RETURNING *;
504+
} {alpha ALPHA 1}
505+
do_execsql_test indexexpr-1920 {
506+
SELECT * FROM t1;
507+
} {bravo charlie 1}
508+
490509
finish_test

test/join5.test

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,38 @@ do_execsql_test 11.4 {
393393
SELECT count(*) FROM t1 LEFT JOIN t2 ON c=b WHERE d>=300;
394394
} {2}
395395

396+
# 2022-05-03 https://sqlite.org/forum/forumpost/2482b32700384a0f
397+
# Bloom-filter pull-down does not handle NOT NULL constraints correctly.
398+
#
399+
reset_db
400+
do_execsql_test 12.1 {
401+
CREATE TABLE t1(a INT, b INT, c INT);
402+
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<100)
403+
INSERT INTO t1(a,b,c) SELECT x, x*1000, x*1000000 FROM c;
404+
CREATE TABLE t2(b INT, x INT);
405+
INSERT INTO t2(b,x) SELECT b, a FROM t1 WHERE a%3==0;
406+
CREATE INDEX t2b ON t2(b);
407+
CREATE TABLE t3(c INT, y INT);
408+
INSERT INTO t3(c,y) SELECT c, a FROM t1 WHERE a%4==0;
409+
CREATE INDEX t3c ON t3(c);
410+
INSERT INTO t1(a,b,c) VALUES(200, 200000, NULL);
411+
ANALYZE;
412+
} {}
413+
do_execsql_test 12.2 {
414+
SELECT * FROM t1 NATURAL JOIN t2 NATURAL JOIN t3 WHERE x>0 AND y>0
415+
ORDER BY +a;
416+
} {
417+
12 12000 12000000 12 12
418+
24 24000 24000000 24 24
419+
36 36000 36000000 36 36
420+
48 48000 48000000 48 48
421+
60 60000 60000000 60 60
422+
72 72000 72000000 72 72
423+
84 84000 84000000 84 84
424+
96 96000 96000000 96 96
425+
}
426+
427+
396428

397429

398430
finish_test

0 commit comments

Comments
 (0)