We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
次のコードで segmentation fault が起こります。 grn_table_delete した後にもう一度 grn_table_delete_by_id したときです。 zlib を有効にしない場合は問題ないです。 私が調べたところ grn_ja_ref_zlib でエラーが起こっているようなのですが、 修正する方法はわかりませんでした。
私の環境は ubuntu 11.10 amd64 で groonga は git リポジトリの最新を使いました。
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <groonga.h> int main(int argc, char **argv) { unsigned key_size = 8; grn_ctx ctx; grn_obj *db, *table, *column, *key_type, *value_type; grn_id id; grn_obj buf; grn_rc rc; int added; const char *path = "db"; if (grn_init()) { fprintf(stderr, "grn_init() failed\n"); return -1; } if (grn_ctx_init(&ctx, 0)) { fprintf(stderr, "grn_ctx_init() failed\n"); return -1; } db = grn_db_open(&ctx, path); if (!db) { db = grn_db_create(&ctx, path, NULL); } if (!db) { fprintf(stderr, "db initialize failed\n"); return -1; } key_type = grn_ctx_at(&ctx, GRN_DB_SHORT_TEXT); table = grn_table_create(&ctx, "t1", 2, NULL, GRN_OBJ_TABLE_HASH_KEY|GRN_OBJ_PERSISTENT, key_type, NULL); value_type = grn_ctx_at(&ctx, GRN_DB_TEXT); column = grn_column_create(&ctx, table, "c1", 2, NULL, GRN_OBJ_PERSISTENT|GRN_OBJ_COMPRESS_ZLIB, /* GRN_OBJ_PERSISTENT, */ value_type); id = grn_table_add(&ctx, table, "hello", 5, &added); printf("id=%d, added=%d\n", id, added); rc = grn_table_delete(&ctx, table, "hello", 5); printf("rc=%d\n", rc); rc = grn_table_delete_by_id(&ctx, table, 1); printf("rc=%d\n", rc); if (grn_obj_close(&ctx, db)) { fprintf(stderr, "grn_obj_close() failed\n"); return -1; } if (grn_ctx_fin(&ctx)) { fprintf(stderr, "grn_ctx_fin() failed\n"); return -1; } if (grn_fin()) { fprintf(stderr, "grn_fin() failed\n"); return -1; } return 0; }
The text was updated successfully, but these errors were encountered:
d510687
報告ありがとうございます! レコード削除時にカラムの値も長さが0の値を書きこんでクリアしているのですが、値が0のときもzlibで圧縮しようとしていたためにクリアされていませんでした。
ついでに、存在しないレコードを削除しようとしたときは、そもそもカラムの値の初期化処理が動かないようにもしました。
Sorry, something went wrong.
segmentation fault しなくなりました。 こちらこそどうもありがとうございました。
No branches or pull requests
次のコードで segmentation fault が起こります。
grn_table_delete した後にもう一度 grn_table_delete_by_id したときです。
zlib を有効にしない場合は問題ないです。
私が調べたところ grn_ja_ref_zlib でエラーが起こっているようなのですが、
修正する方法はわかりませんでした。
私の環境は ubuntu 11.10 amd64 で groonga は git リポジトリの最新を使いました。
The text was updated successfully, but these errors were encountered: