[Groonga-commit] groonga/groonga at 4583818 [master] Support falling back query parse

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Aug 21 00:28:25 JST 2017


Kouhei Sutou	2017-08-21 00:28:25 +0900 (Mon, 21 Aug 2017)

  New Revision: 4583818d6b69a3f5bd3cd5065fa5157ac7fca1aa
  https://github.com/groonga/groonga/commit/4583818d6b69a3f5bd3cd5065fa5157ac7fca1aa

  Message:
    Support falling back query parse
    
    New flag of query_flags in select:
    
      * QUERY_NO_SYNTAX_ERROR
    
    New API:
    
      * GRN_EXPR_QUERY_NO_SYNTAX_ERROR
    
    TODO:
    
      * Document
    
    If QUERY_NO_SYNTAX_ERROR flag is specified as one of query_flags in
    select, query never cause syntax error. Syntax error token in query is
    parsed as a keyword. For example, "A +" is parsed as "A \+" ("A" and
    "+").
    
    This is useful when application uses user input directory and doesn't
    want to show syntax error to user and in log.

  Added files:
    test/command/suite/select/query_flags/query_no_syntax_error/adjust_without_rhs.expected
    test/command/suite/select/query_flags/query_no_syntax_error/and_without_rhs.expected
    test/command/suite/select/query_flags/query_no_syntax_error/and_without_rhs.test
    test/command/suite/select/query_flags/query_no_syntax_error/close_and_content_paren.expected
    test/command/suite/select/query_flags/query_no_syntax_error/close_and_content_paren.test
    test/command/suite/select/query_flags/query_no_syntax_error/close_only_paren.expected
    test/command/suite/select/query_flags/query_no_syntax_error/close_only_paren.test
    test/command/suite/select/query_flags/query_no_syntax_error/decrement_without_rhs.expected
    test/command/suite/select/query_flags/query_no_syntax_error/decrement_without_rhs.test
    test/command/suite/select/query_flags/query_no_syntax_error/increment_without_rhs.expected
    test/command/suite/select/query_flags/query_no_syntax_error/increment_without_rhs.test
    test/command/suite/select/query_flags/query_no_syntax_error/leading_not.expected
    test/command/suite/select/query_flags/query_no_syntax_error/leading_not.test
    test/command/suite/select/query_flags/query_no_syntax_error/leading_or.expected
    test/command/suite/select/query_flags/query_no_syntax_error/leading_or.test
    test/command/suite/select/query_flags/query_no_syntax_error/negative_without_rhs.expected
    test/command/suite/select/query_flags/query_no_syntax_error/negative_without_rhs.test
    test/command/suite/select/query_flags/query_no_syntax_error/nonexistent_column.expected
    test/command/suite/select/query_flags/query_no_syntax_error/nonexistent_column.test
    test/command/suite/select/query_flags/query_no_syntax_error/not_without_rhs.expected
    test/command/suite/select/query_flags/query_no_syntax_error/not_without_rhs.test
    test/command/suite/select/query_flags/query_no_syntax_error/open_and_content_paren.expected
    test/command/suite/select/query_flags/query_no_syntax_error/open_and_content_paren.test
    test/command/suite/select/query_flags/query_no_syntax_error/open_and_content_quote.expected
    test/command/suite/select/query_flags/query_no_syntax_error/open_and_content_quote.test
    test/command/suite/select/query_flags/query_no_syntax_error/open_only_paren.expected
    test/command/suite/select/query_flags/query_no_syntax_error/open_only_paren.test
    test/command/suite/select/query_flags/query_no_syntax_error/open_only_quote.expected
    test/command/suite/select/query_flags/query_no_syntax_error/open_only_quote.test
    test/command/suite/select/query_flags/query_no_syntax_error/or_without_rhs.expected
    test/command/suite/select/query_flags/query_no_syntax_error/or_without_rhs.test
  Modified files:
    include/groonga/expr.h
    lib/expr.c
    lib/proc/proc_select.c

  Modified: include/groonga/expr.h (+1 -0)
===================================================================
--- include/groonga/expr.h    2017-08-18 18:00:41 +0900 (3347c9f24)
+++ include/groonga/expr.h    2017-08-21 00:28:25 +0900 (a0c4a2fd8)
@@ -32,6 +32,7 @@ typedef unsigned int grn_expr_flags;
 #define GRN_EXPR_ALLOW_COLUMN          (0x04)
 #define GRN_EXPR_ALLOW_UPDATE          (0x08)
 #define GRN_EXPR_ALLOW_LEADING_NOT     (0x10)
