The bind test now works again

This commit is contained in:
Maas-Maarten Zeeman
2022-05-24 23:46:31 +02:00
parent 8754c1c40b
commit 507e5407d8
3 changed files with 38 additions and 17 deletions

View File

@@ -856,7 +856,7 @@ esqlite_bind_blob(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
return enif_make_badarg(env);
}
if(!enif_inspect_iolist_as_binary(env, argv[1], &blob)) {
if(!enif_inspect_iolist_as_binary(env, argv[2], &blob)) {
return enif_make_badarg(env);
}
@@ -926,8 +926,13 @@ esqlite_step(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
return row;
}
case SQLITE_DONE:
/* since 3.6.23.1 it is no longer required to do an explict reset.
/*
* Automatically reset the statement after a done so
* column_names will work after the statement is done.
*
* Not resetting the statement can lead to vm crashes.
*/
sqlite3_reset(stmt->statement);
return make_atom(env, "$done");
case SQLITE_BUSY:
return make_atom(env, "$busy");