Skip to content

Commit 18e09dd

Browse files
committed
build bundles
1 parent 6e67b36 commit 18e09dd

2 files changed

Lines changed: 24 additions & 18 deletions

File tree

libsql-ffi/bundled/SQLite3MultipleCiphers/src/sqlite3.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
** src/vtab.c
7979
** src/wal.c
8080
** src/wal.h
81+
** src/where.c
8182
** src/wherecode.c
8283
** test/all.test
8384
** test/permutations.test
@@ -126752,11 +126753,6 @@ SQLITE_PRIVATE void sqlite3CreateIndex(
126752126753
goto exit_create_index;
126753126754
}
126754126755
if( vectorIdxRc >= 1 ){
126755-
/*
126756-
* SQLite can use B-Tree indices in some optimizations (like SELECT COUNT(*) can use any full B-Tree index instead of PK index)
126757-
* But, SQLite pretty conservative about usage of unordered indices - that's what we need here
126758-
*/
126759-
pIndex->bUnordered = 1;
126760126756
pIndex->idxIsVector = 1;
126761126757
}
126762126758
if( vectorIdxRc == 1 ){
@@ -152451,6 +152447,7 @@ SQLITE_PRIVATE int sqlite3Select(
152451152447
if( pIdx->bUnordered==0
152452152448
&& pIdx->szIdxRow<pTab->szTabRow
152453152449
&& pIdx->pPartIdxWhere==0
152450+
&& pIdx->idxIsVector==0
152454152451
&& (!pBest || pIdx->szIdxRow<pBest->szIdxRow)
152455152452
){
152456152453
pBest = pIdx;
@@ -166075,9 +166072,10 @@ static int whereLoopAddBtreeIndex(
166075166072
assert( pNew->u.btree.nBtm==0 );
166076166073
opMask = WO_EQ|WO_IN|WO_GT|WO_GE|WO_LT|WO_LE|WO_ISNULL|WO_IS;
166077166074
}
166078-
if( pProbe->bUnordered || pProbe->bLowQual ){
166075+
if( pProbe->bUnordered || pProbe->bLowQual || pProbe->idxIsVector ){
166079166076
if( pProbe->bUnordered ) opMask &= ~(WO_GT|WO_GE|WO_LT|WO_LE);
166080166077
if( pProbe->bLowQual ) opMask &= ~(WO_EQ|WO_IN|WO_IS);
166078+
if( pProbe->idxIsVector ) opMask = 0;
166081166079
}
166082166080

166083166081
assert( pNew->u.btree.nEq<pProbe->nColumn );
@@ -166459,7 +166457,7 @@ static int indexMightHelpWithOrderBy(
166459166457
ExprList *aColExpr;
166460166458
int ii, jj;
166461166459

166462-
if( pIndex->bUnordered ) return 0;
166460+
if( pIndex->bUnordered || pIndex->idxIsVector ) return 0;
166463166461
if( (pOB = pBuilder->pWInfo->pOrderBy)==0 ) return 0;
166464166462
for(ii=0; ii<pOB->nExpr; ii++){
166465166463
Expr *pExpr = sqlite3ExprSkipCollateAndLikely(pOB->a[ii].pExpr);
@@ -166628,6 +166626,9 @@ static SQLITE_NOINLINE u32 whereIsCoveringIndex(
166628166626
** if pIdx is covering. Assume it is not. */
166629166627
return 0;
166630166628
}
166629+
if( pIdx->idxIsVector==1 ){
166630+
return 0;
166631+
}
166631166632
if( pIdx->bHasExpr==0 ){
166632166633
for(i=0; i<pIdx->nColumn; i++){
166633166634
if( pIdx->aiColumn[i]>=BMS-1 ) break;
@@ -166916,6 +166917,9 @@ static int whereLoopAddBtree(
166916166917
testcase( pNew->iTab!=pSrc->iCursor ); /* See ticket [98d973b8f5] */
166917166918
continue; /* Partial index inappropriate for this query */
166918166919
}
166920+
if( pProbe->idxIsVector!=0 ){
166921+
continue; /* Vector index inappropriate for this query */
166922+
}
166919166923
if( pProbe->bNoQuery ) continue;
166920166924
rSize = pProbe->aiRowLogEst[0];
166921166925
pNew->u.btree.nEq = 0;
@@ -167919,7 +167923,7 @@ static i8 wherePathSatisfiesOrderBy(
167919167923
pIndex = 0;
167920167924
nKeyCol = 0;
167921167925
nColumn = 1;
167922-
}else if( (pIndex = pLoop->u.btree.pIndex)==0 || pIndex->bUnordered ){
167926+
}else if( (pIndex = pLoop->u.btree.pIndex)==0 || pIndex->bUnordered || pIndex->idxIsVector ){
167923167927
return 0;
167924167928
}else{
167925167929
nKeyCol = pIndex->nKeyCol;
@@ -215466,7 +215470,6 @@ int vectorIndexSearch(
215466215470
rc = SQLITE_ERROR;
215467215471
goto out;
215468215472
}
215469-
assert( type == VECTOR_TYPE_FLOAT32 || type == VECTOR_TYPE_FLOAT64 || type == VECTOR_TYPE_FLOAT1BIT );
215470215473

215471215474
pVector = vectorAlloc(type, dims);
215472215475
if( pVector == NULL ){

libsql-ffi/bundled/src/sqlite3.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
** src/vtab.c
7979
** src/wal.c
8080
** src/wal.h
81+
** src/where.c
8182
** src/wherecode.c
8283
** test/all.test
8384
** test/permutations.test
@@ -126752,11 +126753,6 @@ SQLITE_PRIVATE void sqlite3CreateIndex(
126752126753
goto exit_create_index;
126753126754
}
126754126755
if( vectorIdxRc >= 1 ){
126755-
/*
126756-
* SQLite can use B-Tree indices in some optimizations (like SELECT COUNT(*) can use any full B-Tree index instead of PK index)
126757-
* But, SQLite pretty conservative about usage of unordered indices - that's what we need here
126758-
*/
126759-
pIndex->bUnordered = 1;
126760126756
pIndex->idxIsVector = 1;
126761126757
}
126762126758
if( vectorIdxRc == 1 ){
@@ -152451,6 +152447,7 @@ SQLITE_PRIVATE int sqlite3Select(
152451152447
if( pIdx->bUnordered==0
152452152448
&& pIdx->szIdxRow<pTab->szTabRow
152453152449
&& pIdx->pPartIdxWhere==0
152450+
&& pIdx->idxIsVector==0
152454152451
&& (!pBest || pIdx->szIdxRow<pBest->szIdxRow)
152455152452
){
152456152453
pBest = pIdx;
@@ -166075,9 +166072,10 @@ static int whereLoopAddBtreeIndex(
166075166072
assert( pNew->u.btree.nBtm==0 );
166076166073
opMask = WO_EQ|WO_IN|WO_GT|WO_GE|WO_LT|WO_LE|WO_ISNULL|WO_IS;
166077166074
}
166078-
if( pProbe->bUnordered || pProbe->bLowQual ){
166075+
if( pProbe->bUnordered || pProbe->bLowQual || pProbe->idxIsVector ){
166079166076
if( pProbe->bUnordered ) opMask &= ~(WO_GT|WO_GE|WO_LT|WO_LE);
166080166077
if( pProbe->bLowQual ) opMask &= ~(WO_EQ|WO_IN|WO_IS);
166078+
if( pProbe->idxIsVector ) opMask = 0;
166081166079
}
166082166080

166083166081
assert( pNew->u.btree.nEq<pProbe->nColumn );
@@ -166459,7 +166457,7 @@ static int indexMightHelpWithOrderBy(
166459166457
ExprList *aColExpr;
166460166458
int ii, jj;
166461166459

166462-
if( pIndex->bUnordered ) return 0;
166460+
if( pIndex->bUnordered || pIndex->idxIsVector ) return 0;
166463166461
if( (pOB = pBuilder->pWInfo->pOrderBy)==0 ) return 0;
166464166462
for(ii=0; ii<pOB->nExpr; ii++){
166465166463
Expr *pExpr = sqlite3ExprSkipCollateAndLikely(pOB->a[ii].pExpr);
@@ -166628,6 +166626,9 @@ static SQLITE_NOINLINE u32 whereIsCoveringIndex(
166628166626
** if pIdx is covering. Assume it is not. */
166629166627
return 0;
166630166628
}
166629+
if( pIdx->idxIsVector==1 ){
166630+
return 0;
166631+
}
166631166632
if( pIdx->bHasExpr==0 ){
166632166633
for(i=0; i<pIdx->nColumn; i++){
166633166634
if( pIdx->aiColumn[i]>=BMS-1 ) break;
@@ -166916,6 +166917,9 @@ static int whereLoopAddBtree(
166916166917
testcase( pNew->iTab!=pSrc->iCursor ); /* See ticket [98d973b8f5] */
166917166918
continue; /* Partial index inappropriate for this query */
166918166919
}
166920+
if( pProbe->idxIsVector!=0 ){
166921+
continue; /* Vector index inappropriate for this query */
166922+
}
166919166923
if( pProbe->bNoQuery ) continue;
166920166924
rSize = pProbe->aiRowLogEst[0];
166921166925
pNew->u.btree.nEq = 0;
@@ -167919,7 +167923,7 @@ static i8 wherePathSatisfiesOrderBy(
167919167923
pIndex = 0;
167920167924
nKeyCol = 0;
167921167925
nColumn = 1;
167922-
}else if( (pIndex = pLoop->u.btree.pIndex)==0 || pIndex->bUnordered ){
167926+
}else if( (pIndex = pLoop->u.btree.pIndex)==0 || pIndex->bUnordered || pIndex->idxIsVector ){
167923167927
return 0;
167924167928
}else{
167925167929
nKeyCol = pIndex->nKeyCol;
@@ -215466,7 +215470,6 @@ int vectorIndexSearch(
215466215470
rc = SQLITE_ERROR;
215467215471
goto out;
215468215472
}
215469-
assert( type == VECTOR_TYPE_FLOAT32 || type == VECTOR_TYPE_FLOAT64 || type == VECTOR_TYPE_FLOAT1BIT );
215470215473

215471215474
pVector = vectorAlloc(type, dims);
215472215475
if( pVector == NULL ){

0 commit comments

Comments
 (0)