[Groonga-mysql-commit] mroonga/mroonga at fcbb79b [master] Use MySQL warning instead of Groonga log for invalid column flags

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Oct 23 00:04:28 JST 2014


Kouhei Sutou	2014-10-23 00:04:28 +0900 (Thu, 23 Oct 2014)

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

  Message:
    Use MySQL warning instead of Groonga log for invalid column flags

  Modified files:
    ha_mroonga.cpp
    mrn_err.h

  Modified: ha_mroonga.cpp (+10 -4)
===================================================================
--- ha_mroonga.cpp    2014-10-22 23:59:31 +0900 (9dcfd32)
+++ ha_mroonga.cpp    2014-10-23 00:04:28 +0900 (dd9967d)
@@ -1246,10 +1246,16 @@ grn_obj_flags mrn_parse_grn_column_create_flags(THD *thd,
       }
       flag_names += 12;
     } else {
-      GRN_LOG(ctx, GRN_LOG_WARNING,
-              "invalid flags option: <%.*s>. "
-              "<COLUMN_SCALAR> flag is used instead.",
-              flag_names_length, flag_names);
+      char invalid_flag_name[MRN_MESSAGE_BUFFER_SIZE];
+      snprintf(invalid_flag_name, MRN_MESSAGE_BUFFER_SIZE,
+               "%.*s",
+               static_cast<int>(rest_length),
+               flag_names);
+      push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
+                          ER_MRN_INVALID_COLUMN_FLAG_NUM,
+                          ER_MRN_INVALID_COLUMN_FLAG_STR,
+                          invalid_flag_name,
+                          "COLUMN_SCALAR");
       flags |= GRN_OBJ_COLUMN_SCALAR;
       break;
     }

  Modified: mrn_err.h (+3 -0)
===================================================================
--- mrn_err.h    2014-10-22 23:59:31 +0900 (b2245df)
+++ mrn_err.h    2014-10-23 00:04:28 +0900 (bfaf2d4)
@@ -31,5 +31,8 @@
 #define ER_MRN_UNSUPPORTED_COLUMN_FLAG_NUM 16506
 #define ER_MRN_UNSUPPORTED_COLUMN_FLAG_STR \
   "The column flag '%-.64s' is unsupported. It is ignored"
+#define ER_MRN_INVALID_COLUMN_FLAG_NUM 16507
+#define ER_MRN_INVALID_COLUMN_FLAG_STR \
+  "The column flag '%-.64s' is invalid. '%-64s' is used instead"
 
 #endif /* MRN_ERR_H_ */
-------------- next part --------------
HTML����������������������������...
Download 



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