[Groonga-commit] groonga/groonga at b67ec8a [master] select: report error as soon as possible

Back to archive index

Kouhei Sutou null+****@clear*****
Fri May 22 13:17:30 JST 2015


Kouhei Sutou	2015-05-22 13:17:30 +0900 (Fri, 22 May 2015)

  New Revision: b67ec8a58a98be2f7eae0edfe1f47a81521f219b
  https://github.com/groonga/groonga/commit/b67ec8a58a98be2f7eae0edfe1f47a81521f219b

  Message:
    select: report error as soon as possible

  Added files:
    test/command/suite/select/match_columns/invalid/with_invalid_query_expander.expected
    test/command/suite/select/match_columns/invalid/with_invalid_query_expander.test
  Modified files:
    lib/proc.c

  Modified: lib/proc.c (+3 -0)
===================================================================
--- lib/proc.c    2015-05-22 11:33:44 +0900 (f4a58dc)
+++ lib/proc.c    2015-05-22 13:17:30 +0900 (5ab4fcc)
@@ -1003,6 +1003,9 @@ grn_select(grn_ctx *ctx, const char *table, unsigned int table_len,
             grn_expr_parse(ctx, match_columns_, match_columns, match_columns_len,
                            NULL, GRN_OP_MATCH, GRN_OP_AND,
                            GRN_EXPR_SYNTAX_SCRIPT);
+            if (ctx->rc) {
+              goto exit;
+            }
           } else {
             /* todo */
           }

  Added: test/command/suite/select/match_columns/invalid/with_invalid_query_expander.expected (+17 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/match_columns/invalid/with_invalid_query_expander.expected    2015-05-22 13:17:30 +0900 (569a663)
@@ -0,0 +1,17 @@
+table_create Memos TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Memos title COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+table_create Lexicon TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram
+[[0,0.0,0.0],true]
+column_create Lexicon memo_index COLUMN_INDEX|WITH_POSITION Memos title
+[[0,0.0,0.0],true]
+load --table Memos
+[
+["title"],
+["Groonga"]
+]
+[[0,0.0,0.0],1]
+select Memos   --match_columns Memos.nonexistent_column   --query Groonga   --query_expander nonexistent_query_expander
+[[[-63,0.0,0.0],"Syntax error: <Memos.nonexistent_column||>"]]
+#|e| Syntax error: <Memos.nonexistent_column||>

  Added: test/command/suite/select/match_columns/invalid/with_invalid_query_expander.test (+16 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/match_columns/invalid/with_invalid_query_expander.test    2015-05-22 13:17:30 +0900 (321fc0d)
@@ -0,0 +1,16 @@
+table_create Memos TABLE_NO_KEY
+column_create Memos title COLUMN_SCALAR ShortText
+
+table_create Lexicon TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram
+column_create Lexicon memo_index COLUMN_INDEX|WITH_POSITION Memos title
+
+load --table Memos
+[
+["title"],
+["Groonga"]
+]
+
+select Memos \
+  --match_columns Memos.nonexistent_column \
+  --query Groonga \
+  --query_expander nonexistent_query_expander
-------------- next part --------------
HTML����������������������������...
Download 



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