[Groonga-mysql-commit] mroonga/mroonga [fix-for-visual-studio] supports sql_calc_found_rows. refs #1161

Back to archive index

Kentoku null+****@clear*****
Thu Oct 4 10:54:05 JST 2012


Kentoku	2011-11-10 12:16:50 +0900 (Thu, 10 Nov 2011)

  New Revision: 8a83e9d848235daf2f3bbae28b40fa01ff4eacc8
  https://github.com/mroonga/mroonga/commit/8a83e9d848235daf2f3bbae28b40fa01ff4eacc8

  Log:
    supports sql_calc_found_rows. refs #1161

  Modified files:
    ha_mroonga.cc

  Modified: ha_mroonga.cc (+19 -1)
===================================================================
--- ha_mroonga.cc    2011-11-10 09:55:24 +0900 (d1e0396)
+++ ha_mroonga.cc    2011-11-10 12:16:50 +0900 (346ae25)
@@ -5929,7 +5929,19 @@ void ha_mroonga::check_fast_order_limit(grn_table_sort_key **sort_keys,
                                         grn_obj *score_column)
 {
   MRN_DBUG_ENTER_METHOD();
-  st_select_lex *select_lex = table->pos_in_table_list->select_lex;
+  TABLE_LIST *table_list = table->pos_in_table_list;
+  st_select_lex *select_lex = table_list->select_lex;
+  SELECT_LEX_UNIT *unit = table_list->derived;
+  st_select_lex *first_select_lex;
+  if (unit)
+  {
+    first_select_lex = unit->first_select();
+  } else {
+    first_select_lex = select_lex;
+  }
+  DBUG_PRINT("info",
+    ("mroonga: first_select_lex->options=%u",
+      first_select_lex ? first_select_lex->options : 0));
 
   if (
     thd_sql_command(ha_thd()) == SQLCOM_SELECT &&
@@ -5953,6 +5965,12 @@ void ha_mroonga::check_fast_order_limit(grn_table_sort_key **sort_keys,
       fast_order_limit = FALSE;
       DBUG_VOID_RETURN;
     }
+    if (first_select_lex && (first_select_lex->options & OPTION_FOUND_ROWS)) {
+      DBUG_PRINT("info",
+        ("mroonga: fast_order_limit = FALSE by calc_found_rows"));
+      fast_order_limit = FALSE;
+      DBUG_VOID_RETURN;
+    }
     Item *info = (Item *)select_lex->item_list.first_node()->info;
     Item *where;
     where = select_lex->where;
-------------- next part --------------
HTML����������������������������...
下載 



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