+#define GRN_EXPR_QUERY_NO_SYNTAX_ERROR (0x80)
 
 GRN_API grn_obj *grn_expr_create(grn_ctx *ctx, const char *name, unsigned int name_size);
 GRN_API grn_rc grn_expr_close(grn_ctx *ctx, grn_obj *expr);

  Modified: lib/expr.c (+159 -27)
===================================================================
--- lib/expr.c    2017-08-18 18:00:41 +0900 (c04c9acfc)
+++ lib/expr.c    2017-08-21 00:28:25 +0900 (f724bf880)
@@ -6900,6 +6900,12 @@ typedef struct {
   grn_hash *weight_set;
   snip_cond *snip_conds;
   grn_hash *object_literal;
+  int paren_depth;
+  struct {
+    const char *string;
+    size_t string_length;
+    int token;
+  } pending_token;
 } efs_info;
 
 typedef struct {
@@ -6922,7 +6928,7 @@ skip_space(grn_ctx *ctx, efs_info *q)
 }
 
 static grn_bool
-get_op(efs_info *q, efs_op *op, grn_operator *mode, int *option)
+parse_query_op(efs_info *q, efs_op *op, grn_operator *mode, int *option)
 {
   grn_bool found = GRN_TRUE;
   const char *start, *end = q->cur;
@@ -7098,8 +7104,8 @@ grn_expr_parser_open(grn_ctx *ctx)
 #define PARSE(token) grn_expr_parser(ctx->impl->parser, (token), 0, q)
 
 static void
-accept_query_string(grn_ctx *ctx, efs_info *efsi,
-                    const char *str, unsigned int str_size)
+parse_query_accept_string(grn_ctx *ctx, efs_info *efsi,
+                          const char *str, unsigned int str_size)
 {
   grn_obj *column, *token;
   grn_operator mode;
@@ -7144,8 +7150,55 @@ accept_query_string(grn_ctx *ctx, efs_info *efsi,
   }
 }
 
+static void
+parse_query_flush_pending_token(grn_ctx *ctx, efs_info *q)
+{
+  const char *cur_keep;
+
+  if (!(q->flags & GRN_EXPR_QUERY_NO_SYNTAX_ERROR)) {
+    return;
+  }
+
+  if (q->pending_token.string_length == 0) {
+    return;
+  }
+
+  cur_keep = q->cur;
+  q->cur = q->pending_token.string;
+  PARSE(q->pending_token.token);
+  q->cur = cur_keep;
+
+  q->pending_token.string = NULL;
+  q->pending_token.string_length = 0;
+  q->pending_token.token = 0;
+}
+
+static void
+parse_query_accept_logical_op(grn_ctx *ctx,
+                              efs_info *q,
+                              const char *string,
+                              unsigned int string_length,
+                              int token)
+{
+  if (!(q->flags & GRN_EXPR_QUERY_NO_SYNTAX_ERROR)) {
+    PARSE(token);
+    return;
+  }
+
+  if (q->pending_token.string_length > 0) {
+    parse_query_accept_string(ctx,
+                              q,
+                              q->pending_token.string,
+                              q->pending_token.string_length);
+  }
+
+  q->pending_token.string = string;
+  q->pending_token.string_length = string_length;
+  q->pending_token.token = token;
+}
+
 static grn_rc
-get_word_(grn_ctx *ctx, efs_info *q)
+parse_query_word(grn_ctx *ctx, efs_info *q)
 {
   const char *end;
   unsigned int len;
@@ -7167,7 +7220,6 @@ get_word_(grn_ctx *ctx, efs_info *q)
                                   GRN_TEXT_VALUE(&q->buf),
                                   GRN_TEXT_LEN(&q->buf));
       if (c && end + 1 < q->str_end) {
-        //        efs_op op;
         switch (end[1]) {
         case '!' :
           mode = GRN_OP_NOT_EQUAL;
@@ -7221,11 +7273,16 @@ get_word_(grn_ctx *ctx, efs_info *q)
           q->cur = end + 1;
           break;
         }
+      } else if (q->flags & GRN_EXPR_QUERY_NO_SYNTAX_ERROR) {
+        GRN_TEXT_PUT(ctx, &q->buf, end, len);
+        end += len;
+        continue;
       } else {
         ERR(GRN_INVALID_ARGUMENT, "column lookup failed");
         q->cur = q->str_end;
         return ctx->rc;
       }
+      parse_query_flush_pending_token(ctx, q);
       PARSE(GRN_EXPR_TOKEN_IDENTIFIER);
       PARSE(GRN_EXPR_TOKEN_RELATIVE_OP);
 
@@ -7248,7 +7305,11 @@ get_word_(grn_ctx *ctx, efs_info *q)
     GRN_TEXT_PUT(ctx, &q->buf, end, len);
     end += len;
   }
