vrischmann / zig-sqlite

zig-sqlite is a small wrapper around sqlite's C API, making it easier to use with Zig.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Testing with dbfile and in_memory=false options fail

greenfork opened this issue · comments

This produces errors:

zig build test -Din_memory=false -Ddbfile=/tmp/my.db
1/49 test "native-Debug-multi sqlite: db init"... OK
2/49 test "native-Debug-multi sqlite: exec multi"... OK
3/49 test "native-Debug-multi sqlite: exec multi with single statement"... FAIL (SQLiteError)
/home/grfork/reps/kisa/deps/zig-sqlite/errors.zig:179:27: 0x24badd in errors.errorFromResultCode (test)
        c.SQLITE_ERROR => return error.SQLiteError,
                          ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:1591:17: 0x24d442 in DynamicStatement.prepare (test)
                return errors.errorFromResultCode(result);
                ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:486:16: 0x2439a4 in Db.prepareDynamicWithDiags (test)
        return try DynamicStatement.prepare(self, query, options, 0);
               ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:863:24: 0x237ed1 in Db.execMulti (test)
                stmt = try self.prepareDynamicWithDiags(query, new_options);
                       ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:2355:5: 0x21f294 in test "native-Debug-multi sqlite: exec multi with single statement" (test)
    try db.execMulti("create table a(b int);", .{});
    ^
4/49 test "native-Debug-multi sqlite: db pragma"... OK
5/49 test "native-Debug-multi sqlite: last insert row id"... OK
6/49 test "native-Debug-multi sqlite: statement exec"... OK
7/49 test "native-Debug-multi sqlite: statement execDynamic"... OK
8/49 test "native-Debug-multi sqlite: db execAlloc"... OK
9/49 test "native-Debug-multi sqlite: read a single user into a struct"... OK
10/49 test "native-Debug-multi sqlite: read all users into a struct"... OK
11/49 test "native-Debug-multi sqlite: read in an anonymous struct"... OK
12/49 test "native-Debug-multi sqlite: read in a Text struct"... OK
13/49 test "native-Debug-multi sqlite: read a single text value"... OK
14/49 test "native-Debug-multi sqlite: read a single integer value"... OK
15/49 test "native-Debug-multi sqlite: read a single value into an enum backed by an integer"... OK
16/49 test "native-Debug-multi sqlite: read a single value into an enum backed by a string"... OK
17/49 test "native-Debug-multi sqlite: read a single value into void"... OK
18/49 test "native-Debug-multi sqlite: read a single value into bool"... OK
19/49 test "native-Debug-multi sqlite: insert bool and bind bool"... OK
20/49 test "native-Debug-multi sqlite: bind string literal"... OK
21/49 test "native-Debug-multi sqlite: bind pointer"... OK
22/49 test "native-Debug-multi sqlite: read pointers"... OK
23/49 test "native-Debug-multi sqlite: optional"... OK
24/49 test "native-Debug-multi sqlite: statement reset"... OK
25/49 test "native-Debug-multi sqlite: statement iterator"... OK
26/49 test "native-Debug-multi sqlite: blob open, reopen"... OK
27/49 test "native-Debug-multi sqlite: failing open"... OK
28/49 test "native-Debug-multi sqlite: failing prepare statement"... OK
29/49 test "native-Debug-multi sqlite: diagnostics format"... OK
30/49 test "native-Debug-multi sqlite: exec with diags, failing statement"... OK
31/49 test "native-Debug-multi sqlite: savepoint with no failures"... OK
32/49 test "native-Debug-multi sqlite: two nested savepoints with inner failure"... OK
33/49 test "native-Debug-multi sqlite: two nested savepoints with outer failure"... OK
34/49 test "native-Debug-multi sqlite: bind custom type"... OK
35/49 test "native-Debug-multi sqlite: bind runtime slice"... OK
36/49 test "native-Debug-multi sqlite: prepareDynamic"... OK
37/49 test "native-Debug-multi sqlite: oneDynamic"... OK
38/49 test "native-Debug-multi sqlite: one with all named parameters"... OK
39/49 test "native-Debug-multi sqlite: create scalar function"... OK
40/49 test "native-Debug-multi sqlite: create aggregate function with no aggregate context"... OK
41/49 test "native-Debug-multi sqlite: create aggregate function with an aggregate context"... FAIL (SQLiteError)
/home/grfork/reps/kisa/deps/zig-sqlite/errors.zig:179:27: 0x24badd in errors.errorFromResultCode (test)
        c.SQLITE_ERROR => return error.SQLiteError,
                          ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:1591:17: 0x24d442 in DynamicStatement.prepare (test)
                return errors.errorFromResultCode(result);
                ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:486:16: 0x2439a4 in Db.prepareDynamicWithDiags (test)
        return try DynamicStatement.prepare(self, query, options, 0);
               ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:863:24: 0x237ed1 in Db.execMulti (test)
                stmt = try self.prepareDynamicWithDiags(query, new_options);
                       ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:2355:5: 0x21f294 in test "native-Debug-multi sqlite: exec multi with single statement" (test)
    try db.execMulti("create table a(b int);", .{});
    ^
