@@ -815,12 +815,12 @@ static u32 saturating_add(u32 lhs, u32 rhs) {
815
815
return (u32 )MIN (0xFFFFFFFF , sum );
816
816
}
817
817
818
- static void inc_row_read (Vdbe * p , int count ) {
818
+ void libsql_inc_row_read (Vdbe * p , int count ) {
819
819
u32 * read = & p -> aLibsqlCounter [LIBSQL_STMTSTATUS_ROWS_READ - LIBSQL_STMTSTATUS_BASE ];
820
820
* read = saturating_add (* read , count );
821
821
}
822
822
823
- static void inc_row_written (Vdbe * p , int count ) {
823
+ void libsql_inc_row_written (Vdbe * p , int count ) {
824
824
u32 * write = & p -> aLibsqlCounter [LIBSQL_STMTSTATUS_ROWS_WRITTEN - LIBSQL_STMTSTATUS_BASE ];
825
825
* write = saturating_add (* write , count );
826
826
}
@@ -3740,7 +3740,7 @@ case OP_Count: { /* out2 */
3740
3740
nEntry = 0 ; /* Not needed. Only used to silence a warning. */
3741
3741
i64 nPages = 0 ;
3742
3742
rc = sqlite3BtreeCount (db , pCrsr , & nEntry , & nPages );
3743
- inc_row_read (p , nPages );
3743
+ libsql_inc_row_read (p , nPages );
3744
3744
if ( rc ) goto abort_due_to_error ;
3745
3745
}
3746
3746
pOut = out2Prerelease (p , pOp );
@@ -4942,7 +4942,7 @@ case OP_SeekGT: { /* jump, in3, group, ncycle */
4942
4942
goto seek_not_found ;
4943
4943
}
4944
4944
}
4945
- inc_row_read (p , 1 );
4945
+ libsql_inc_row_read (p , 1 );
4946
4946
#ifdef SQLITE_TEST
4947
4947
sqlite3_search_count ++ ;
4948
4948
#endif
@@ -5512,7 +5512,7 @@ case OP_NotExists: /* jump, in3, ncycle */
5512
5512
pC -> deferredMoveto = 0 ;
5513
5513
VdbeBranchTaken (res != 0 ,2 );
5514
5514
pC -> seekResult = res ;
5515
- inc_row_read (p , 1 );
5515
+ libsql_inc_row_read (p , 1 );
5516
5516
if ( res != 0 ){
5517
5517
assert ( rc == SQLITE_OK );
5518
5518
if ( pOp -> p2 == 0 ){
@@ -5814,7 +5814,7 @@ case OP_Insert: {
5814
5814
#endif
5815
5815
5816
5816
assert ( (pOp -> p5 & OPFLAG_LASTROWID )== 0 || (pOp -> p5 & OPFLAG_NCHANGE )!= 0 );
5817
- if (!pC -> isEphemeral ) inc_row_written (p , 1 );
5817
+ if (!pC -> isEphemeral ) libsql_inc_row_written (p , 1 );
5818
5818
5819
5819
if ( pOp -> p5 & OPFLAG_NCHANGE ){
5820
5820
p -> nChange ++ ;
@@ -6009,7 +6009,7 @@ case OP_Delete: {
6009
6009
6010
6010
/* Invoke the update-hook if required. */
6011
6011
if ( opflags & OPFLAG_NCHANGE ){
6012
- if (!pC -> isEphemeral ) inc_row_written (p , 1 );
6012
+ if (!pC -> isEphemeral ) libsql_inc_row_written (p , 1 );
6013
6013
p -> nChange ++ ;
6014
6014
if ( db -> xUpdateCallback && ALWAYS (pTab != 0 ) && HasRowid (pTab ) ){
6015
6015
db -> xUpdateCallback (db -> pUpdateArg , SQLITE_DELETE , zDb , pTab -> zName ,
@@ -6297,7 +6297,7 @@ case OP_Last: { /* jump, ncycle */
6297
6297
pC -> deferredMoveto = 0 ;
6298
6298
pC -> cacheStatus = CACHE_STALE ;
6299
6299
if ( rc ) goto abort_due_to_error ;
6300
- inc_row_read (p , 1 );
6300
+ libsql_inc_row_read (p , 1 );
6301
6301
if ( pOp -> p2 > 0 ){
6302
6302
VdbeBranchTaken (res != 0 ,2 );
6303
6303
if ( res ) goto jump_to_p2 ;
@@ -6407,7 +6407,7 @@ case OP_Rewind: { /* jump, ncycle */
6407
6407
}
6408
6408
if ( rc ) goto abort_due_to_error ;
6409
6409
pC -> nullRow = (u8 )res ;
6410
- inc_row_read (p , 1 );
6410
+ libsql_inc_row_read (p , 1 );
6411
6411
if ( pOp -> p2 > 0 ){
6412
6412
VdbeBranchTaken (res != 0 ,2 );
6413
6413
if ( res ) goto jump_to_p2 ;
@@ -6513,7 +6513,7 @@ case OP_Next: /* jump, ncycle */
6513
6513
if ( rc == SQLITE_OK ){
6514
6514
pC -> nullRow = 0 ;
6515
6515
p -> aCounter [pOp -> p5 ]++ ;
6516
- inc_row_read (p , 1 );
6516
+ libsql_inc_row_read (p , 1 );
6517
6517
#ifdef SQLITE_TEST
6518
6518
sqlite3_search_count ++ ;
6519
6519
#endif
@@ -6565,7 +6565,7 @@ case OP_IdxInsert: { /* in2 */
6565
6565
pIn2 = & aMem [pOp -> p2 ];
6566
6566
assert ( (pIn2 -> flags & MEM_Blob ) || (pOp -> p5 & OPFLAG_PREFORMAT ) );
6567
6567
if ( pOp -> p5 & OPFLAG_NCHANGE ) p -> nChange ++ ;
6568
- if (!pC -> isEphemeral ) inc_row_written (p , 1 );
6568
+ if (!pC -> isEphemeral ) libsql_inc_row_written (p , 1 );
6569
6569
#ifndef SQLITE_OMIT_VECTOR
6570
6570
if ( isVectorCursor (pC ) ) {
6571
6571
UnpackedRecord idxKeyStatic ;
@@ -7017,7 +7017,7 @@ case OP_Clear: {
7017
7017
rc = sqlite3BtreeClearTable (db -> aDb [pOp -> p2 ].pBt , (u32 )pOp -> p1 , & nChange );
7018
7018
if ( pOp -> p3 ){
7019
7019
p -> nChange += nChange ;
7020
- inc_row_written (p , nChange );
7020
+ libsql_inc_row_written (p , nChange );
7021
7021
if ( pOp -> p3 > 0 ){
7022
7022
assert ( memIsValid (& aMem [pOp -> p3 ]) );
7023
7023
memAboutToChange (p , & aMem [pOp -> p3 ]);
@@ -8330,6 +8330,11 @@ case OP_VOpen: { /* ncycle */
8330
8330
if ( pCur ){
8331
8331
pCur -> uc .pVCur = pVCur ;
8332
8332
pVtab -> nRef ++ ;
8333
+ #ifndef SQLITE_OMIT_VECTOR
8334
+ if ( sqlite3StrICmp (pOp -> p4 .pVtab -> pMod -> zName , VECTOR_INDEX_VTAB_NAME ) == 0 ){
8335
+ pCur -> isTracked = 1 ;
8336
+ }
8337
+ #endif
8333
8338
}else {
8334
8339
assert ( db -> mallocFailed );
8335
8340
pModule -> xClose (pVCur );
@@ -8604,7 +8609,7 @@ case OP_VNext: { /* jump, ncycle */
8604
8609
rc = pModule -> xNext (pCur -> uc .pVCur );
8605
8610
sqlite3VtabImportErrmsg (p , pVtab );
8606
8611
if ( rc ) goto abort_due_to_error ;
8607
- inc_row_read (p , 1 );
8612
+ libsql_inc_row_read (p , 1 );
8608
8613
res = pModule -> xEof (pCur -> uc .pVCur );
8609
8614
VdbeBranchTaken (!res ,2 );
8610
8615
if ( !res ){
@@ -8726,7 +8731,7 @@ case OP_VUpdate: {
8726
8731
p -> errorAction = ((pOp -> p5 == OE_Replace ) ? OE_Abort : pOp -> p5 );
8727
8732
}
8728
8733
}else {
8729
- inc_row_written (p , 1 );
8734
+ libsql_inc_row_written (p , 1 );
8730
8735
p -> nChange ++ ;
8731
8736
}
8732
8737
if ( rc ) goto abort_due_to_error ;
0 commit comments