Skip to content

Commit

Permalink
load: clear loader when it's no longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Mar 15, 2016
1 parent 57d2f0a commit 81c16a2
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ proc_load(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
if (ctx->impl->loader.table) {
grn_db_touch(ctx, DB_OBJ(ctx->impl->loader.table)->db);
}
/* maybe necessary : grn_ctx_loader_clear(ctx); */
grn_ctx_loader_clear(ctx);
}
return NULL;
}
Expand Down
20 changes: 20 additions & 0 deletions test/command/suite/load/load_after_table_remove.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
table_create Users TABLE_NO_KEY
[[0,0.0,0.0],true]
column_create Users age COLUMN_SCALAR Int32
[[0,0.0,0.0],true]
table_create AnotherUsers TABLE_NO_KEY
[[0,0.0,0.0],true]
column_create AnotherUsers age COLUMN_SCALAR Int32
[[0,0.0,0.0],true]
load --table Users --columns "age"
[
[1]
]
[[0,0.0,0.0],1]
table_remove Users
[[0,0.0,0.0],true]
load --table AnotherUsers --columns "age"
[
[1]
]
[[0,0.0,0.0],1]
16 changes: 16 additions & 0 deletions test/command/suite/load/load_after_table_remove.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
table_create Users TABLE_NO_KEY
column_create Users age COLUMN_SCALAR Int32
table_create AnotherUsers TABLE_NO_KEY
column_create AnotherUsers age COLUMN_SCALAR Int32

load --table Users --columns "age"
[
[1]
]

table_remove Users

load --table AnotherUsers --columns "age"
[
[1]
]

0 comments on commit 81c16a2

Please sign in to comment.