/home/grfork/reps/kisa/deps/zig-sqlite/errors.zig:192:30: 0x24bdcf in errors.errorFromResultCode (test)
        c.SQLITE_CANTOPEN => return error.SQLiteCantOpen,
                             ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:342:21: 0x240d9a in Db.init (test)
                    return errors.errorFromResultCode(result);
                    ^
/home/grfork/reps/kisa/deps/zig-sqlite/errors.zig:179:27: 0x24badd in errors.errorFromResultCode (test)
        c.SQLITE_ERROR => return error.SQLiteError,
                          ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:1591:17: 0x24d442 in DynamicStatement.prepare (test)
                return errors.errorFromResultCode(result);
                ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:2035:33: 0x283b19 in Statement((struct StatementOptions constant),(struct query.ParsedQueryState(21) constant)).prepare (test)
                .dynamic_stmt = try DynamicStatement.prepare(db, query.getQuery(), options, flags),
                                ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:481:9: 0x2412da in Db.prepareWithDiags (test)
        return StatementType(.{}, query).prepare(self, options, 0);
        ^
/home/grfork/reps/kisa/deps/zig-sqlite/errors.zig:179:27: 0x24badd in errors.errorFromResultCode (test)
        c.SQLITE_ERROR => return error.SQLiteError,
                          ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:2144:21: 0x241a4c in Statement((struct StatementOptions constant),(struct query.ParsedQueryState(8) constant)).exec (test)
                    return errors.errorFromResultCode(result);
                    ^
/home/grfork/reps/kisa/deps/zig-sqlite/errors.zig:179:27: 0x24badd in errors.errorFromResultCode (test)
        c.SQLITE_ERROR => return error.SQLiteError,
                          ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:1591:17: 0x24d442 in DynamicStatement.prepare (test)
                return errors.errorFromResultCode(result);
                ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:2035:33: 0x288d99 in Statement((struct StatementOptions constant),(struct query.ParsedQueryState(63) constant)).prepare (test)
                .dynamic_stmt = try DynamicStatement.prepare(db, query.getQuery(), options, flags),
                                ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:481:9: 0x288b6a in Db.prepareWithDiags (test)
        return StatementType(.{}, query).prepare(self, options, 0);
        ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:428:20: 0x242701 in Db.exec (test)
        var stmt = try self.prepareWithDiags(query, options);
                   ^
