0
0
mirror of https://gitlab.com/cznic/sqlite.git synced 2025-05-22 23:28:02 +00:00

94 Commits

Author SHA1 Message Date
134c4cb6b7 Fix ScanType returned for BLOB
Previously ColumnTypeScanType returned the reflect.Type of [][]byte
for BLOB columns, resulting in a failure to scan when the type was
constructed dynamically based on this return.
2023-07-08 16:53:02 +09:30
7b81804e09 add reproducer, closes
test binary compiled for linux/amd64
=== RUN   TestIssue153
=== RUN   TestIssue153/SELECT_1_WHERE_false
=== RUN   TestIssue153/--_just_a_comment
=== RUN   TestIssue153/#00
--- PASS: TestIssue153 (0.00s)
    --- PASS: TestIssue153/SELECT_1_WHERE_false (0.00s)
    --- PASS: TestIssue153/--_just_a_comment (0.00s)
    --- PASS: TestIssue153/#00 (0.00s)
PASS
ok  	modernc.org/sqlite	0.029s

From the issue:

> This issue might be related to this one:  (closed)

Confirmed.
2023-07-06 12:12:11 +02:00
d80a58a814 add reproducer, updates
=== RUN   TestIssue152
=== RUN   TestIssue152/SELECT_1_WHERE_false
=== RUN   TestIssue152/--_just_a_comment
    all_test.go:3019: sql: no Rows available
--- FAIL: TestIssue152 (0.00s)
    --- PASS: TestIssue152/SELECT_1_WHERE_false (0.00s)
    --- FAIL: TestIssue152/--_just_a_comment (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x5b5c69]

goroutine 9 [running]:
testing.tRunner.func1.2({0xaeff40, 0x13d9870})
	/usr/local/go/src/testing/testing.go:1526 +0x24e
testing.tRunner.func1()
	/usr/local/go/src/testing/testing.go:1529 +0x39f
panic({0xaeff40, 0x13d9870})
	/usr/local/go/src/runtime/panic.go:884 +0x213
database/sql.(*Rows).close.func1()
	/usr/local/go/src/database/sql/sql.go:3287 +0x29
database/sql.withLock({0xf82190, 0xc0001be990}, 0xc0001fbca0)
	/usr/local/go/src/database/sql/sql.go:3405 +0x8c
database/sql.(*Rows).close(0xc000133480, {0x0, 0x0})
	/usr/local/go/src/database/sql/sql.go:3286 +0x16d
database/sql.(*Rows).Close(0x4f12c6?)
	/usr/local/go/src/database/sql/sql.go:3270 +0x1d
runtime.Goexit()
	/usr/local/go/src/runtime/panic.go:522 +0x177
testing.(*common).FailNow(0xc000135040)
	/usr/local/go/src/testing/testing.go:980 +0x4c
testing.(*common).Fatal(0xc000135040, {0xc0001fbf18?, 0xc00001a0f0?, 0xb34fee?})
	/usr/local/go/src/testing/testing.go:1057 +0x58
modernc.org/sqlite.testIssue152(0xc000135040, {0xb34fee, 0x11})
	/home/jnml/src/modernc.org/sqlite/all_test.go:3019 +0x1d0
modernc.org/sqlite.TestIssue152.func1(0x0?)
	/home/jnml/src/modernc.org/sqlite/all_test.go:2998 +0x25
testing.tRunner(0xc000135040, 0xc0000638a0)
	/usr/local/go/src/testing/testing.go:1576 +0x10b
created by testing.(*T).Run
	/usr/local/go/src/testing/testing.go:1629 +0x3ea
exit status 2
FAIL	modernc.org/sqlite	0.008s
2023-07-05 11:38:16 +02:00
91c2fe3015 expose sqlite3_limit, updates 2023-06-08 17:01:32 +02:00
d7a10c89b0 document v1.23.0 release.2 2023-06-01 11:18:23 +02:00
1a90dd084e remove tests for closed 2023-06-01 11:14:59 +02:00
ab37853542 Merge branch 'support-aggregate-functions' into 'master'
Allow registering aggregate functions

See merge request 
2023-05-31 10:15:15 +00:00
b5a7962754 Use static callbacks for user-defined functions
This ensures that they cannot be GCed.

See https://gitlab.com/cznic/sqlite/-/merge_requests/54#note_1396299066
for more details.
2023-05-30 21:01:32 +01:00
8cf45a57be tweak constants, updates 2023-05-08 20:02:28 +02:00
f068b0c07b revert 701ac1e, enlarge retry delay 2023-05-07 12:11:05 +02:00
701ac1e1a8 TestIssue142: add pragma busy timeout 2023-05-06 21:32:48 +02:00
86167f4955 TestIssue142: add SQLITE_BUSY recovery, updates 2023-05-05 13:30:14 +02:00
5cbe418de3 add reproduction code, updates
Does not fail for 1000 cases without -race, does fail with -race.

jnml@3900x:~/src/modernc.org/sqlite$ go test -v -timeout 24h -run TestIssue142 -race |& tee log-test-issue142
test binary compiled for linux/amd64
=== RUN   TestIssue142
    all_test.go:3406: 0
    all_test.go:3406: 1
    all_test.go:3406: 2
    all_test.go:3406: 3
    all_test.go:3406: 4
    all_test.go:3521: database is locked (5) (SQLITE_BUSY)