-  accept_query_string(ctx, q, GRN_TEXT_VALUE(&q->buf), GRN_TEXT_LEN(&q->buf));
+  parse_query_flush_pending_token(ctx, q);
+  parse_query_accept_string(ctx,
+                            q,
+                            GRN_TEXT_VALUE(&q->buf),
+                            GRN_TEXT_LEN(&q->buf));
 
   return GRN_SUCCESS;
 }
@@ -7272,13 +7333,22 @@ parse_query(grn_ctx *ctx, efs_info *q)
       goto exit;
       break;
     case GRN_QUERY_PARENR :
-      PARSE(GRN_EXPR_TOKEN_PARENR);
+      if (q->paren_depth == 0 && q->flags & GRN_EXPR_QUERY_NO_SYNTAX_ERROR) {
+        const char parenr = GRN_QUERY_PARENR;
+        parse_query_flush_pending_token(ctx, q);
+        parse_query_accept_string(ctx, q, &parenr, 1);
+      } else {
+        parse_query_flush_pending_token(ctx, q);
+        PARSE(GRN_EXPR_TOKEN_PARENR);
+        q->paren_depth--;
+      }
       q->cur++;
       break;
     case GRN_QUERY_QUOTEL :
       q->cur++;
 
       {
+        grn_bool closed = GRN_FALSE;
         const char *start, *s;
         start = s = q->cur;
         GRN_BULK_REWIND(&q->buf);
@@ -7295,6 +7365,7 @@ parse_query(grn_ctx *ctx, efs_info *q)
           } else if (len == 1) {
             if (*s == GRN_QUERY_QUOTER) {
               q->cur = s + 1;
+              closed = GRN_TRUE;
               break;
             } else if (*s == GRN_QUERY_ESCAPE && s + 1 < q->str_end) {
               s++;
@@ -7303,16 +7374,23 @@ parse_query(grn_ctx *ctx, efs_info *q)
           }
           GRN_TEXT_PUT(ctx, &q->buf, s, len);
           s += len;
-
         }
-        accept_query_string(ctx, q,
-                            GRN_TEXT_VALUE(&q->buf), GRN_TEXT_LEN(&q->buf));
+        if (!closed && (q->flags & GRN_EXPR_QUERY_NO_SYNTAX_ERROR)) {
+          q->cur = start - 1;
+          parse_query_word(ctx, q);
+        } else {
+          parse_query_flush_pending_token(ctx, q);
+          parse_query_accept_string(ctx,
+                                    q,
+                                    GRN_TEXT_VALUE(&q->buf),
+                                    GRN_TEXT_LEN(&q->buf));
+        }
       }
 
       break;
     case GRN_QUERY_PREFIX :
       q->cur++;
