Skip to content

Commit 6f51a51

Browse files
committed
More 0.5 compat
1 parent ddd840b commit 6f51a51

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

src/SQLite.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ function bind!{V}(stmt::Stmt, values::Dict{Symbol, V})
109109
@assert !isempty(name) "nameless parameters should be passed as a Vector"
110110
# name is returned with the ':', '@' or '$' at the start
111111
name = name[2:end]
112-
bind!(stmt, i, values[symbol(name)])
112+
bind!(stmt, i, values[@compat(Symbol)(name)])
113113
end
114114
end
115115
# Binding parameters to SQL statements

src/UDF.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ function scalarfunc(func,fsym=symbol(string(func)))
4848
SQLite.sqlreturn(context, ret)
4949
nothing
5050
end
51+
return $(nm)
5152
end
5253
end
5354
function scalarfunc(expr::Expr)
@@ -138,6 +139,7 @@ function stepfunc(init, func, fsym=symbol(string(func)*"_step"))
138139
end
139140
nothing
140141
end
142+
return $(nm)
141143
end
142144
end
143145

@@ -177,6 +179,7 @@ function finalfunc(init, func, fsym=symbol(string(func)*"_final"))
177179
end
178180
nothing
179181
end
182+
return $(nm)
180183
end
181184
end
182185

@@ -193,7 +196,7 @@ function register(db, func::Function; nargs::Int=-1, name::AbstractString=string
193196
nargs < -1 && (nargs = -1)
194197
@assert sizeof(name) <= 255 "size of function name must be <= 255"
195198

196-
f = eval(scalarfunc(func,symbol(name)))
199+
f = eval(scalarfunc(func,@compat(Symbol)(name)))
197200

198201
cfunc = cfunction(f, Void, (Ptr{Void}, Cint, Ptr{Ptr{Void}}))
199202
# TODO: allow the other encodings

test/runtests.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ results = SQLite.query(db,"SELECT * FROM Employee;")
2525
@test length(results.data) == 15
2626
@test size(results) == (8,15)
2727
@test typeof(results[1,1]) == Nullable{Int}
28-
@test typeof(results[1,2]) == Nullable{UTF8String}
28+
@test typeof(results[1,2]) == Nullable{@compat(String)}
2929
@test isnull(results[1,5])
3030

3131
SQLite.query(db,"SELECT * FROM Album;")
@@ -277,10 +277,10 @@ dt = Data.stream!(source3,Data.Table)
277277

278278
#Make sure we handle undefined values
279279
db = SQLite.DB() #In case the order of tests is changed
280-
arr = Array(UTF8String,2)
280+
arr = Array(@compat(String),2)
281281
arr[1] = "1" #Now an array with the second value undefined
282282
nv = NullableArrays.NullableArray(arr, [false, true])
283-
schema = DataStreams.Data.Schema(["nv"], [UTF8String],2)
283+
schema = DataStreams.Data.Schema(["nv"], [@compat(String)],2)
284284
d = NullableArrays.NullableVector[nv]
285285
dt = DataStreams.Data.Table(schema, d,0)
286286
SQLite.drop!(db, "temp", ifexists=true)
@@ -294,10 +294,10 @@ dt2 = SQLite.query(db, "Select * from temp")
294294
#Test removeduplicates!
295295
db = SQLite.DB() #In case the order of tests is changed
296296
ints = Int64[1,1,2,2,3]
297-
strs = UTF8String["A", "A", "B", "C", "C"]
297+
strs = @compat(String)["A", "A", "B", "C", "C"]
298298
nvInts = NullableArrays.NullableArray(ints)
299299
nvStrs = NullableArrays.NullableArray(strs)
300-
schema = DataStreams.Data.Schema(["ints", "strs"], [Int64, UTF8String],5)
300+
schema = DataStreams.Data.Schema(["ints", "strs"], [Int64, @compat(String)],5)
301301
d = NullableArrays.NullableVector[nvInts, nvStrs]
302302
dt = DataStreams.Data.Table(schema, d,0)
303303
SQLite.drop!(db, "temp", ifexists=true)

0 commit comments

Comments
 (0)