Skip to content

Commit 442068b

Browse files
committed
Fix failing tests
1 parent 61628a2 commit 442068b

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/SQLite.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,11 @@ end
182182

183183
# magic bytes that indicate that a value is in fact a serialized julia value, instead of just a byte vector
184184
# const SERIALIZATION = UInt8[0x11,0x01,0x02,0x0d,0x53,0x65,0x72,0x69,0x61,0x6c,0x69,0x7a,0x61,0x74,0x69,0x6f,0x6e,0x23]
185-
const SERIALIZATION = UInt8[0x34,0x10,0x01,0x0d,0x53,0x65,0x72,0x69,0x61,0x6c,0x69,0x7a,0x61,0x74,0x69,0x6f,0x6e,0x1f]
185+
if VERSION < v"0.7-dev"
186+
const SERIALIZATION = UInt8[0x34,0x10,0x01,0x0d,0x53,0x65,0x72,0x69,0x61,0x6c,0x69,0x7a,0x61,0x74,0x69,0x6f,0x6e,0x1f]
187+
else
188+
const SERIALIZATION = UInt8[0x37,0x4a,0x4c,0x07,0x04,0x00,0x00,0x00,0x34,0x10,0x01,0x0d,0x53,0x65,0x72,0x69,0x61,0x6c]
189+
end
186190
function sqldeserialize(r)
187191
ret = ccall(:memcmp, Int32, (Ptr{UInt8}, Ptr{UInt8}, UInt),
188192
SERIALIZATION, r, min(18, length(r)))

test/runtests.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using SQLite
2-
using Base.Test, Nulls, WeakRefStrings, DataStreams, DataFrames
2+
using Base.Test, Missings, WeakRefStrings, DataStreams, DataFrames
33

44
import Base: +, ==
55

@@ -24,7 +24,7 @@ results1 = SQLite.tables(db)
2424
results = SQLite.query(db,"SELECT * FROM Employee;")
2525
@test length(results) == 15
2626
@test size(Data.schema(results)) == (8,15)
27-
@test isnull(results[5][1])
27+
@test ismissing(results[5][1])
2828

2929
SQLite.query(db,"SELECT * FROM Album;")
3030
SQLite.query(db,"SELECT a.*, b.AlbumId
@@ -92,7 +92,7 @@ r = SQLite.query(db, "select * from $(sink.tablename)")
9292
@test all([typeof(i) for i in r[1]] .== Float64)
9393
SQLite.drop!(db, "$(sink.tablename)")
9494

95-
rng = Date(2013):Date(2013,1,5)
95+
rng = Date(2013):Dates.Day(1):Date(2013,1,5)
9696
dt = DataFrame(i=collect(rng), j=collect(rng))
9797
sink = SQLite.Sink(db, "temp", Data.schema(dt))
9898
SQLite.load(sink, dt)
@@ -244,9 +244,9 @@ SQLite.bind!(stmt, "@a", 1)
244244

245245
binddb = SQLite.DB()
246246
SQLite.query(binddb, "CREATE TABLE temp (n NULL, i6 INT, f REAL, s TEXT, a BLOB)")
247-
SQLite.query(binddb, "INSERT INTO temp VALUES (?1, ?2, ?3, ?4, ?5)"; values=Any[null, convert(Int64,6), 6.4, "some text", b"bytearray"])
247+
SQLite.query(binddb, "INSERT INTO temp VALUES (?1, ?2, ?3, ?4, ?5)"; values=Any[missing, convert(Int64,6), 6.4, "some text", b"bytearray"])
248248
r = SQLite.query(binddb, "SELECT * FROM temp")
249-
@test isa(r[1][1], Null)
249+
@test isa(r[1][1], Missing)
250250
@test isa(r[2][1], Int)
251251
@test isa(r[3][1], Float64)
252252
@test isa(r[4][1], AbstractString)

0 commit comments

Comments
 (0)