Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
53b8ea58
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,发现更多精彩内容 >>
提交
53b8ea58
编写于
10月 28, 1998
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix for serial creation.
上级
1adacc7d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
32 addition
and
11 deletion
+32
-11
src/backend/parser/analyze.c
src/backend/parser/analyze.c
+32
-11
未找到文件。
src/backend/parser/analyze.c
浏览文件 @
53b8ea58
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.8
8 1998/09/25 13:36:00 thomas
Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.8
9 1998/10/28 16:06:54 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -42,7 +42,8 @@ static Query *transformUpdateStmt(ParseState *pstate, UpdateStmt *stmt);
...
@@ -42,7 +42,8 @@ static Query *transformUpdateStmt(ParseState *pstate, UpdateStmt *stmt);
static
Query
*
transformCursorStmt
(
ParseState
*
pstate
,
SelectStmt
*
stmt
);
static
Query
*
transformCursorStmt
(
ParseState
*
pstate
,
SelectStmt
*
stmt
);
static
Query
*
transformCreateStmt
(
ParseState
*
pstate
,
CreateStmt
*
stmt
);
static
Query
*
transformCreateStmt
(
ParseState
*
pstate
,
CreateStmt
*
stmt
);
List
*
extras
=
NIL
;
List
*
extras_before
=
NIL
;
List
*
extras_after
=
NIL
;
/*
/*
* parse_analyze -
* parse_analyze -
...
@@ -57,6 +58,7 @@ parse_analyze(List *pl, ParseState *parentParseState)
...
@@ -57,6 +58,7 @@ parse_analyze(List *pl, ParseState *parentParseState)
{
{
QueryTreeList
*
result
;
QueryTreeList
*
result
;
ParseState
*
pstate
;
ParseState
*
pstate
;
Query
*
parsetree
;
int
i
=
0
;
int
i
=
0
;
result
=
malloc
(
sizeof
(
QueryTreeList
));
result
=
malloc
(
sizeof
(
QueryTreeList
));
...
@@ -66,23 +68,40 @@ parse_analyze(List *pl, ParseState *parentParseState)
...
@@ -66,23 +68,40 @@ parse_analyze(List *pl, ParseState *parentParseState)
while
(
pl
!=
NIL
)
while
(
pl
!=
NIL
)
{
{
pstate
=
make_parsestate
(
parentParseState
);
pstate
=
make_parsestate
(
parentParseState
);
result
->
qtrees
[
i
++
]
=
transformStmt
(
pstate
,
lfirst
(
pl
));
parsetree
=
transformStmt
(
pstate
,
lfirst
(
pl
));
if
(
pstate
->
p_target_relation
!=
NULL
)
if
(
pstate
->
p_target_relation
!=
NULL
)
heap_close
(
pstate
->
p_target_relation
);
heap_close
(
pstate
->
p_target_relation
);
if
(
extras
!=
NIL
)
if
(
extras
_before
!=
NIL
)
{
{
result
->
len
+=
length
(
extras
);
result
->
len
+=
length
(
extras
_before
);
result
->
qtrees
=
(
Query
**
)
realloc
(
result
->
qtrees
,
result
->
len
*
sizeof
(
Query
*
));
result
->
qtrees
=
(
Query
**
)
realloc
(
result
->
qtrees
,
result
->
len
*
sizeof
(
Query
*
));
while
(
extras
!=
NIL
)
while
(
extras
_before
!=
NIL
)
{
{
result
->
qtrees
[
i
++
]
=
transformStmt
(
pstate
,
lfirst
(
extras
));
result
->
qtrees
[
i
++
]
=
transformStmt
(
pstate
,
lfirst
(
extras
_before
));
if
(
pstate
->
p_target_relation
!=
NULL
)
if
(
pstate
->
p_target_relation
!=
NULL
)
heap_close
(
pstate
->
p_target_relation
);
heap_close
(
pstate
->
p_target_relation
);
extras
=
lnext
(
extras
);
extras
_before
=
lnext
(
extras_before
);
}
}
}
}
extras
=
NIL
;
extras_before
=
NIL
;
result
->
qtrees
[
i
++
]
=
parsetree
;
if
(
extras_after
!=
NIL
)
{
result
->
len
+=
length
(
extras_after
);
result
->
qtrees
=
(
Query
**
)
realloc
(
result
->
qtrees
,
result
->
len
*
sizeof
(
Query
*
));
while
(
extras_after
!=
NIL
)
{
result
->
qtrees
[
i
++
]
=
transformStmt
(
pstate
,
lfirst
(
extras_after
));
if
(
pstate
->
p_target_relation
!=
NULL
)
heap_close
(
pstate
->
p_target_relation
);
extras_after
=
lnext
(
extras_after
);
}
}
extras_after
=
NIL
;
pl
=
lnext
(
pl
);
pl
=
lnext
(
pl
);
pfree
(
pstate
);
pfree
(
pstate
);
}
}
...
@@ -487,6 +506,7 @@ transformCreateStmt(ParseState *pstate, CreateStmt *stmt)
...
@@ -487,6 +506,7 @@ transformCreateStmt(ParseState *pstate, CreateStmt *stmt)
Constraint
*
constraint
;
Constraint
*
constraint
;
List
*
keys
;
List
*
keys
;
Ident
*
key
;
Ident
*
key
;
List
*
blist
=
NIL
;
List
*
ilist
=
NIL
;
List
*
ilist
=
NIL
;
IndexStmt
*
index
;
IndexStmt
*
index
;
IndexElem
*
iparam
;
IndexElem
*
iparam
;
...
@@ -553,7 +573,7 @@ transformCreateStmt(ParseState *pstate, CreateStmt *stmt)
...
@@ -553,7 +573,7 @@ transformCreateStmt(ParseState *pstate, CreateStmt *stmt)
elog
(
NOTICE
,
"CREATE TABLE will create implicit sequence %s for SERIAL column %s.%s"
,
elog
(
NOTICE
,
"CREATE TABLE will create implicit sequence %s for SERIAL column %s.%s"
,
sequence
->
seqname
,
stmt
->
relname
,
column
->
colname
);
sequence
->
seqname
,
stmt
->
relname
,
column
->
colname
);
i
list
=
lcons
(
sequence
,
NIL
);
b
list
=
lcons
(
sequence
,
NIL
);
}
}
if
(
column
->
constraints
!=
NIL
)
if
(
column
->
constraints
!=
NIL
)
...
@@ -745,7 +765,8 @@ transformCreateStmt(ParseState *pstate, CreateStmt *stmt)
...
@@ -745,7 +765,8 @@ transformCreateStmt(ParseState *pstate, CreateStmt *stmt)
}
}
q
->
utilityStmt
=
(
Node
*
)
stmt
;
q
->
utilityStmt
=
(
Node
*
)
stmt
;
extras
=
ilist
;
extras_before
=
blist
;
extras_after
=
ilist
;
return
q
;
return
q
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录