[Groonga-commit] groonga/groonga [master] show more info for invalid sort key.

Back to archive index

null+****@clear***** null+****@clear*****
2010年 6月 9日 (水) 09:50:35 JST


Kouhei Sutou	2010-06-09 00:50:35 +0000 (Wed, 09 Jun 2010)

  New Revision: f15b6ff18c023ebb041ab267abb59099d912d320

  Log:
    show more info for invalid sort key.

  Modified files:
    lib/db.c

  Modified: lib/db.c (+3 -1)
===================================================================
--- lib/db.c    2010-06-08 18:47:42 +0000 (2f7b109)
+++ lib/db.c    2010-06-09 00:50:35 +0000 (296aa40)
@@ -6819,6 +6819,7 @@ grn_table_sort_key_from_str(grn_ctx *ctx, const char *str, unsigned str_size,
                             grn_obj *table, unsigned *nkeys)
 {
   const char **tokbuf;
+  const char *original_str = str;
   grn_table_sort_key *keys = NULL, *k = NULL;
   if ((tokbuf = GRN_MALLOCN(const char *, str_size))) {
     int i, n = tokenize(str, str_size, tokbuf, str_size, NULL);
@@ -6834,7 +6835,8 @@ grn_table_sort_key_from_str(grn_ctx *ctx, const char *str, unsigned str_size,
           str++;
         }
         if (!(k->key = grn_obj_column(ctx, table, str, tokbuf[i] - str))) {
-          WARN(GRN_INVALID_ARGUMENT, "invalid sort key");
+          WARN(GRN_INVALID_ARGUMENT, "invalid sort key: <%.*s>(<%.*s>)",
+               tokbuf[i] - str, str, str_size, original_str);
           break;
         }
         k++;




Groonga-commit メーリングリストの案内
Back to archive index