[Groonga-mysql-commit] mroonga/mroonga [fix-for-visual-studio] add grn_ctx to ha_groonga. constructor and destructor handle this.

Back to archive index

Tetsuro IKEDA null+****@clear*****
Thu Oct 4 10:18:48 JST 2012


Tetsuro IKEDA	2009-06-18 14:36:47 +0900 (Thu, 18 Jun 2009)

  New Revision: fb7c00aea96453d4cd5c22446c6678aca3397a2f
  https://github.com/mroonga/mroonga/commit/fb7c00aea96453d4cd5c22446c6678aca3397a2f

  Log:
    add grn_ctx to ha_groonga. constructor and destructor handle this.

  Modified files:
    driver.c
    driver.h
    ha_groonga.cc
    ha_groonga.h

  Modified: driver.c (+1 -0)
===================================================================
--- driver.c    2009-06-18 14:05:44 +0900 (750069d)
+++ driver.c    2009-06-18 14:36:47 +0900 (d9641d5)
@@ -18,6 +18,7 @@ grn_obj *mrn_db_sys, *mrn_lexicon_sys;
 pthread_mutex_t *mrn_mutex_sys;
 const char *mrn_logfile_name=MRN_LOG_FILE_NAME;
 FILE *mrn_logfile = NULL;
+uint mrn_ctx_counter = 0;
 
 grn_logger_info mrn_logger_info = {
   GRN_LOG_DUMP,

  Modified: driver.h (+2 -0)
===================================================================
--- driver.h    2009-06-18 14:05:44 +0900 (2000508)
+++ driver.h    2009-06-18 14:36:47 +0900 (8ba55c9)
@@ -88,4 +88,6 @@ extern FILE *mrn_logfile;
 
 extern grn_logger_info mrn_logger_info;
 
+extern uint mrn_ctx_counter;
+
 #endif /* _mroonga_h */

  Modified: ha_groonga.cc (+6 -1)
===================================================================
--- ha_groonga.cc    2009-06-18 14:05:44 +0900 (ce3b339)
+++ ha_groonga.cc    2009-06-18 14:36:47 +0900 (a05fe72)
@@ -126,11 +126,16 @@ mysql_declare_plugin_end;
 ha_groonga::ha_groonga(handlerton *hton, TABLE_SHARE *share)
   :handler(hton, share)
 {
-  mrn_counter=0;
+  ctx = (grn_ctx*) malloc(sizeof(grn_ctx));
+  grn_ctx_init(ctx,0);
+  mrn_ctx_counter++;
 }
 
 ha_groonga::~ha_groonga()
 {
+  grn_ctx_fin(ctx);
+  free(ctx);
+  mrn_ctx_counter--;
 }
 
 const char *ha_groonga::table_type() const

  Modified: ha_groonga.h (+2 -1)
===================================================================
--- ha_groonga.h    2009-06-18 14:05:44 +0900 (48daa0c)
+++ ha_groonga.h    2009-06-18 14:36:47 +0900 (66e2006)
@@ -17,7 +17,8 @@ class ha_groonga: public handler
   grn_table_cursor *cursor;
   grn_id record_id;
   grn_obj *res;
-  int mrn_counter;
+
+  grn_ctx *ctx;
 
 public:
   ha_groonga(handlerton *hton, TABLE_SHARE *share);
-------------- next part --------------
HTML����������������������������...
다운로드 



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