From 3244265855579b51edbdeb5412b7b101a4a27a7b Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Tue, 24 May 2005 09:49:01 +0000 Subject: [PATCH] Simplify parsing of the FROM keyword. --- dlls/msi/sql.y | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/dlls/msi/sql.y b/dlls/msi/sql.y index e682bcc0eba..41d91cfd6f6 100644 --- a/dlls/msi/sql.y +++ b/dlls/msi/sql.y @@ -127,7 +127,7 @@ static struct expr * EXPR_wildcard( void *info ); %type column table id %type selcollist -%type query from unorderedsel selectfrom +%type query from fromtable unorderedsel selectfrom %type oneupdate onedelete oneselect onequery onecreate oneinsert %type expr val column_val const_val %type column_type data_type data_type_l data_count @@ -418,32 +418,29 @@ selcollist: ; from: - TK_FROM table + fromtable + | fromtable TK_WHERE expr { SQL_input* sql = (SQL_input*) info; UINT r; $$ = NULL; - TRACE("From table: %s\n",debugstr_w($2)); - r = TABLE_CreateView( sql->db, $2, & $$ ); - if( r != ERROR_SUCCESS ) + r = WHERE_CreateView( sql->db, &$$, $1, $3 ); + if( r != ERROR_SUCCESS || !$$ ) YYABORT; } - | TK_FROM table TK_WHERE expr - { + ; + +fromtable: + TK_FROM table + { SQL_input* sql = (SQL_input*) info; - MSIVIEW *view = NULL; UINT r; $$ = NULL; - TRACE("From table: %s\n",debugstr_w($2)); - r = TABLE_CreateView( sql->db, $2, &view ); - if( r != ERROR_SUCCESS ) + r = TABLE_CreateView( sql->db, $2, &$$ ); + if( r != ERROR_SUCCESS || !$$ ) YYABORT; - r = WHERE_CreateView( sql->db, &view, view, $4 ); - if( r != ERROR_SUCCESS ) - YYABORT; - $$ = view; } ;