Commit 32442658 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Simplify parsing of the FROM keyword.

parent 7bff3542
...@@ -127,7 +127,7 @@ static struct expr * EXPR_wildcard( void *info ); ...@@ -127,7 +127,7 @@ static struct expr * EXPR_wildcard( void *info );
%type <string> column table id %type <string> column table id
%type <column_list> selcollist %type <column_list> selcollist
%type <query> query from unorderedsel selectfrom %type <query> query from fromtable unorderedsel selectfrom
%type <query> oneupdate onedelete oneselect onequery onecreate oneinsert %type <query> oneupdate onedelete oneselect onequery onecreate oneinsert
%type <expr> expr val column_val const_val %type <expr> expr val column_val const_val
%type <column_type> column_type data_type data_type_l data_count %type <column_type> column_type data_type data_type_l data_count
...@@ -418,32 +418,29 @@ selcollist: ...@@ -418,32 +418,29 @@ selcollist:
; ;
from: from:
TK_FROM table fromtable
| fromtable TK_WHERE expr
{ {
SQL_input* sql = (SQL_input*) info; SQL_input* sql = (SQL_input*) info;
UINT r; UINT r;
$$ = NULL; $$ = NULL;
TRACE("From table: %s\n",debugstr_w($2)); r = WHERE_CreateView( sql->db, &$$, $1, $3 );
r = TABLE_CreateView( sql->db, $2, & $$ ); if( r != ERROR_SUCCESS || !$$ )
if( r != ERROR_SUCCESS )
YYABORT; YYABORT;
} }
| TK_FROM table TK_WHERE expr ;
{
fromtable:
TK_FROM table
{
SQL_input* sql = (SQL_input*) info; SQL_input* sql = (SQL_input*) info;
MSIVIEW *view = NULL;
UINT r; UINT r;
$$ = NULL; $$ = NULL;
TRACE("From table: %s\n",debugstr_w($2)); r = TABLE_CreateView( sql->db, $2, &$$ );
r = TABLE_CreateView( sql->db, $2, &view ); if( r != ERROR_SUCCESS || !$$ )
if( r != ERROR_SUCCESS )
YYABORT;
r = WHERE_CreateView( sql->db, &view, view, $4 );
if( r != ERROR_SUCCESS )
YYABORT; YYABORT;
$$ = view;
} }
; ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment