[Groonga-commit] groonga/groonga at 7d99099 [master] grn_table_get_key: support GRN_DB

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Jan 8 16:28:45 JST 2016


Kouhei Sutou	2016-01-08 16:28:45 +0900 (Fri, 08 Jan 2016)

  New Revision: 7d99099fa6ac83c669502d4bb7c066d078112bc6
  https://github.com/groonga/groonga/commit/7d99099fa6ac83c669502d4bb7c066d078112bc6

  Message:
    grn_table_get_key: support GRN_DB

  Modified files:
    lib/db.c

  Modified: lib/db.c (+6 -0)
===================================================================
--- lib/db.c    2016-01-08 16:02:39 +0900 (ba9ea73)
+++ lib/db.c    2016-01-08 16:28:45 +0900 (7b55422)
@@ -1553,6 +1553,9 @@ grn_table_get_key(grn_ctx *ctx, grn_obj *table, grn_id id, void *keybuf, int buf
   int r = 0;
   GRN_API_ENTER;
   if (table) {
+    if (table->header.type == GRN_DB) {
+      table = ((grn_db *)table)->keys;
+    }
     switch (table->header.type) {
     case GRN_TABLE_HASH_KEY :
       r = grn_hash_get_key(ctx, (grn_hash *)table, id, keybuf, buf_size);
@@ -1586,6 +1589,9 @@ grn_table_get_key2(grn_ctx *ctx, grn_obj *table, grn_id id, grn_obj *bulk)
   int r = 0;
   GRN_API_ENTER;
   if (table) {
+    if (table->header.type == GRN_DB) {
+      table = ((grn_db *)table)->keys;
+    }
     switch (table->header.type) {
     case GRN_TABLE_HASH_KEY :
       r = grn_hash_get_key2(ctx, (grn_hash *)table, id, bulk);
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index