--- FAIL: TestIssue142 (0.10s)
FAIL
exit status 1
FAIL	modernc.org/sqlite	0.110s
jnml@3900x:~/src/modernc.org/sqlite$
2023-05-02 11:50:22 +02:00
0099444126 add debug facitlity, updates 2023-04-30 14:34:58 +02:00
343988cb93 upgrade to SQLite 3.40.1 2022-12-28 23:26:14 +01:00
9f821b1d2f add concurrent benchmarks 2022-12-11 21:04:17 +01:00
14c5b15dab make TestIssue65 pass on linux/ppc64le VM 2022-12-09 22:33:37 +01:00
fb2d5b92be make TestIssue20 pass on linux/ppc64le VM 2022-12-09 21:28:00 +01:00
0ea173f350 Added TestIssue118, updates 2022-11-23 10:26:21 +00:00
5c9c85057b openbsd/arm64: use modified mptest.c 2022-09-20 19:52:38 +02:00
fd7b2cc5b3 support freebsd/arm64 2022-09-15 11:30:54 +02:00
af5809db50 freebsd/arm: generate 2022-09-11 22:48:46 +02:00
8f692c983b migrate from deprecated ioutil package 2022-08-25 09:38:46 +00:00
520ebf401b vfs: New returns name
Instead of requiring a name arg that may clash with other state, have
New only take the fs.FS and return the value that should be used for
`vfs` in the sql.Open DSN.
2022-07-23 19:09:35 -03:00
c128158b86 remove user-facing global state 2022-07-23 12:46:41 +02:00
8be0ef8f37 switch from embed.FS to fs.FS 2022-07-23 11:24:08 +02:00
85dd432315 implement embed support prototype 2022-07-22 14:45:40 +02:00
f2a990b23b Fix handling of nil []byte as NULL values
This fixes a regression introduced in 87412bbfa9,
which changed nil []byte values by storing them as zero-sized blobs, instead of
NULLs.

Closes 
2022-05-18 23:52:19 +03:00
8adabd5734 tests: add a test for issue 97 2022-04-05 22:58:58 +02:00
87412bbfa9 driver: fix inserting empty blobs 2022-04-03 10:09:39 +00:00
f5a64f2267 sqlite: initial handling for user defined functions
This PR adds handling for user defined functions. Initially only the
xFunc parameter will be set, the others will come in subsequent PRs.
A test for a 'regexp' udf was added to check that the query

  "SELECT 'seafood' REGEXP 'foo.*'"

works as expected.
2022-04-01 13:59:51 +00:00
302d71cedc Fix race condition if exec's context is canceled just after completion 2022-03-15 11:22:26 +00:00
917fbf26bb support linux/riscv64, updates libc#16 2022-03-12 21:53:57 +00:00
8e27ffc817 Add _txlock DSN parameter to customize BEGIN 2022-02-03 14:14:24 +00:00
333ac00e6b linux/arm: regenerate 2021-11-01 22:34:01 +01:00
6f800703d3 TestConcurrentProcesses: enlarge timeout, enables slow builders to pass 2021-10-24 18:00:29 +02:00
064df839a4 driver: support _time_format DSN query param
Building on the _pragma query param support added in 508747c9, support
a new _time_format query param.

If _time_format is set to "sqlite", written times use the time package
format "2006-01-02 15:04:05.999999999-07:00". This is the format
mattn/go-sqlite3 uses and is format 4 at
https://sqlite.org/lang_datefunc.html#time_values.

By default, times are formatted with time.Time.String. This maintains
compatibility with existing users of the driver.

Fixes 
2021-10-23 15:36:02 -03:00
a530c91309 driver: return error strings for constraint errors
In conn.step, use conn.errstr which gets the error from sqlite instead
of looking up the result code in the ErrorCodeString map.

This changes the code 5 (SQLITE_BUSY) message slightly, including
"database is locked" as returned my errstr. "SQLITE_BUSY" is still
added to the message.

Fixes 
2021-10-23 09:42:14 -03:00
da74fa6c39 remove --trace 2 from TestConcurrentProcesses 2021-09-25 10:53:13 +02:00
fa683c81c6 add test, updates 2021-09-17 12:38:44 +02:00
e3be4b029c fix retry logic around conn.step, updates 2021-09-14 16:20:20 +02:00
e1d8d213c1 Fix invalid test, resolves 2021-09-13 13:50:13 +02:00
7f27fe4762 add TestIssue70, updates 2021-09-13 12:00:13 +02:00
65c49f4def freebsd/amd64: initial port, GO111MODULE=off only, updates libc#10. 2021-09-04 21:39:54 +02:00
8efc1b0753 windows: fix TestPersistPragma.3, updates 2021-09-01 14:38:12 +02:00
aa7d275125 windows: fix TestPersistPragma.2, updates 2021-09-01 14:24:15 +02:00
7ecaceaa8f windows: fix TestPersistPragma, updates 2021-09-01 14:06:04 +02:00
508747c957 Persist pragma configurations via url parameter 2021-08-19 00:02:34 +00:00
ffc4be292a update all targets but darwin/arm64 to SQLite 3.36, updates 2021-06-21 12:21:04 +02:00
cc37e09f4c close db after test case 2021-06-10 21:25:36 -04:00