Skip to content

Commit 0b040d3

Browse files
committed
Prepare 3.51.0.
1 parent 1db4366 commit 0b040d3

File tree

5 files changed

+21
-7
lines changed

5 files changed

+21
-7
lines changed

const.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ const (
7373
ERROR_MISSING_COLLSEQ ExtendedErrorCode = xErrorCode(ERROR) | (1 << 8)
7474
ERROR_RETRY ExtendedErrorCode = xErrorCode(ERROR) | (2 << 8)
7575
ERROR_SNAPSHOT ExtendedErrorCode = xErrorCode(ERROR) | (3 << 8)
76+
ERROR_RESERVESIZE ExtendedErrorCode = xErrorCode(ERROR) | (4 << 8)
77+
ERROR_KEY ExtendedErrorCode = xErrorCode(ERROR) | (5 << 8)
78+
ERROR_UNABLE ExtendedErrorCode = xErrorCode(ERROR) | (6 << 8)
7679
IOERR_READ ExtendedErrorCode = xErrorCode(IOERR) | (1 << 8)
7780
IOERR_SHORT_READ ExtendedErrorCode = xErrorCode(IOERR) | (2 << 8)
7881
IOERR_WRITE ExtendedErrorCode = xErrorCode(IOERR) | (3 << 8)
@@ -107,6 +110,8 @@ const (
107110
IOERR_DATA ExtendedErrorCode = xErrorCode(IOERR) | (32 << 8)
108111
IOERR_CORRUPTFS ExtendedErrorCode = xErrorCode(IOERR) | (33 << 8)
109112
IOERR_IN_PAGE ExtendedErrorCode = xErrorCode(IOERR) | (34 << 8)
113+
IOERR_BADKEY ExtendedErrorCode = xErrorCode(IOERR) | (35 << 8)
114+
IOERR_CODEC ExtendedErrorCode = xErrorCode(IOERR) | (36 << 8)
110115
LOCKED_SHAREDCACHE ExtendedErrorCode = xErrorCode(LOCKED) | (1 << 8)
111116
LOCKED_VTAB ExtendedErrorCode = xErrorCode(LOCKED) | (2 << 8)
112117
BUSY_RECOVERY ExtendedErrorCode = xErrorCode(BUSY) | (1 << 8)
@@ -362,13 +367,14 @@ const (
362367
// CheckpointMode are all the checkpoint mode values.
363368
//
364369
// https://sqlite.org/c3ref/c_checkpoint_full.html
365-
type CheckpointMode uint32
370+
type CheckpointMode int32
366371

367372
const (
368-
CHECKPOINT_PASSIVE CheckpointMode = 0 /* Do as much as possible w/o blocking */
369-
CHECKPOINT_FULL CheckpointMode = 1 /* Wait for writers, then checkpoint */
370-
CHECKPOINT_RESTART CheckpointMode = 2 /* Like FULL but wait for readers */
371-
CHECKPOINT_TRUNCATE CheckpointMode = 3 /* Like RESTART but also truncate WAL */
373+
CHECKPOINT_NOOP CheckpointMode = -1 /* Do no work at all */
374+
CHECKPOINT_PASSIVE CheckpointMode = 0 /* Do as much as possible w/o blocking */
375+
CHECKPOINT_FULL CheckpointMode = 1 /* Wait for writers, then checkpoint */
376+
CHECKPOINT_RESTART CheckpointMode = 2 /* Like FULL but wait for readers */
377+
CHECKPOINT_TRUNCATE CheckpointMode = 3 /* Like RESTART but also truncate WAL */
372378
)
373379

374380
// TxnState are the allowed return values from [Conn.TxnState].

ext/array/array.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ func (c *cursor) Next() error {
5959
}
6060

6161
func (c *cursor) RowID() (int64, error) {
62-
return int64(c.rowID), nil
62+
// One-based RowID for consistency with carray and other tables.
63+
return int64(c.rowID) + 1, nil
6364
}
6465

6566
func (c *cursor) Column(ctx sqlite3.Context, n int) error {

ext/closure/closure.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ func (c *closure) BestIndex(idx *sqlite3.IndexInfo) error {
154154
return sqlite3.CONSTRAINT
155155
}
156156

157+
idx.IdxFlags = sqlite3.INDEX_SCAN_HEX
157158
idx.EstimatedCost = cost
158159
idx.IdxNum = plan
159160
return nil

internal/util/const.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ const (
3939
ERROR_MISSING_COLLSEQ = ERROR | (1 << 8)
4040
ERROR_RETRY = ERROR | (2 << 8)
4141
ERROR_SNAPSHOT = ERROR | (3 << 8)
42+
ERROR_RESERVESIZE = ERROR | (4 << 8)
43+
ERROR_KEY = ERROR | (5 << 8)
44+
ERROR_UNABLE = ERROR | (6 << 8)
4245
IOERR_READ = IOERR | (1 << 8)
4346
IOERR_SHORT_READ = IOERR | (2 << 8)
4447
IOERR_WRITE = IOERR | (3 << 8)
@@ -73,6 +76,8 @@ const (
7376
IOERR_DATA = IOERR | (32 << 8)
7477
IOERR_CORRUPTFS = IOERR | (33 << 8)
7578
IOERR_IN_PAGE = IOERR | (34 << 8)
79+
IOERR_BADKEY = IOERR | (35 << 8)
80+
IOERR_CODEC = IOERR | (36 << 8)
7681
LOCKED_SHAREDCACHE = LOCKED | (1 << 8)
7782
LOCKED_VTAB = LOCKED | (2 << 8)
7883
BUSY_RECOVERY = BUSY | (1 << 8)

vtab.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,8 @@ const (
445445
type IndexScanFlag uint32
446446

447447
const (
448-
INDEX_SCAN_UNIQUE IndexScanFlag = 1
448+
INDEX_SCAN_UNIQUE IndexScanFlag = 0x00000001
449+
INDEX_SCAN_HEX IndexScanFlag = 0x00000002
449450
)
450451

451452
func vtabModuleCallback(i vtabConstructor) func(_ context.Context, _ api.Module, _ ptr_t, _ int32, _, _, _ ptr_t) res_t {

0 commit comments

Comments
 (0)