/home/grfork/reps/kisa/deps/zig-sqlite/errors.zig:179:27: 0x24badd in errors.errorFromResultCode (test)
        c.SQLITE_ERROR => return error.SQLiteError,
                          ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:1591:17: 0x24d442 in DynamicStatement.prepare (test)
                return errors.errorFromResultCode(result);
                ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:2035:33: 0x288d99 in Statement((struct StatementOptions constant),(struct query.ParsedQueryState(63) constant)).prepare (test)
                .dynamic_stmt = try DynamicStatement.prepare(db, query.getQuery(), options, flags),
                                ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:481:9: 0x28af3a in Db.prepareWithDiags (test)
        return StatementType(.{}, query).prepare(self, options, 0);
        ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:428:20: 0x242bf1 in Db.exec (test)
        var stmt = try self.prepareWithDiags(query, options);
                   ^
/home/grfork/reps/kisa/deps/zig-sqlite/errors.zig:179:27: 0x24badd in errors.errorFromResultCode (test)
        c.SQLITE_ERROR => return error.SQLiteError,
                          ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:1591:17: 0x24d442 in DynamicStatement.prepare (test)
                return errors.errorFromResultCode(result);
                ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:2035:33: 0x297749 in Statement((struct StatementOptions constant),(struct query.ParsedQueryState(63) constant)).prepare (test)
                .dynamic_stmt = try DynamicStatement.prepare(db, query.getQuery(), options, flags),
                                ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:481:9: 0x29751a in Db.prepareWithDiags (test)
        return StatementType(.{}, query).prepare(self, options, 0);
        ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:428:20: 0x2469c1 in Db.exec (test)
        var stmt = try self.prepareWithDiags(query, options);
                   ^
/home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig:3867:5: 0x230e26 in test "native-Debug-multi sqlite: create aggregate function with an aggregate context" (test)
    try db.exec("CREATE TABLE view(id integer PRIMARY KEY, a integer, b integer)", .{}, .{});
    ^
42/49 test "native-Debug-multi sqlite: empty slice"... OK
43/49 test "native-Debug-multi sqlite: fuzzer found crashes"... OK
44/49 test "native-Debug-multi tagged union"... OK
45/49 query.test "native-Debug-multi parsed query: query"... OK
46/49 query.test "native-Debug-multi parsed query: bind markers types"... OK
47/49 query.test "native-Debug-multi parsed query: bind markers identifier"... OK
48/49 query.test "native-Debug-multi parsed query: query bind identifier"... OK
49/49 query.test "native-Debug-multi parsed query: bind marker character inside string"... OK
47 passed; 0 skipped; 2 failed.
error: the following test command failed with exit code 1:
/home/grfork/reps/kisa/deps/zig-sqlite/zig-cache/o/9d26e6dd2d41d7da3e75aeaa719bf63d/test /home/grfork/zig-linux-x86_64-0.10.0-dev.3685+dae7aeb33/zig
error: test...
error: The following command exited with error code 1:
/home/grfork/zig-linux-x86_64-0.10.0-dev.3685+dae7aeb33/zig test -fstage1 /home/grfork/reps/kisa/deps/zig-sqlite/sqlite.zig -lc -lsqlite3 --test-name-prefix native-Debug-multi  --cache-dir /home/grfork/reps/kisa/deps/zig-sqlite/zig-cache --global-cache-dir /home/grfork/.cache/zig --name test -fno-single-threaded --pkg-begin build_options /home/grfork/reps/kisa/deps/zig-sqlite/zig-cache/options/4nHAGINNEroBRc8FiT6lgf-aAeWAO-6XQNU2mVqz2-ZyD-032_o-sPOHpurnzg8P --pkg-end --enable-cache 
error: the following build command failed with exit code 1:
/home/grfork/reps/kisa/deps/zig-sqlite/zig-cache/o/e8c7e47bf7278113a988e32bda21a73b/build /home/grfork/zig-linux-x86_64-0.10.0-dev.3685+dae7aeb33/zig /home/grfork/reps/kisa/deps/zig-sqlite /home/grfork/reps/kisa/deps/zig-sqlite/zig-cache /home/grfork/.cache/zig test -Din_memory=false -Ddbfile=/tmp/my.db

I've just created #109, could you verify that it fixes all issues for you ?