1
0
Fork 0

Merge pull request #1140 from rqlite/malformed-db-fix

Fix "malformed database" issue
master
Philip O'Toole 2 years ago committed by GitHub
commit 407e63e1e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -24,7 +24,7 @@ jobs:
- run: go get -v -t -d ./...
- run: bash gofmt.sh
- run: go vet ./...
- run: go test ./...
- run: go test -failfast ./...
# The resource_class feature allows configuring CPU and RAM resources for each job. Different resource classes are available for different executors. https://circleci.com/docs/2.0/configuration-reference/#resourceclass
resource_class: large
@ -50,7 +50,7 @@ jobs:
- run: go version
- run: go get -t -d ./...
- run:
command: go test -v -timeout 20m -gcflags=all=-d=checkptr=0 -race ./...
command: go test -failfast -v -timeout 20m -gcflags=all=-d=checkptr=0 -race ./...
environment:
GORACE: "halt_on_error=1"

@ -4,6 +4,7 @@
- [PR #1136](https://github.com/rqlite/rqlite/pull/1136): Stop HTTP server gracefully on node shutdown.
- [f6c4b17](https://github.com/rqlite/rqlite/commit/f6c4b17a727809696f952a018b2262681932f521): By default, Leader node will stepdown if that node is shutting down.
- [PR #1139](https://github.com/rqlite/rqlite/pull/1139): Cache hashed passwords. Fixes [issue #1138](https://github.com/rqlite/rqlite/issues/1138).
- [PR #1140](https://github.com/rqlite/rqlite/pull/1140): Use SQLite with corrected in-memory database locking. Fixes [issue #1138](https://github.com/rqlite/rqlite/issues/1103).
## 7.12.0 (December 1st 2022)
### New features

@ -21,7 +21,7 @@ build_script:
- set LINKER_PKG_PATH=github.com/rqlite/rqlite/cmd
- go version
- go get ./...
- go test ./...
- go test -failfast ./...
- go install -ldflags="-X %LINKER_PKG_PATH%.Branch=%APPVEYOR_REPO_BRANCH% -X %LINKER_PKG_PATH%.Commit=%APPVEYOR_REPO_COMMIT%" ./...
after_build:

@ -1829,6 +1829,47 @@ func Test_JSON1(t *testing.T) {
}
}
// Test_TableCreationInMemoryLoadRaw tests for https://sqlite.org/forum/forumpost/d443fb0730
func Test_TableCreationInMemoryLoadRaw(t *testing.T) {
db := mustCreateInMemoryDatabase()
defer db.Close()
_, err := db.ExecuteStringStmt("CREATE TABLE logs (entry TEXT)")
if err != nil {
t.Fatalf("failed to create table: %s", err.Error())
}
done := make(chan struct{})
defer close(done)
// Insert some records continually, as fast as possible. Do it from a goroutine.
go func() {
for {
select {
case <-done:
return
default:
_, err := db.ExecuteStringStmt(`INSERT INTO logs(entry) VALUES("hello")`)
if err != nil {
return
}
}
}
}()
// Get the count over and over again.
for i := 0; i < 5000; i++ {
rows, err := db.QueryStringStmt(`SELECT COUNT(*) FROM logs`)
if err != nil {
t.Fatalf("failed to query for count: %s", err)
}
if rows[0].Error != "" {
t.Fatalf("rows had error after %d queries: %s", i, rows[0].Error)
}
}
}
func mustCreateDatabase() (*DB, string) {
var err error
f := mustTempFile()

@ -19,7 +19,7 @@ require (
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mkideal/cli v0.2.7
github.com/mkideal/pkg v0.1.3
github.com/rqlite/go-sqlite3 v1.27.0
github.com/rqlite/go-sqlite3 v1.27.1
github.com/rqlite/raft-boltdb v0.0.0-20211018013422-771de01086ce
github.com/rqlite/rqlite-disco-clients v0.0.0-20220328160918-ec33ecd01491
github.com/rqlite/sql v0.0.0-20221103124402-8f9ff0ceb8f0

@ -700,6 +700,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rqlite/go-sqlite3 v1.27.0 h1:p+TMKJ4s0SmLh+WG4bd7SQgzp8H1f+x1jep0UI4McQU=
github.com/rqlite/go-sqlite3 v1.27.0/go.mod h1:nd4ooHtz396nqTudi+5u7stMN8EEkHjceyUARVYOceY=
github.com/rqlite/go-sqlite3 v1.27.1 h1:BZMF7lB7kflMgWbULsM8TpKHM9vzcINEknbe0YC6Ti0=
github.com/rqlite/go-sqlite3 v1.27.1/go.mod h1:nd4ooHtz396nqTudi+5u7stMN8EEkHjceyUARVYOceY=
github.com/rqlite/raft-boltdb v0.0.0-20211018013422-771de01086ce h1:sVlzmCJiaM0LGK3blAHOD/43QxJZ8bLCDcsqZRatnFE=
github.com/rqlite/raft-boltdb v0.0.0-20211018013422-771de01086ce/go.mod h1:mc+WNDHyskdViYAoPnaMXEBnSKBmoUgiEZjrlAj6G34=
github.com/rqlite/rqlite-disco-clients v0.0.0-20220328160918-ec33ecd01491 h1:EtnrSIl+hdibyxb8ykdU9BFxqKUH4c4trKWLwNQD2vM=

Loading…
Cancel
Save