Commit 8c56b0a
committed
Patch Turso translate_drop_table to use correct db schema for indices
translate_drop_table reads the table's indices via resolver.schema()
(always MAIN) but emits Destroy with the resolved database_id. When
dropping a TEMP-shadowed table (e.g. permanent t shadowed by temp t),
the indices come from MAIN's schema while Destroy opens the cursor
on temp's pager. Temp's pager then tries to read a page at MAIN's
index root_page, which doesn't exist there:
ERROR turso_core::storage::sqlite3_ondisk: short read on page 29
ERROR turso_core::vdbe: page is pinned
Repro: testTemporaryTableHasPriorityOverStandardTable. The driver's
ALTER emulation issues DROP TABLE on the shadowed name; Turso's drop
path picks up MAIN's index 'ia' instead of TEMP's index 'ib'.
Fix: read indices via with_schema(database_id, ...). Same pattern as
patch #17 for the sqlite_sequence root_page mismatch.
Worth reporting upstream — independent of mysql-on-sqlite.1 parent 42cf49a commit 8c56b0a
1 file changed
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
676 | 676 | | |
677 | 677 | | |
678 | 678 | | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
679 | 717 | | |
680 | 718 | | |
681 | 719 | | |
| |||
0 commit comments