You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Registering different UDF functions in different databases but with the same name doesn't work and silently gives a wrong result:
using SQLite
using DBInterface: execute
db_a = SQLite.DB(":memory:")
db_b = SQLite.DB(":memory:")
SQLite.register(db_a, x ->2x, name="myfunc")
SQLite.register(db_b, x ->10x, name="myfunc")
@showfirst(execute(db_a, """select myfunc(1) as x""")) # shows 10 (should be 2)@showfirst(execute(db_b, """select myfunc(1) as x""")) # shows 10 (as it should)
Definitions with the function keyword are global in Julia, and SQLite.jl defines function myfunc(x) in both cases above. Can this be an anonymous function instead? I think it would fix the bug.
The text was updated successfully, but these errors were encountered:
Registering different UDF functions in different databases but with the same name doesn't work and silently gives a wrong result:
As I understand, it's due to this line:
SQLite.jl/src/UDF.jl
Line 54 in 4b22cc4
Definitions with the
function
keyword are global in Julia, and SQLite.jl definesfunction myfunc(x)
in both cases above. Can this be an anonymous function instead? I think it would fix the bug.The text was updated successfully, but these errors were encountered: