[Groonga-mysql-commit] mroonga/mroonga [master] Show a warning when NormalizerMySQLGeneralCI doesn't exist

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Feb 6 10:57:20 JST 2013


Kouhei Sutou	2013-02-06 10:57:20 +0900 (Wed, 06 Feb 2013)

  New Revision: 319e4ad501251e4d5002bf33555a2c89cebe85c8
  https://github.com/mroonga/mroonga/commit/319e4ad501251e4d5002bf33555a2c89cebe85c8

  Log:
    Show a warning when NormalizerMySQLGeneralCI doesn't exist
    
    NormalizerAuto is used as fallback normalizer for the case.

  Modified files:
    ha_mroonga.cpp

  Modified: ha_mroonga.cpp (+12 -3)
===================================================================
--- ha_mroonga.cpp    2013-02-06 10:52:14 +0900 (f127df7)
+++ ha_mroonga.cpp    2013-02-06 10:57:20 +0900 (dcb6311)
@@ -8058,9 +8058,18 @@ grn_obj *ha_mroonga::find_normalizer(Field *field)
   if ((strcmp(charset_info->name, "utf8_general_ci") == 0) ||
       (strcmp(charset_info->name, "utf8mb4_general_ci") == 0)) {
     normalizer = grn_ctx_get(ctx, "NormalizerMySQLGeneralCI", -1);
-    // TODO: if (!normalizer) {ERROR?}
-    // Or?: normalizer = grn_ctx_get(ctx, "NormalizerAuto", -1);
-  } else {
+    if (!normalizer) {
+      char error_message[MRN_MESSAGE_BUFFER_SIZE];
+      snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE,
+               "NormalizerMySQLGeneralCI normalizer isn't found for %s. "
+               "Install groonga-normalizer-mysql normalizer. "
+               "NormalizerAuto is used as fallback.",
+               charset_info->name);
+      push_warning(ha_thd(), Sql_condition::WARN_LEVEL_WARN,
+                   HA_ERR_UNSUPPORTED, error_message);
+    }
+  }
+  if (!normalizer) {
     normalizer = grn_ctx_get(ctx, "NormalizerAuto", -1);
   }
   DBUG_RETURN(normalizer);
-------------- next part --------------
HTML����������������������������...
Download 



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