Commit 27deab7
lua: clear page-in fingerprint TLS at each inner statement's true end
Lua stored-procedure inner statements (db:exec/db:prepare, temp table
handling) already set the page-in fingerprint thread-local correctly
via the shared get_prepared_stmt_int() chokepoint, but had no
per-inner-statement clear -- only the whole-procedure sqlite_done()
call cleared it. This let page-ins between one inner statement
finishing and the next one's own prepare bleed onto the previous
statement's fingerprint instead of falling into NO-FINGERPRINT.
Adds bdb_fingerprint_rtstats_clear() at every point an inner
statement's execution conclusively ends: donate_stmt() (the shared
terminal disposal point for exec/prepare/cursor handles -- covers
dbstmt_free, dbstmt_exec's error path, dbstmt_fetch exhaustion,
dbstmt_close, and reset_stmt's terminal branch) plus the six direct
sqlite3_finalize() sites that bypass it (create_temp_table,
dbtable_insert, dbtable_copyfrom, db_csvcopy, drop_temp_tables,
clone_temp_tables). Deliberately does not hook lua_end_step(), since
it fires multiple times against the same open statement in some paths
(db_csvcopy, once per CSV row) and would clear prematurely.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Mark Hannum <mhannum@bloomberg.net>1 parent d076bd4 commit 27deab7
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1146 | 1146 | | |
1147 | 1147 | | |
1148 | 1148 | | |
| 1149 | + | |
| 1150 | + | |
1149 | 1151 | | |
1150 | 1152 | | |
1151 | 1153 | | |
| |||
1249 | 1251 | | |
1250 | 1252 | | |
1251 | 1253 | | |
| 1254 | + | |
1252 | 1255 | | |
1253 | 1256 | | |
1254 | 1257 | | |
| |||
2240 | 2243 | | |
2241 | 2244 | | |
2242 | 2245 | | |
| 2246 | + | |
2243 | 2247 | | |
2244 | 2248 | | |
2245 | 2249 | | |
| |||
2295 | 2299 | | |
2296 | 2300 | | |
2297 | 2301 | | |
| 2302 | + | |
2298 | 2303 | | |
2299 | 2304 | | |
2300 | 2305 | | |
| |||
2878 | 2883 | | |
2879 | 2884 | | |
2880 | 2885 | | |
| 2886 | + | |
2881 | 2887 | | |
2882 | 2888 | | |
2883 | 2889 | | |
| |||
3510 | 3516 | | |
3511 | 3517 | | |
3512 | 3518 | | |
3513 | | - | |
| 3519 | + | |
| 3520 | + | |
3514 | 3521 | | |
| 3522 | + | |
3515 | 3523 | | |
3516 | 3524 | | |
3517 | 3525 | | |
| |||
6481 | 6489 | | |
6482 | 6490 | | |
6483 | 6491 | | |
| 6492 | + | |
6484 | 6493 | | |
6485 | 6494 | | |
6486 | 6495 | | |
| |||
0 commit comments