Commit 5a70a26
fix: use correct SQLite extended error codes for leader detection
The previous values {0, 4097} came from Go client internals, not the
wire protocol. The C dqlite server sends SQLite extended error codes:
- SQLITE_IOERR_NOT_LEADER = 10250 (SQLITE_IOERR | (40 << 8))
- SQLITE_IOERR_LEADERSHIP_LOST = 10506 (SQLITE_IOERR | (41 << 8))
Code 0 actually means "empty statement", not "not leader", so the
old constant would invalidate connections on empty SQL.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent ecfaf78 commit 5a70a26
2 files changed
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
431 | | - | |
432 | | - | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
433 | 434 | | |
434 | 435 | | |
435 | 436 | | |
| |||
0 commit comments