fixes sqlite3_column_count() return check
sqlite3_column_count() may return 0 for SQL statements that do not return rows from the database. This should not be treated as an error. See: https://sqlite.org/c3ref/column_count.html
This commit is contained in:
@@ -178,6 +178,10 @@ column_names_test() ->
|
||||
{row, {Date}} = esqlite3:step(Stmt4),
|
||||
true = is_binary(Date),
|
||||
|
||||
%% Some statements have no column names
|
||||
{ok, Stmt5} = esqlite3:prepare("create table dummy(a, b, c);", Db),
|
||||
{} = esqlite3:column_names(Stmt5),
|
||||
|
||||
ok.
|
||||
|
||||
column_types_test() ->
|
||||
@@ -198,6 +202,10 @@ column_types_test() ->
|
||||
'$done' = esqlite3:step(Stmt),
|
||||
{'varchar(10)', int} = esqlite3:column_types(Stmt),
|
||||
|
||||
%% Some statements have no column types
|
||||
{ok, Stmt2} = esqlite3:prepare("create table dummy(a, b, c);", Db),
|
||||
{} = esqlite3:column_types(Stmt2),
|
||||
|
||||
ok.
|
||||
|
||||
nil_column_types_test() ->
|
||||
|
||||
Reference in New Issue
Block a user