Skip to content

Commit cda1335

Browse files
committed
fix #104
1 parent 95c42a4 commit cda1335

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/SQLite.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ end
115115
# Binding parameters to SQL statements
116116
"bind `val` to the named parameter `name`"
117117
function bind!(stmt::Stmt,name::AbstractString,val)
118-
i = sqlite3_bind_parameter_index(stmt.handle,name)
118+
i::Int = sqlite3_bind_parameter_index(stmt.handle,name)
119119
if i == 0
120120
throw(SQLiteException("SQL parameter $name not found in $stmt"))
121121
end

test/runtests.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,3 +311,9 @@ dt3 = SQLite.query(db, "Select * from temp")
311311
@test get(dt3[2,2]) == "B"
312312
@test get(dt3[3,1]) == 2
313313
@test get(dt3[3,2]) == "C"
314+
315+
# issue #104
316+
db = SQLite.DB() #In case the order of tests is changed
317+
SQLite.execute!(db, "CREATE TABLE IF NOT EXISTS tbl(a INTEGER);")
318+
stmt = SQLite.Stmt(db, "INSERT INTO tbl (a) VALUES (@a);")
319+
SQLite.bind!(stmt, "@a", 1)

0 commit comments

Comments
 (0)