[Groonga-mysql-commit] mroonga/mroonga [fix-for-visual-studio] added pkey const search tryal implementation.

Back to archive index

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


Tetsuro IKEDA	2009-04-14 18:29:45 +0900 (Tue, 14 Apr 2009)

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

  Log:
    added pkey const search tryal implementation.

  Modified files:
    src/ha_groonga.cc
    src/ha_groonga.h

  Modified: src/ha_groonga.cc (+21 -3)
===================================================================
--- src/ha_groonga.cc    2009-03-18 16:39:03 +0900 (de17150)
+++ src/ha_groonga.cc    2009-04-14 18:29:45 +0900 (589603d)
@@ -294,9 +294,7 @@ int ha_groonga::info(uint flag)
   mrn_ctx_init();
   MRN_TRACE;
 
-  if (flag & HA_STATUS_VARIABLE) {
-    stats.records = (ha_rows) grn_table_size(mrn_ctx_tls, share->obj);
-  }
+  stats.records = (ha_rows) grn_table_size(mrn_ctx_tls, share->obj);
 
   return 0;
 }
@@ -465,6 +463,26 @@ int ha_groonga::write_row(uchar *buf)
   return 0;
 }
 
+int ha_groonga::index_read(uchar *buf, const uchar *key,
+			   uint key_len, enum ha_rkey_function find_flag)
+{
+  MRN_TRACE;
+  Field *key_field= table->key_info[active_index].key_part->field;
+  uint rc= 0;
+  if (key_field->field_index == table->s->primary_key)
+  {
+    key_field->set_key_image(key, key_len);
+    key_field->set_notnull();
+  }
+  return rc;
+}
+
+int ha_groonga::index_next(uchar *buf)
+{
+  MRN_TRACE;
+  return HA_ERR_END_OF_FILE;
+}
+
 /* additional functions */
 static bool mrn_flush_logs(handlerton *hton)
 {

  Modified: src/ha_groonga.h (+9 -1)
===================================================================
--- src/ha_groonga.h    2009-03-18 16:39:03 +0900 (2ff2efb)
+++ src/ha_groonga.h    2009-04-14 18:29:45 +0900 (293baa6)
@@ -63,7 +63,15 @@ public:
 
   int delete_table(const char *name);
   int write_row(uchar *buf);
-  uint max_supported_keys() const { return MAX_KEY; }
+
+  uint max_supported_record_length() const { return HA_MAX_REC_LENGTH; }
+  uint max_supported_keys()          const { return 1; }
+  uint max_supported_key_parts()     const { return 1; }
+  uint max_supported_key_length()    const { return MAX_KEY_LENGTH; }
+
+  int index_read(uchar *buf, const uchar *key, uint key_len,
+		  enum ha_rkey_function find_flag);
+  int index_next(uchar *buf);
 };
 
 #endif /* _ha_groonga_h */
-------------- next part --------------
HTML����������������������������...
Download 



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