Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
84876289
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,发现更多精彩内容 >>
提交
84876289
编写于
1月 22, 1997
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Cast constants to the type of the other binary operand.
Invalidate vacuum relation cache to use new row counts from vacuum.
上级
a4ee68d1
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
105 addition
and
26 deletion
+105
-26
src/backend/commands/vacuum.c
src/backend/commands/vacuum.c
+8
-1
src/backend/nodes/makefuncs.c
src/backend/nodes/makefuncs.c
+4
-2
src/backend/optimizer/prep/preptlist.c
src/backend/optimizer/prep/preptlist.c
+3
-2
src/backend/parser/analyze.c
src/backend/parser/analyze.c
+5
-3
src/backend/parser/catalog_utils.c
src/backend/parser/catalog_utils.c
+21
-1
src/backend/parser/parse_query.c
src/backend/parser/parse_query.c
+46
-5
src/backend/parser/parser.c
src/backend/parser/parser.c
+11
-8
src/include/nodes/makefuncs.h
src/include/nodes/makefuncs.h
+3
-2
src/include/nodes/primnodes.h
src/include/nodes/primnodes.h
+2
-1
src/include/parser/catalog_utils.h
src/include/parser/catalog_utils.h
+2
-1
未找到文件。
src/backend/commands/vacuum.c
浏览文件 @
84876289
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.1
4 1997/01/13 03:43:59
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.1
5 1997/01/22 01:42:16
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -29,10 +29,12 @@
...
@@ -29,10 +29,12 @@
#include <catalog/pg_index.h>
#include <catalog/pg_index.h>
#include <catalog/index.h>
#include <catalog/index.h>
#include <catalog/catname.h>
#include <catalog/catname.h>
#include <catalog/catalog.h>
#include <catalog/pg_class.h>
#include <catalog/pg_class.h>
#include <catalog/pg_proc.h>
#include <catalog/pg_proc.h>
#include <storage/smgr.h>
#include <storage/smgr.h>
#include <storage/lmgr.h>
#include <storage/lmgr.h>
#include <utils/inval.h>
#include <utils/mcxt.h>
#include <utils/mcxt.h>
#include <utils/syscache.h>
#include <utils/syscache.h>
#include <commands/vacuum.h>
#include <commands/vacuum.h>
...
@@ -1430,6 +1432,11 @@ _vc_updstats(Oid relid, int npages, int ntuples, bool hasindex)
...
@@ -1430,6 +1432,11 @@ _vc_updstats(Oid relid, int npages, int ntuples, bool hasindex)
/* XXX -- after write, should invalidate relcache in other backends */
/* XXX -- after write, should invalidate relcache in other backends */
WriteNoReleaseBuffer
(
buf
);
/* heap_endscan release scan' buffers ? */
WriteNoReleaseBuffer
(
buf
);
/* heap_endscan release scan' buffers ? */
/* invalidating system relations confuses the function cache
of pg_operator and pg_opclass */
if
(
!
IsSystemRelationName
(
pgcform
->
relname
.
data
))
RelationInvalidateHeapTuple
(
rd
,
tup
);
/* that's all, folks */
/* that's all, folks */
heap_endscan
(
sdesc
);
heap_endscan
(
sdesc
);
heap_close
(
rd
);
heap_close
(
rd
);
...
...
src/backend/nodes/makefuncs.c
浏览文件 @
84876289
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.
1.1.1 1996/07/09 06:21:32 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.
2 1997/01/22 01:42:26 momjian
Exp $
*
*
* NOTES
* NOTES
* Creator functions in POSTGRES 4.2 are generated automatically. Most of
* Creator functions in POSTGRES 4.2 are generated automatically. Most of
...
@@ -102,7 +102,8 @@ makeConst(Oid consttype,
...
@@ -102,7 +102,8 @@ makeConst(Oid consttype,
Datum
constvalue
,
Datum
constvalue
,
bool
constisnull
,
bool
constisnull
,
bool
constbyval
,
bool
constbyval
,
bool
constisset
)
bool
constisset
,
bool
constiscast
)
{
{
Const
*
cnst
=
makeNode
(
Const
);
Const
*
cnst
=
makeNode
(
Const
);
...
@@ -112,6 +113,7 @@ makeConst(Oid consttype,
...
@@ -112,6 +113,7 @@ makeConst(Oid consttype,
cnst
->
constisnull
=
constisnull
;
cnst
->
constisnull
=
constisnull
;
cnst
->
constbyval
=
constbyval
;
cnst
->
constbyval
=
constbyval
;
cnst
->
constisset
=
constisset
;
cnst
->
constisset
=
constisset
;
cnst
->
constiscast
=
constiscast
;
return
cnst
;
return
cnst
;
}
}
src/backend/optimizer/prep/preptlist.c
浏览文件 @
84876289
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/preptlist.c,v 1.
1.1.1 1996/07/09 06:21:38 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/preptlist.c,v 1.
2 1997/01/22 01:42:38 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -279,7 +279,8 @@ new_relation_targetlist(Oid relid, Index rt_index, NodeTag node_type)
...
@@ -279,7 +279,8 @@ new_relation_targetlist(Oid relid, Index rt_index, NodeTag node_type)
(
typedefault
==
(
struct
varlena
*
)
NULL
),
(
typedefault
==
(
struct
varlena
*
)
NULL
),
/* XXX this is bullshit */
/* XXX this is bullshit */
false
,
false
,
false
/* not a set */
);
false
,
/* not a set */
false
);
temp3
=
MakeTLE
(
makeResdom
(
attno
,
temp3
=
MakeTLE
(
makeResdom
(
attno
,
atttype
,
atttype
,
...
...
src/backend/parser/analyze.c
浏览文件 @
84876289
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.
19 1996/12/17 01:53:26
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.
20 1997/01/22 01:42:54
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -1288,7 +1288,8 @@ make_targetlist_expr(ParseState *pstate,
...
@@ -1288,7 +1288,8 @@ make_targetlist_expr(ParseState *pstate,
val,
val,
false,
false,
true,
true,
true /* is set */);
true, /* is set */
false);
} else {
} else {
lnext(expr) =
lnext(expr) =
makeConst(attrtype,
makeConst(attrtype,
...
@@ -1297,7 +1298,8 @@ make_targetlist_expr(ParseState *pstate,
...
@@ -1297,7 +1298,8 @@ make_targetlist_expr(ParseState *pstate,
val,get_typelem(attrtype),-1),
val,get_typelem(attrtype),-1),
false,
false,
true /* Maybe correct-- 80% chance */,
true /* Maybe correct-- 80% chance */,
false /* is not a set */);
false, /* is not a set */
false);
}
}
} else if((Typecast_ok) && (attrtype != type_id)){
} else if((Typecast_ok) && (attrtype != type_id)){
lnext(expr) =
lnext(expr) =
...
...
src/backend/parser/catalog_utils.c
浏览文件 @
84876289
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.1
4 1996/12/26 17:47:41
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.1
5 1997/01/22 01:43:08
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -1405,6 +1405,26 @@ typeid_get_retinfunc(Oid type_id)
...
@@ -1405,6 +1405,26 @@ typeid_get_retinfunc(Oid type_id)
return
(
infunc
);
return
(
infunc
);
}
}
/* Given a type id, returns the out-conversion function of the type */
Oid
typeid_get_retoutfunc
(
Oid
type_id
)
{
HeapTuple
typeTuple
;
TypeTupleForm
type
;
Oid
outfunc
;
typeTuple
=
SearchSysCacheTuple
(
TYPOID
,
ObjectIdGetDatum
(
type_id
),
0
,
0
,
0
);
if
(
!
HeapTupleIsValid
(
typeTuple
))
elog
(
WARN
,
"typeid_get_retoutfunc: Invalid type - oid = %u"
,
type_id
);
type
=
(
TypeTupleForm
)
GETSTRUCT
(
typeTuple
);
outfunc
=
type
->
typoutput
;
return
(
outfunc
);
}
Oid
Oid
typeid_get_relid
(
Oid
type_id
)
typeid_get_relid
(
Oid
type_id
)
{
{
...
...
src/backend/parser/parse_query.c
浏览文件 @
84876289
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/parse_query.c,v 1.1
1 1996/12/07 04:38:10
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/parse_query.c,v 1.1
2 1997/01/22 01:43:19
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -367,10 +367,50 @@ make_op(char *opname, Node *ltree, Node *rtree)
...
@@ -367,10 +367,50 @@ make_op(char *opname, Node *ltree, Node *rtree)
left
=
NULL
;
left
=
NULL
;
}
else
{
}
else
{
char
*
outstr
;
Oid
infunc
,
outfunc
;
Type
newtype
;
#define CONVERTABLE_TYPE(t) ( (t) == INT2OID || \
(t) == INT4OID || \
(t) == OIDOID || \
(t) == FLOAT4OID || \
(t) == FLOAT8OID)
/* binary operator */
/* binary operator */
ltypeId
=
(
ltree
==
NULL
)
?
UNKNOWNOID
:
exprType
(
ltree
);
ltypeId
=
(
ltree
==
NULL
)
?
UNKNOWNOID
:
exprType
(
ltree
);
rtypeId
=
(
rtree
==
NULL
)
?
UNKNOWNOID
:
exprType
(
rtree
);
rtypeId
=
(
rtree
==
NULL
)
?
UNKNOWNOID
:
exprType
(
rtree
);
/* convert constant when using a const of a numeric type
and a non-const of another numeric type */
if
(
CONVERTABLE_TYPE
(
ltypeId
)
&&
nodeTag
(
ltree
)
!=
T_Const
&&
CONVERTABLE_TYPE
(
rtypeId
)
&&
nodeTag
(
rtree
)
==
T_Const
&&
!
((
Const
*
)
rtree
)
->
constiscast
)
{
outfunc
=
typeid_get_retoutfunc
(
rtypeId
);
infunc
=
typeid_get_retinfunc
(
ltypeId
);
outstr
=
(
char
*
)
fmgr
(
outfunc
,
((
Const
*
)
rtree
)
->
constvalue
);
((
Const
*
)
rtree
)
->
constvalue
=
(
Datum
)
fmgr
(
infunc
,
outstr
);
pfree
(
outstr
);
((
Const
*
)
rtree
)
->
consttype
=
rtypeId
=
ltypeId
;
newtype
=
get_id_type
(
rtypeId
);
((
Const
*
)
rtree
)
->
constlen
=
tlen
(
newtype
);
((
Const
*
)
rtree
)
->
constbyval
=
tbyval
(
newtype
);
}
if
(
CONVERTABLE_TYPE
(
rtypeId
)
&&
nodeTag
(
rtree
)
!=
T_Const
&&
CONVERTABLE_TYPE
(
ltypeId
)
&&
nodeTag
(
ltree
)
==
T_Const
&&
!
((
Const
*
)
ltree
)
->
constiscast
)
{
outfunc
=
typeid_get_retoutfunc
(
ltypeId
);
infunc
=
typeid_get_retinfunc
(
rtypeId
);
outstr
=
(
char
*
)
fmgr
(
outfunc
,
((
Const
*
)
ltree
)
->
constvalue
);
((
Const
*
)
ltree
)
->
constvalue
=
(
Datum
)
fmgr
(
infunc
,
outstr
);
pfree
(
outstr
);
((
Const
*
)
ltree
)
->
consttype
=
ltypeId
=
rtypeId
;
newtype
=
get_id_type
(
ltypeId
);
((
Const
*
)
ltree
)
->
constlen
=
tlen
(
newtype
);
((
Const
*
)
ltree
)
->
constbyval
=
tbyval
(
newtype
);
}
temp
=
oper
(
opname
,
ltypeId
,
rtypeId
);
temp
=
oper
(
opname
,
ltypeId
,
rtypeId
);
opform
=
(
OperatorTupleForm
)
GETSTRUCT
(
temp
);
opform
=
(
OperatorTupleForm
)
GETSTRUCT
(
temp
);
left
=
make_operand
(
opname
,
ltree
,
ltypeId
,
opform
->
oprleft
);
left
=
make_operand
(
opname
,
ltree
,
ltypeId
,
opform
->
oprleft
);
...
@@ -654,7 +694,7 @@ make_const(Value *value)
...
@@ -654,7 +694,7 @@ make_const(Value *value)
elog
(
NOTICE
,
"unknown type : %d
\n
"
,
nodeTag
(
value
));
elog
(
NOTICE
,
"unknown type : %d
\n
"
,
nodeTag
(
value
));
/* null const */
/* null const */
con
=
makeConst
(
0
,
0
,
(
Datum
)
NULL
,
TRUE
,
0
,
FALSE
);
con
=
makeConst
(
0
,
0
,
(
Datum
)
NULL
,
true
,
false
,
false
,
false
);
return
con
;
return
con
;
}
}
}
}
...
@@ -662,9 +702,10 @@ make_const(Value *value)
...
@@ -662,9 +702,10 @@ make_const(Value *value)
con
=
makeConst
(
typeid
(
tp
),
con
=
makeConst
(
typeid
(
tp
),
tlen
(
tp
),
tlen
(
tp
),
val
,
val
,
FALSE
,
false
,
tbyval
(
tp
),
tbyval
(
tp
),
FALSE
);
/* not a set */
false
,
/* not a set */
false
);
return
(
con
);
return
(
con
);
}
}
...
...
src/backend/parser/parser.c
浏览文件 @
84876289
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.1
6 1996/12/26 17:47:42
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.1
7 1997/01/22 01:43:26
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -283,9 +283,10 @@ parser_typecast(Value *expr, TypeName *typename, int typlen)
...
@@ -283,9 +283,10 @@ parser_typecast(Value *expr, TypeName *typename, int typlen)
adt
=
makeConst
(
typeid
(
tp
),
adt
=
makeConst
(
typeid
(
tp
),
len
,
len
,
(
Datum
)
lcp
,
(
Datum
)
lcp
,
0
,
false
,
tbyvalue
(
tp
),
tbyvalue
(
tp
),
0
/* not a set */
);
false
,
/* not a set */
true
/* is cast */
);
if
(
string_palloced
)
if
(
string_palloced
)
pfree
(
const_string
);
pfree
(
const_string
);
...
@@ -365,8 +366,9 @@ parser_typecast2(Node *expr, Oid exprType, Type tp, int typlen)
...
@@ -365,8 +366,9 @@ parser_typecast2(Node *expr, Oid exprType, Type tp, int typlen)
(
Size
)
0
,
(
Size
)
0
,
(
Datum
)
NULL
,
(
Datum
)
NULL
,
true
,
/* isnull */
true
,
/* isnull */
0
/* was omitted */
,
false
,
/* was omitted */
0
/* not a set */
);
false
,
/* not a set */
true
/* is cast */
);
return
((
Node
*
)
adt
);
return
((
Node
*
)
adt
);
}
}
...
@@ -401,9 +403,10 @@ parser_typecast2(Node *expr, Oid exprType, Type tp, int typlen)
...
@@ -401,9 +403,10 @@ parser_typecast2(Node *expr, Oid exprType, Type tp, int typlen)
adt
=
makeConst
(
typeid
(
tp
),
adt
=
makeConst
(
typeid
(
tp
),
(
Size
)
len
,
(
Size
)
len
,
(
Datum
)
lcp
,
(
Datum
)
lcp
,
0
,
false
,
0
/*was omitted*/
,
false
,
/*was omitted*/
0
/* not a set */
);
false
,
/* not a set */
true
/* is cast */
);
/*
/*
printf("adt %s : %u %d %d\n",CString(expr),typeid(tp) ,
printf("adt %s : %u %d %d\n",CString(expr),typeid(tp) ,
len,cp);
len,cp);
...
...
src/include/nodes/makefuncs.h
浏览文件 @
84876289
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: makefuncs.h,v 1.
2 1996/11/06 09:21:42 scrappy
Exp $
* $Id: makefuncs.h,v 1.
3 1997/01/22 01:43:41 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -41,6 +41,7 @@ extern Const *makeConst(Oid consttype,
...
@@ -41,6 +41,7 @@ extern Const *makeConst(Oid consttype,
Datum
constvalue
,
Datum
constvalue
,
bool
constisnull
,
bool
constisnull
,
bool
constbyval
,
bool
constbyval
,
bool
constisset
);
bool
constisset
,
bool
constiscast
);
#endif
/* MAKEFUNC_H */
#endif
/* MAKEFUNC_H */
src/include/nodes/primnodes.h
浏览文件 @
84876289
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: primnodes.h,v 1.
6 1996/11/04 07:18:21 scrappy
Exp $
* $Id: primnodes.h,v 1.
7 1997/01/22 01:43:44 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -175,6 +175,7 @@ typedef struct Const {
...
@@ -175,6 +175,7 @@ typedef struct Const {
bool
constisnull
;
bool
constisnull
;
bool
constbyval
;
bool
constbyval
;
bool
constisset
;
bool
constisset
;
bool
constiscast
;
}
Const
;
}
Const
;
/* ----------------
/* ----------------
...
...
src/include/parser/catalog_utils.h
浏览文件 @
84876289
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: catalog_utils.h,v 1.
6 1996/12/11 03:18:12 bryanh
Exp $
* $Id: catalog_utils.h,v 1.
7 1997/01/22 01:44:02 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -46,6 +46,7 @@ extern Oid funcid_get_rettype(Oid funcid);
...
@@ -46,6 +46,7 @@ extern Oid funcid_get_rettype(Oid funcid);
extern
bool
func_get_detail
(
char
*
funcname
,
int
nargs
,
Oid
*
oid_array
,
extern
bool
func_get_detail
(
char
*
funcname
,
int
nargs
,
Oid
*
oid_array
,
Oid
*
funcid
,
Oid
*
rettype
,
bool
*
retset
,
Oid
**
true_typeids
);
Oid
*
funcid
,
Oid
*
rettype
,
bool
*
retset
,
Oid
**
true_typeids
);
extern
Oid
typeid_get_retinfunc
(
Oid
type_id
);
extern
Oid
typeid_get_retinfunc
(
Oid
type_id
);
extern
Oid
typeid_get_retoutfunc
(
Oid
type_id
);
extern
Oid
typeid_get_relid
(
Oid
type_id
);
extern
Oid
typeid_get_relid
(
Oid
type_id
);
extern
Oid
get_typrelid
(
Type
typ
);
extern
Oid
get_typrelid
(
Type
typ
);
extern
Oid
get_typelem
(
Oid
type_id
);
extern
Oid
get_typelem
(
Oid
type_id
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录