From 1f45ee05f543f40b90d1271d32df14f9f6f227d0 Mon Sep 17 00:00:00 2001 From: Alexey Romanov Date: Thu, 18 Nov 2010 18:02:01 +0300 Subject: [PATCH] 101 isn't table id, it's SQLITE_DONE code --- c_src/sqlite3_drv.c | 10 +++------- test/sqlite3_test.erl | 6 +++--- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/c_src/sqlite3_drv.c b/c_src/sqlite3_drv.c index 793243a..68584f1 100644 --- a/c_src/sqlite3_drv.c +++ b/c_src/sqlite3_drv.c @@ -382,18 +382,14 @@ static void sql_exec_async(void *_async_command) { dataset[term_count - 2] = ERL_DRV_TUPLE; dataset[term_count - 1] = 2; } else { - term_count += 6; + term_count += 2; if (term_count > term_allocated) { term_allocated = (term_count >= term_allocated*2) ? term_count : term_allocated*2; dataset = realloc(dataset, sizeof(*dataset) * term_allocated); } - dataset[term_count - 6] = ERL_DRV_ATOM; - dataset[term_count - 5] = drv->atom_ok; - dataset[term_count - 4] = ERL_DRV_INT; - dataset[term_count - 3] = next_row; - dataset[term_count - 2] = ERL_DRV_TUPLE; - dataset[term_count - 1] = 2; + dataset[term_count - 2] = ERL_DRV_ATOM; + dataset[term_count - 1] = drv->atom_ok; } term_count += 2; diff --git a/test/sqlite3_test.erl b/test/sqlite3_test.erl index 1aca056..a877642 100644 --- a/test/sqlite3_test.erl +++ b/test/sqlite3_test.erl @@ -61,7 +61,7 @@ basic_functionality() -> ?assertEqual( [], sqlite3:list_tables(ct)), - {ok, TableId} = sqlite3:create_table(ct, user, TableInfo), + ok = sqlite3:create_table(ct, user, TableInfo), ?assertEqual( [user], sqlite3:list_tables(ct)), @@ -93,13 +93,13 @@ basic_functionality() -> [{columns, Columns}, {rows, AllRows}], sqlite3:read(ct, user, {wage, 2000})), ?assertEqual( - {ok, TableId}, + ok, sqlite3:delete(ct, user, {name, "marge"})), ?assertEqual( [{columns, Columns}, {rows, AbbyOnly}], sqlite3:sql_exec(ct, "select * from user;")), ?assertEqual( - {ok, TableId}, + ok, sqlite3:drop_table(ct, user)). blob() ->