Ver Fonte

allow Manticore. before tables

So, select .. from foo is equal to select .. from Manticore
.foo/`Manticore`.foo
alexey há 2 anos atrás
pai
commit
aa9f6cf074
2 ficheiros alterados com 10 adições e 1 exclusões
  1. 3 0
      src/sphinxql.l
  2. 7 1
      src/sphinxql.y

+ 3 - 0
src/sphinxql.l

@@ -200,6 +200,9 @@ FLOAT_CONSTANT      {INT}\.{INT}?{EXP}?|{INT}?\.{INT}{EXP}|{INT}{EXP}
 "WHERE"				{ YYSTOREBOUNDS; return TOK_WHERE; }
 "WITHIN"			{ YYSTOREBOUNDS; return TOK_WITHIN; }
 
+"MANTICORE."
+"`MANTICORE`."      { YYSTOREBOUNDS; return TOK_MANTICORE; }
+
 "!="				{ YYSTOREBOUNDS; return TOK_NE; }
 "<>"				{ YYSTOREBOUNDS; return TOK_NE; }
 "<="				{ YYSTOREBOUNDS; return TOK_LTE; }

+ 7 - 1
src/sphinxql.y

@@ -29,6 +29,7 @@
 %token	TOK_SUBKEY
 %token	TOK_BACKTICKED_SUBKEY
 %token	TOK_DOT_NUMBER ".number"
+%token	TOK_MANTICORE "Manticore."
 
 %token	TOK_AGENT
 %token	TOK_ALL
@@ -294,7 +295,7 @@ identcol:
 	;
 
 /// indexes
-identidx:
+idxname:
 	TOK_BACKIDENT
 	{
 		$$ = $1;
@@ -304,6 +305,11 @@ identidx:
 	| ident_set | TOK_NAMES | TOK_TRANSACTION | TOK_COLLATE
 	;
 
+identidx:
+	 idxname
+	 | TOK_MANTICORE idxname
+	;
+
 one_index:
 	identidx
 	| ident ':' identidx