-      if (get_op(q, op, &mode, &option)) {
+      if (parse_query_op(q, op, &mode, &option)) {
         switch (mode) {
         case GRN_OP_NEAR :
         case GRN_OP_NEAR2 :
@@ -7325,71 +7403,121 @@ parse_query(grn_ctx *ctx, efs_info *q)
           break;
         }
         GRN_INT32_PUT(ctx, &q->mode_stack, mode);
+        parse_query_flush_pending_token(ctx, q);
         PARSE(GRN_EXPR_TOKEN_RELATIVE_OP);
       } else {
         q->cur--;
-        get_word_(ctx, q);
+        parse_query_word(ctx, q);
       }
       break;
     case GRN_QUERY_AND :
       if (!first_token) {
         op->op = GRN_OP_AND;
-        PARSE(GRN_EXPR_TOKEN_LOGICAL_AND);
+        parse_query_accept_logical_op(ctx,
+                                      q,
+                                      q->cur, 1,
+                                      GRN_EXPR_TOKEN_LOGICAL_AND);
       }
       q->cur++;
       break;
     case GRN_QUERY_AND_NOT :
-      if (first_token && (q->flags & GRN_EXPR_ALLOW_LEADING_NOT)) {
-        grn_obj *all_records = grn_ctx_get(ctx, "all_records", 11);
-        if (all_records) {
-          /* dummy token */
-          PARSE(GRN_EXPR_TOKEN_QSTRING);
-          grn_expr_append_obj(ctx, q->e, all_records, GRN_OP_PUSH, 1);
-          grn_expr_append_op(ctx, q->e, GRN_OP_CALL, 0);
+      if (first_token) {
+        if (q->flags & GRN_EXPR_ALLOW_LEADING_NOT) {
+          grn_obj *all_records = grn_ctx_get(ctx, "all_records", 11);
+          if (all_records) {
+            /* dummy token */
+            PARSE(GRN_EXPR_TOKEN_QSTRING);
+            grn_expr_append_obj(ctx, q->e, all_records, GRN_OP_PUSH, 1);
+            grn_expr_append_op(ctx, q->e, GRN_OP_CALL, 0);
+          }
+        } else if (q->flags & GRN_EXPR_QUERY_NO_SYNTAX_ERROR) {
+          parse_query_flush_pending_token(ctx, q);
+          parse_query_accept_string(ctx, q, q->cur, 1);
+          q->cur++;
+          break;
         }
       }
       op->op = GRN_OP_AND_NOT;
-      PARSE(GRN_EXPR_TOKEN_LOGICAL_AND_NOT);
+      parse_query_accept_logical_op(ctx,
+                                    q,
+                                    q->cur, 1,
+                                    GRN_EXPR_TOKEN_LOGICAL_AND_NOT);
       q->cur++;
       break;
     case GRN_QUERY_ADJ_INC :
       if (op->weight < 127) { op->weight++; }
       op->op = GRN_OP_ADJUST;
-      PARSE(GRN_EXPR_TOKEN_ADJUST);
+      parse_query_accept_logical_op(ctx,
+                                    q,
+                                    q->cur, 1,
+                                    GRN_EXPR_TOKEN_ADJUST);
       q->cur++;
       break;
     case GRN_QUERY_ADJ_DEC :
       if (op->weight > -128) { op->weight--; }
       op->op = GRN_OP_ADJUST;
-      PARSE(GRN_EXPR_TOKEN_ADJUST);
+      parse_query_accept_logical_op(ctx,
+                                    q,
+                                    q->cur, 1,
+                                    GRN_EXPR_TOKEN_ADJUST);
       q->cur++;
       break;
     case GRN_QUERY_ADJ_NEG :
       op->op = GRN_OP_ADJUST;
       op->weight = -1;
-      PARSE(GRN_EXPR_TOKEN_ADJUST);
+      parse_query_accept_logical_op(ctx,
+                                    q,
+                                    q->cur, 1,
+                                    GRN_EXPR_TOKEN_ADJUST);
       q->cur++;
       break;
     case GRN_QUERY_PARENL :
+      parse_query_flush_pending_token(ctx, q);
       PARSE(GRN_EXPR_TOKEN_PARENL);
       q->cur++;
+      q->paren_depth++;
       block_started = GRN_TRUE;
       break;
     case 'O' :
-      if (q->cur[1] == 'R' && q->cur[2] == ' ') {
-        PARSE(GRN_EXPR_TOKEN_LOGICAL_OR);
+      if (q->cur + 2 < q->str_end && q->cur[1] == 'R' && q->cur[2] == ' ') {
+        if (first_token && (q->flags & GRN_EXPR_QUERY_NO_SYNTAX_ERROR)) {
+          parse_query_flush_pending_token(ctx, q);
+          parse_query_accept_string(ctx, q, q->cur, 2);
+        } else {
+          parse_query_accept_logical_op(ctx,
+                                        q,
+                                        q->cur, 2,
+                                        GRN_EXPR_TOKEN_LOGICAL_OR);
+        }
         q->cur += 2;
         break;
       }
       /* fallthru */
     default :
-      get_word_(ctx, q);
+      parse_query_word(ctx, q);
       break;
     }
     first_token = block_started;
     block_started = GRN_FALSE;
   }
 exit :
+  if (q->flags & GRN_EXPR_QUERY_NO_SYNTAX_ERROR) {
+    if (q->pending_token.string_length > 0) {
+      parse_query_accept_string(ctx,
+                                q,
+                                q->pending_token.string,
+                                q->pending_token.string_length);
+    }
+    if (q->paren_depth > 0) {
+      int paren_depth = q->paren_depth;
+      while (paren_depth > 0) {
+        const char parenl = GRN_QUERY_PARENL;
+        parse_query_accept_string(ctx, q, &parenl, 1);
+        PARSE(GRN_EXPR_TOKEN_PARENR);
+        paren_depth--;
+      }
+    }
+  }
   PARSE(0);
   return GRN_SUCCESS;
 }
@@ -8125,6 +8253,10 @@ grn_expr_parse(grn_ctx *ctx, grn_obj *expr,
     efsi.opt.weight_vector = NULL;
     efsi.weight_set = NULL;
     efsi.object_literal = NULL;
+    efsi.paren_depth = 0;
+    efsi.pending_token.string = NULL;
+    efsi.pending_token.string_length = 0;
+    efsi.pending_token.token = 0;
 
     if (flags & (GRN_EXPR_SYNTAX_SCRIPT |
                  GRN_EXPR_SYNTAX_OUTPUT_COLUMNS |

  Modified: lib/proc/proc_select.c (+1 -0)
===================================================================
--- lib/proc/proc_select.c    2017-08-18 18:00:41 +0900 (410b8dc08)
+++ lib/proc/proc_select.c    2017-08-21 00:28:25 +0900 (c0d988b77)
@@ -981,6 +981,7 @@ grn_proc_expr_query_flags_parse(grn_ctx *ctx,
     CHECK_EXPR_FLAG(ALLOW_COLUMN);
     CHECK_EXPR_FLAG(ALLOW_UPDATE);
     CHECK_EXPR_FLAG(ALLOW_LEADING_NOT);
+    CHECK_EXPR_FLAG(QUERY_NO_SYNTAX_ERROR);
 
 #define GRN_EXPR_NONE 0
     CHECK_EXPR_FLAG(NONE);

  Added: test/command/suite/select/query_flags/query_no_syntax_error/adjust_without_rhs.expected (+12 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/adjust_without_rhs.expected    2017-08-21 00:28:25 +0900 (a923db412)
@@ -0,0 +1,12 @@
+table_create Names TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+table_create Tokens TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+[[0,0.0,0.0],true]
+load --table Names
+[
+{"_key": "name >"}
+]
+[[0,0.0,0.0],1]
+select Names   --match_columns "_key"   --query ">"   --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR

  Added: test/command/suite/select/query_flags/query_no_syntax_error/and_without_rhs.expected (+13 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/and_without_rhs.expected    2017-08-21 00:28:25 +0900 (bc9b64712)
@@ -0,0 +1,13 @@
+table_create Names TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+table_create Tokens TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+[[0,0.0,0.0],true]
+load --table Names
+[
+{"_key": "name (x+y)"}
+]
+[[0,0.0,0.0],1]
+select Names   --match_columns "_key"   --query "x +"   --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["_key","ShortText"]],[1,"name (x+y)"]]]]

  Added: test/command/suite/select/query_flags/query_no_syntax_error/and_without_rhs.test (+16 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/and_without_rhs.test    2017-08-21 00:28:25 +0900 (0fae4d8a4)
@@ -0,0 +1,16 @@
+table_create Names TABLE_PAT_KEY ShortText
+
+table_create Tokens TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+
+load --table Names
+[
+{"_key": "name (x+y)"}
+]
+
+select Names \
+  --match_columns "_key" \
+  --query "x +" \
+  --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR

  Added: test/command/suite/select/query_flags/query_no_syntax_error/close_and_content_paren.expected (+13 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/close_and_content_paren.expected    2017-08-21 00:28:25 +0900 (6ebd36130)
@@ -0,0 +1,13 @@
+table_create Names TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+table_create Tokens TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+[[0,0.0,0.0],true]
+load --table Names
+[
+{"_key": "name (x)"}
+]
+[[0,0.0,0.0],1]
+select Names   --match_columns "_key"   --query "name)"   --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["_key","ShortText"]],[1,"name (x)"]]]]

  Added: test/command/suite/select/query_flags/query_no_syntax_error/close_and_content_paren.test (+16 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/close_and_content_paren.test    2017-08-21 00:28:25 +0900 (1b80ea484)
@@ -0,0 +1,16 @@
+table_create Names TABLE_PAT_KEY ShortText
+
+table_create Tokens TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+
+load --table Names
+[
+{"_key": "name (x)"}
+]
+
+select Names \
+  --match_columns "_key" \
+  --query "name)" \
+  --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR

  Added: test/command/suite/select/query_flags/query_no_syntax_error/close_only_paren.expected (+13 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/close_only_paren.expected    2017-08-21 00:28:25 +0900 (84dc80a17)
@@ -0,0 +1,13 @@
+table_create Names TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+table_create Tokens TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+[[0,0.0,0.0],true]
+load --table Names
+[
+{"_key": "name (x)"}
+]
+[[0,0.0,0.0],1]
+select Names   --match_columns "_key"   --query ") name"   --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["_key","ShortText"]],[1,"name (x)"]]]]

  Added: test/command/suite/select/query_flags/query_no_syntax_error/close_only_paren.test (+16 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/close_only_paren.test    2017-08-21 00:28:25 +0900 (0916a9508)
@@ -0,0 +1,16 @@
+table_create Names TABLE_PAT_KEY ShortText
+
+table_create Tokens TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+
+load --table Names
+[
+{"_key": "name (x)"}
+]
+
+select Names \
+  --match_columns "_key" \
+  --query ") name" \
+  --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR

  Added: test/command/suite/select/query_flags/query_no_syntax_error/decrement_without_rhs.expected (+13 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/decrement_without_rhs.expected    2017-08-21 00:28:25 +0900 (cdc6ba083)
@@ -0,0 +1,13 @@
+table_create Names TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+table_create Tokens TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+[[0,0.0,0.0],true]
+load --table Names
+[
+{"_key": "name <"}
+]
+[[0,0.0,0.0],1]
+select Names   --match_columns "_key"   --query "<"   --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["_key","ShortText"]],[1,"name <"]]]]

  Added: test/command/suite/select/query_flags/query_no_syntax_error/decrement_without_rhs.test (+16 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/decrement_without_rhs.test    2017-08-21 00:28:25 +0900 (f2bac868a)
@@ -0,0 +1,16 @@
+table_create Names TABLE_PAT_KEY ShortText
+
+table_create Tokens TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+
+load --table Names
+[
+{"_key": "name <"}
+]
+
+select Names \
+  --match_columns "_key" \
+  --query "<" \
+  --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR

  Added: test/command/suite/select/query_flags/query_no_syntax_error/increment_without_rhs.expected (+13 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/increment_without_rhs.expected    2017-08-21 00:28:25 +0900 (a9da79531)
@@ -0,0 +1,13 @@
+table_create Names TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+table_create Tokens TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+[[0,0.0,0.0],true]
+load --table Names
+[
+{"_key": "name >"}
+]
+[[0,0.0,0.0],1]
+select Names   --match_columns "_key"   --query ">"   --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["_key","ShortText"]],[1,"name >"]]]]

  Added: test/command/suite/select/query_flags/query_no_syntax_error/increment_without_rhs.test (+16 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/increment_without_rhs.test    2017-08-21 00:28:25 +0900 (ea2436683)
@@ -0,0 +1,16 @@
+table_create Names TABLE_PAT_KEY ShortText
+
+table_create Tokens TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+
+load --table Names
+[
+{"_key": "name >"}
+]
+
+select Names \
+  --match_columns "_key" \
+  --query ">" \
+  --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR

  Added: test/command/suite/select/query_flags/query_no_syntax_error/leading_not.expected (+13 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/leading_not.expected    2017-08-21 00:28:25 +0900 (c6fc67cf5)
@@ -0,0 +1,13 @@
+table_create Names TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+table_create Tokens TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+[[0,0.0,0.0],true]
+load --table Names
+[
+{"_key": "name (x-y)"}
+]
+[[0,0.0,0.0],1]
+select Names   --match_columns "_key"   --query "-y"   --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["_key","ShortText"]],[1,"name (x-y)"]]]]

  Added: test/command/suite/select/query_flags/query_no_syntax_error/leading_not.test (+16 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/leading_not.test    2017-08-21 00:28:25 +0900 (5e066d40b)
@@ -0,0 +1,16 @@
+table_create Names TABLE_PAT_KEY ShortText
+
+table_create Tokens TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+
+load --table Names
+[
+{"_key": "name (x-y)"}
+]
+
+select Names \
+  --match_columns "_key" \
+  --query "-y" \
+  --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR

  Added: test/command/suite/select/query_flags/query_no_syntax_error/leading_or.expected (+40 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/leading_or.expected    2017-08-21 00:28:25 +0900 (1a3c5ff9f)
@@ -0,0 +1,40 @@
+table_create Names TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+table_create Tokens TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+[[0,0.0,0.0],true]
+load --table Names
+[
+{"_key": "name (x OR y)"}
+]
+[[0,0.0,0.0],1]
+select Names   --match_columns "_key"   --query "OR y"   --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "_key",
+          "ShortText"
+        ]
+      ],
+      [
+        1,
+        "name (x OR y)"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/query_flags/query_no_syntax_error/leading_or.test (+16 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/leading_or.test    2017-08-21 00:28:25 +0900 (7f8feee80)
@@ -0,0 +1,16 @@
+table_create Names TABLE_PAT_KEY ShortText
+
+table_create Tokens TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+
+load --table Names
+[
+{"_key": "name (x OR y)"}
+]
+
+select Names \
+  --match_columns "_key" \
+  --query "OR y" \
+  --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR

  Added: test/command/suite/select/query_flags/query_no_syntax_error/negative_without_rhs.expected (+13 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/negative_without_rhs.expected    2017-08-21 00:28:25 +0900 (8ea934ec6)
@@ -0,0 +1,13 @@
+table_create Names TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+table_create Tokens TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+[[0,0.0,0.0],true]
+load --table Names
+[
+{"_key": "name ~"}
+]
+[[0,0.0,0.0],1]
+select Names   --match_columns "_key"   --query "~"   --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["_key","ShortText"]],[1,"name ~"]]]]

  Added: test/command/suite/select/query_flags/query_no_syntax_error/negative_without_rhs.test (+16 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/negative_without_rhs.test    2017-08-21 00:28:25 +0900 (db5483b43)
@@ -0,0 +1,16 @@
+table_create Names TABLE_PAT_KEY ShortText
+
+table_create Tokens TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+
+load --table Names
+[
+{"_key": "name ~"}
+]
+
+select Names \
+  --match_columns "_key" \
+  --query "~" \
+  --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR

  Added: test/command/suite/select/query_flags/query_no_syntax_error/nonexistent_column.expected (+13 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/nonexistent_column.expected    2017-08-21 00:28:25 +0900 (3409ff906)
@@ -0,0 +1,13 @@
+table_create Names TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+table_create Tokens TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+[[0,0.0,0.0],true]
+load --table Names
+[
+{"_key": "name:x"}
+]
+[[0,0.0,0.0],1]
+select Names   --match_columns "_key"   --query "name:x"   --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["_key","ShortText"]],[1,"name:x"]]]]

  Added: test/command/suite/select/query_flags/query_no_syntax_error/nonexistent_column.test (+16 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/nonexistent_column.test    2017-08-21 00:28:25 +0900 (3af0d1d3c)
@@ -0,0 +1,16 @@
+table_create Names TABLE_PAT_KEY ShortText
+
+table_create Tokens TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+
+load --table Names
+[
+{"_key": "name:x"}
+]
+
+select Names \
+  --match_columns "_key" \
+  --query "name:x" \
+  --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR

  Added: test/command/suite/select/query_flags/query_no_syntax_error/not_without_rhs.expected (+13 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/not_without_rhs.expected    2017-08-21 00:28:25 +0900 (0a7c61bef)
@@ -0,0 +1,13 @@
+table_create Names TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+table_create Tokens TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+[[0,0.0,0.0],true]
+load --table Names
+[
+{"_key": "name (x-y)"}
+]
+[[0,0.0,0.0],1]
+select Names   --match_columns "_key"   --query "x -"   --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["_key","ShortText"]],[1,"name (x-y)"]]]]

  Added: test/command/suite/select/query_flags/query_no_syntax_error/not_without_rhs.test (+16 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/not_without_rhs.test    2017-08-21 00:28:25 +0900 (53fa52a5d)
@@ -0,0 +1,16 @@
+table_create Names TABLE_PAT_KEY ShortText
+
+table_create Tokens TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+
+load --table Names
+[
+{"_key": "name (x-y)"}
+]
+
+select Names \
+  --match_columns "_key" \
+  --query "x -" \
+  --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR

  Added: test/command/suite/select/query_flags/query_no_syntax_error/open_and_content_paren.expected (+13 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/open_and_content_paren.expected    2017-08-21 00:28:25 +0900 (b2fc733a0)
@@ -0,0 +1,13 @@
+table_create Names TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+table_create Tokens TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+[[0,0.0,0.0],true]
+load --table Names
+[
+{"_key": "name (x)"}
+]
+[[0,0.0,0.0],1]
+select Names   --match_columns "_key"   --query "(name"   --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["_key","ShortText"]],[1,"name (x)"]]]]

  Added: test/command/suite/select/query_flags/query_no_syntax_error/open_and_content_paren.test (+16 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/open_and_content_paren.test    2017-08-21 00:28:25 +0900 (2f72e51e7)
@@ -0,0 +1,16 @@
+table_create Names TABLE_PAT_KEY ShortText
+
+table_create Tokens TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+
+load --table Names
+[
+{"_key": "name (x)"}
+]
+
+select Names \
+  --match_columns "_key" \
+  --query "(name" \
+  --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR

  Added: test/command/suite/select/query_flags/query_no_syntax_error/open_and_content_quote.expected (+40 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/open_and_content_quote.expected    2017-08-21 00:28:25 +0900 (d9bf246b4)
@@ -0,0 +1,40 @@
+table_create Names TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+table_create Tokens TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+[[0,0.0,0.0],true]
+load --table Names
+[
+{"_key": "name (x) \"y\""}
+]
+[[0,0.0,0.0],1]
+select Names   --match_columns "_key"   --query "name \"y"   --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "_key",
+          "ShortText"
+        ]
+      ],
+      [
+        1,
+        "name (x) \"y\""
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/query_flags/query_no_syntax_error/open_and_content_quote.test (+16 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/open_and_content_quote.test    2017-08-21 00:28:25 +0900 (05c045423)
@@ -0,0 +1,16 @@
+table_create Names TABLE_PAT_KEY ShortText
+
+table_create Tokens TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+
+load --table Names
+[
+{"_key": "name (x) \"y\""}
+]
+
+select Names \
+  --match_columns "_key" \
+  --query "name \"y" \
+  --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR

  Added: test/command/suite/select/query_flags/query_no_syntax_error/open_only_paren.expected (+13 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/open_only_paren.expected    2017-08-21 00:28:25 +0900 (1b67597a6)
@@ -0,0 +1,13 @@
+table_create Names TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+table_create Tokens TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+[[0,0.0,0.0],true]
+load --table Names
+[
+{"_key": "name (x)"}
+]
+[[0,0.0,0.0],1]
+select Names   --match_columns "_key"   --query "name ("   --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["_key","ShortText"]],[1,"name (x)"]]]]

  Added: test/command/suite/select/query_flags/query_no_syntax_error/open_only_paren.test (+16 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/open_only_paren.test    2017-08-21 00:28:25 +0900 (c9325e761)
@@ -0,0 +1,16 @@
+table_create Names TABLE_PAT_KEY ShortText
+
+table_create Tokens TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+
+load --table Names
+[
+{"_key": "name (x)"}
+]
+
+select Names \
+  --match_columns "_key" \
+  --query "name (" \
+  --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR

  Added: test/command/suite/select/query_flags/query_no_syntax_error/open_only_quote.expected (+40 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/open_only_quote.expected    2017-08-21 00:28:25 +0900 (9f4546877)
@@ -0,0 +1,40 @@
+table_create Names TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+table_create Tokens TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+[[0,0.0,0.0],true]
+load --table Names
+[
+{"_key": "name (x) \"y\""}
+]
+[[0,0.0,0.0],1]
+select Names   --match_columns "_key"   --query "name \""   --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "_key",
+          "ShortText"
+        ]
+      ],
+      [
+        1,
+        "name (x) \"y\""
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/query_flags/query_no_syntax_error/open_only_quote.test (+16 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/open_only_quote.test    2017-08-21 00:28:25 +0900 (ebf891c0b)
@@ -0,0 +1,16 @@
+table_create Names TABLE_PAT_KEY ShortText
+
+table_create Tokens TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+
+load --table Names
+[
+{"_key": "name (x) \"y\""}
+]
+
+select Names \
+  --match_columns "_key" \
+  --query "name \"" \
+  --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR

  Added: test/command/suite/select/query_flags/query_no_syntax_error/or_without_rhs.expected (+40 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/or_without_rhs.expected    2017-08-21 00:28:25 +0900 (d7fbc4c7c)
@@ -0,0 +1,40 @@
+table_create Names TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+table_create Tokens TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+[[0,0.0,0.0],true]
+load --table Names
+[
+{"_key": "name (x OR y)"}
+]
+[[0,0.0,0.0],1]
+select Names   --match_columns "_key"   --query "x OR "   --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "_key",
+          "ShortText"
+        ]
+      ],
+      [
+        1,
+        "name (x OR y)"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/query_flags/query_no_syntax_error/or_without_rhs.test (+16 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_flags/query_no_syntax_error/or_without_rhs.test    2017-08-21 00:28:25 +0900 (6206c7668)
@@ -0,0 +1,16 @@
+table_create Names TABLE_PAT_KEY ShortText
+
+table_create Tokens TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create Tokens names_key COLUMN_INDEX|WITH_POSITION Names _key
+
+load --table Names
+[
+{"_key": "name (x OR y)"}
+]
+
+select Names \
+  --match_columns "_key" \
+  --query "x OR " \
+  --query_flags ALLOW_PRAGMA|ALLOW_COLUMN|QUERY_NO_SYNTAX_ERROR
-------------- next part --------------
HTML����������������������������...
Download 



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