Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
88ce6a2b
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
88ce6a2b
编写于
1月 22, 2001
作者:
M
Michael Meskes
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Synced preproc.y with gram.y and added missing include file to pgc.l.
上级
0fada37f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
57 addition
and
56 deletion
+57
-56
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+3
-2
src/interfaces/ecpg/preproc/pgc.l
src/interfaces/ecpg/preproc/pgc.l
+2
-3
src/interfaces/ecpg/preproc/preproc.y
src/interfaces/ecpg/preproc/preproc.y
+52
-51
未找到文件。
src/interfaces/ecpg/ChangeLog
浏览文件 @
88ce6a2b
...
...
@@ -1035,8 +1035,9 @@ Fri Dec 22 13:33:31 CET 2000
- Fixed bug in a connect statement using varchars.
- Synced gram.y and preproc.y.
Tue Jan 9 20:24:56
CET 2001
Mon Jan 22 17:56:02
CET 2001
- Synced gram.y.
- Synced gram.y and preproc.y.
- Added #include "postgres.h" to pgc.l.
- Set ecpg version to 2.8.0.
- Set library version to 3.2.0.
src/interfaces/ecpg/preproc/pgc.l
浏览文件 @
88ce6a2b
...
...
@@ -12,17 +12,16 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.7
1 2001/01/14 05:08:17 tgl
Exp $
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.7
2 2001/01/22 17:05:50 meskes
Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include <ctype.h>
#include <sys/types.h>
#include <limits.h>
#include <errno.h>
#include "postgres.h"
#include "miscadmin.h"
#include "nodes/parsenodes.h"
#include "nodes/pg_list.h"
...
...
src/interfaces/ecpg/preproc/preproc.y
浏览文件 @
88ce6a2b
...
...
@@ -294,7 +294,7 @@ make_name(void)
%type <str> opt_indirection expr_list extract_list extract_arg
%type <str> position_list substr_list substr_from alter_column_action
%type <str> trim_list in_expr substr_for attr attrs drop_behavior
%type <str> Typename SimpleTypename Generic
Type Num
eric opt_float opt_numeric
%type <str> Typename SimpleTypename Generic
Numeric gen
eric opt_float opt_numeric
%type <str> opt_decimal Character character opt_varying opt_charset
%type <str> opt_collate datetime opt_timezone opt_interval table_ref
%type <str> row_expr row_descriptor row_list ConstDatetime opt_chain
...
...
@@ -313,7 +313,7 @@ make_name(void)
%type <str> index_list func_index index_elem opt_class access_method_clause
%type <str> index_opt_unique IndexStmt func_return ConstInterval
%type <str> func_args_list func_args opt_with ProcedureStmt def_arg
%type <str> def_elem def_list definition DefineStmt
%type <str> def_elem def_list definition DefineStmt
select_with_parens
%type <str> opt_instead event event_object RuleActionList opt_using
%type <str> RuleActionStmtOrEmpty RuleActionMulti func_as reindex_type
%type <str> RuleStmt opt_column opt_name oper_argtypes sysid_clause
...
...
@@ -2066,16 +2066,7 @@ RuleActionMulti: RuleActionMulti ';' RuleActionStmtOrEmpty
{ $$ = cat2_str($1, make_str(";")); }
;
/*
* Allowing RuleActionStmt to be a SelectStmt creates an ambiguity:
* is the RuleActionList "((SELECT foo))" a standalone RuleActionStmt,
* or a one-entry RuleActionMulti list? We don't really care, but yacc
* wants to know. We use operator precedence to resolve the ambiguity:
* giving this rule a higher precedence than ')' will force a reduce
* rather than shift decision, causing the one-entry-list interpretation
* to be chosen.
*/
RuleActionStmt: SelectStmt %prec TYPECAST
RuleActionStmt: SelectStmt
| InsertStmt
| UpdateStmt
| DeleteStmt
...
...
@@ -2491,11 +2482,17 @@ opt_cursor: BINARY { $$ = make_str("binary"); }
*
*****************************************************************************/
SelectStmt: select_no_parens %prec TYPECAST
SelectStmt: select_no_parens %prec UMINUS
{ $$ = $1; }
| select_with_parens %prec UMINUS
{ $$ = $1; }
;
select_with_parens: '(' select_no_parens ')'
{
$$ =
$1
;
$$ =
cat_str(3, make_str("("), $2, make_str(")"))
;
}
| '('
SelectStmt
')'
| '('
select_with_parens
')'
{
$$ = cat_str(3, make_str("("), $2, make_str(")"));
}
...
...
@@ -2524,9 +2521,9 @@ select_clause: simple_select
$$ = $1;
}
|
'(' SelectStmt ')'
|
select_with_parens
{
$$ =
cat_str(3, make_str("("), $2, make_str(")"))
;
$$ =
$1
;
}
;
...
...
@@ -2745,10 +2742,6 @@ from_list: from_list ',' table_ref { $$ = cat_str(3, $1, make_str(","), $3); }
* between table_ref := '(' joined_table ')' alias_clause
* and joined_table := '(' joined_table ')'. So, we must have the
* redundant-looking productions here instead.
*
* Note that the SQL spec does not permit a subselect (<derived_table>)
* without an alias clause, so we don't either. This avoids the problem
* of needing to invent a refname for an unlabeled subselect.
*/
table_ref: relation_expr
{
...
...
@@ -2758,9 +2751,13 @@ table_ref: relation_expr
{
$$= cat2_str($1, $2);
}
| '(' SelectStmt ')' alias_clause
| select_with_parens
{
mmerror(ET_ERROR, "sub-SELECT in FROM must have an alias");
}
| select_with_parens alias_clause
{
$$=cat
_str(4, make_str("("), $2, make_str(")"), $4
);
$$=cat
2_str($1, $2
);
}
| joined_table
{
...
...
@@ -2856,12 +2853,12 @@ relation_expr: relation_name
/* normal relations */
$$ = $1;
}
| relation_name '*'
%prec '='
| relation_name '*'
{
/* inheritance query */
$$ = cat2_str($1, make_str("*"));
}
| ONLY relation_name
%prec '='
| ONLY relation_name
{
/* inheritance query */
$$ = cat2_str(make_str("ONLY "), $2);
...
...
@@ -2928,7 +2925,7 @@ SimpleTypename: ConstTypename { $$ = $1; }
| ConstInterval { $$ = $1; }
;
ConstTypename: Generic
Type
{ $$ = $1; }
ConstTypename: Generic { $$ = $1; }
| ConstDatetime { $$ = $1; }
| Numeric { $$ = $1; }
| Geometric { $$ = $1; }
...
...
@@ -2936,7 +2933,14 @@ ConstTypename: GenericType { $$ = $1; }
| Character { $$ = $1; }
;
GenericType: ident { $$ = $1; }
Generic: generic
{
$$ = $1;
}
;
generic: ident { $$ = $1; }
| TYPE_P { $$ = make_str("type"); }
| ECPGKeywords { $$ = $1; }
| ECPGTypeName { $$ = $1; }
;
...
...
@@ -3170,21 +3174,21 @@ opt_interval: datetime { $$ = $1; }
* Define row_descriptor to allow yacc to break the reduce/reduce conflict
* with singleton expressions.
*/
row_expr: '(' row_descriptor ')' IN
'(' SelectStmt ')'
row_expr: '(' row_descriptor ')' IN
select_with_parens
{
$$ = cat_str(
5, make_str("("), $2, make_str(") in ("), $6, make_str(")")
);
$$ = cat_str(
4, make_str("("), $2, make_str(") in "), $5
);
}
| '(' row_descriptor ')' NOT IN
'(' SelectStmt ')'
| '(' row_descriptor ')' NOT IN
select_with_parens
{
$$ = cat_str(
5, make_str("("), $2, make_str(") not in ("), $7, make_str(")")
);
$$ = cat_str(
4, make_str("("), $2, make_str(") not in "), $6
);
}
| '(' row_descriptor ')' all_Op sub_type
'(' SelectStmt ')'
| '(' row_descriptor ')' all_Op sub_type
select_with_parens
{
$$ = cat_str(
8, make_str("("), $2, make_str(")"), $4, $5, make_str("("), $7, make_str(")")
);
$$ = cat_str(
6, make_str("("), $2, make_str(")"), $4, $5, $6
);
}
| '(' row_descriptor ')' all_Op
'(' SelectStmt ')'
| '(' row_descriptor ')' all_Op
select_with_parens
{
$$ = cat_str(
7, make_str("("), $2, make_str(")"), $4, make_str("("), $6, make_str(")")
);
$$ = cat_str(
5, make_str("("), $2, make_str(")"), $4, $5
);
}
| '(' row_descriptor ')' all_Op '(' row_descriptor ')'
{
...
...
@@ -3349,17 +3353,17 @@ a_expr: c_expr
{
$$ = cat_str(5, $1, make_str("not between"), $4, make_str("and"), $6);
}
| a_expr IN
'(' in_expr ')'
| a_expr IN
in_expr
{
$$ = cat_str(
4, $1, make_str(" in ("), $4, make_str(")")
);
$$ = cat_str(
3, $1, make_str(" in"), $3
);
}
| a_expr NOT IN
'(' in_expr ')'
| a_expr NOT IN
in_expr
{
$$ = cat_str(
4, $1, make_str(" not in ("), $5, make_str(")")
);
$$ = cat_str(
3, $1, make_str(" not in "), $4
);
}
| a_expr all_Op sub_type
'(' SelectStmt ')'
| a_expr all_Op sub_type
select_with_parens
{
$$ = cat_str(
6, $1, $2, $3, make_str("("), $5, make_str(")")
);
$$ = cat_str(
4, $1, $2, $3, $4
);
}
| row_expr
{ $$ = $1; }
...
...
@@ -3494,10 +3498,10 @@ c_expr: attr
{ $$ = cat_str(3, make_str("trim(trailing"), $4, make_str(")")); }
| TRIM '(' trim_list ')'
{ $$ = cat_str(3, make_str("trim("), $3, make_str(")")); }
|
'(' select_no_parens ')'
{ $$ =
cat_str(3, make_str("("), $2, make_str(")"))
; }
| EXISTS
'(' SelectStmt ')'
{ $$ = cat
_str(3, make_str("exists("), $3, make_str(")")
); }
|
select_with_parens %prec UMINUS
{ $$ =
$1
; }
| EXISTS
select_with_parens
{ $$ = cat
2_str(make_str("exists"), $2
); }
;
/*
* This used to use ecpg_expr, but since there is no shift/reduce conflict
...
...
@@ -3583,12 +3587,12 @@ trim_list: a_expr FROM expr_list
{ $$ = $1; }
;
in_expr:
SelectStmt
in_expr:
select_with_parens
{
$$ = $1;
}
|
in_expr_nodes
{ $$ =
$1
; }
|
'(' in_expr_nodes ')'
{ $$ =
cat_str(3, make_str("("), $2, make_str(")"))
; }
;
in_expr_nodes: a_expr
...
...
@@ -5069,7 +5073,6 @@ TokenId: ABSOLUTE { $$ = make_str("absolute"); }
| TRIGGER { $$ = make_str("trigger"); }
| TRUNCATE { $$ = make_str("truncate"); }
| TRUSTED { $$ = make_str("trusted"); }
| TYPE_P { $$ = make_str("type"); }
| UNLISTEN { $$ = make_str("unlisten"); }
| UNTIL { $$ = make_str("until"); }
| UPDATE { $$ = make_str("update"); }
...
...
@@ -5103,7 +5106,6 @@ ECPGColLabel: ECPGColId { $$ = $1; }
| ALL { $$ = make_str("all"); }
| ANALYSE { $$ = make_str("analyse"); }
| ANALYZE { $$ = make_str("analyze"); }
| AND { $$ = make_str("and"); }
| ANY { $$ = make_str("any"); }
| ASC { $$ = make_str("asc"); }
| BETWEEN { $$ = make_str("between"); }
...
...
@@ -5198,7 +5200,6 @@ ECPGColLabel: ECPGColId { $$ = $1; }
| TABLE { $$ = make_str("table"); }
| THEN { $$ = make_str("then"); }
| TO { $$ = make_str("to"); }
| TRAILING { $$ = make_str("trailing"); }
| TRANSACTION { $$ = make_str("transaction"); }
| TRIM { $$ = make_str("trim"); }
| TRUE_P { $$ = make_str("true"); }
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录