Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
247b3f90
Commit
247b3f90
authored
Jan 25, 1999
by
Vadim B. Mikheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SELECT FOR UPDATE is implemented...
parent
443e24be
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
715 additions
and
581 deletions
+715
-581
src/backend/executor/execMain.c
src/backend/executor/execMain.c
+105
-4
src/backend/optimizer/plan/planner.c
src/backend/optimizer/plan/planner.c
+43
-7
src/backend/parser/analyze.c
src/backend/parser/analyze.c
+18
-2
src/backend/parser/gram.c
src/backend/parser/gram.c
+541
-552
src/backend/parser/gram.y
src/backend/parser/gram.y
+3
-14
src/backend/rewrite/rewriteHandler.c
src/backend/rewrite/rewriteHandler.c
+3
-1
src/include/nodes/execnodes.h
src/include/nodes/execnodes.h
+2
-1
No files found.
src/backend/executor/execMain.c
View file @
247b3f90
...
...
@@ -26,7 +26,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.6
2 1998/12/18 09:10:21
vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.6
3 1999/01/25 12:01:03
vadim Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -363,6 +363,32 @@ ExecCheckPerms(CmdType operation,
}
if
(
!
ok
)
elog
(
ERROR
,
"%s: %s"
,
rname
.
data
,
aclcheck_error_strings
[
aclcheck_result
]);
if
(
parseTree
->
rowMark
!=
NULL
)
{
foreach
(
lp
,
parseTree
->
rowMark
)
{
RowMark
*
rm
=
lfirst
(
lp
);
if
(
!
(
rm
->
info
&
ROW_ACL_FOR_UPDATE
))
continue
;
relid
=
((
RangeTblEntry
*
)
nth
(
rm
->
rti
-
1
,
rangeTable
))
->
relid
;
htup
=
SearchSysCacheTuple
(
RELOID
,
ObjectIdGetDatum
(
relid
),
0
,
0
,
0
);
if
(
!
HeapTupleIsValid
(
htup
))
elog
(
ERROR
,
"ExecCheckPerms: bogus RT relid: %d"
,
relid
);
StrNCpy
(
rname
.
data
,
((
Form_pg_class
)
GETSTRUCT
(
htup
))
->
relname
.
data
,
NAMEDATALEN
);
ok
=
((
aclcheck_result
=
CHECK
(
ACL_WR
))
==
ACLCHECK_OK
);
opstr
=
"write"
;
if
(
!
ok
)
elog
(
ERROR
,
"%s: %s"
,
rname
.
data
,
aclcheck_error_strings
[
aclcheck_result
]);
}
}
}
/* ===============================================================
...
...
@@ -372,6 +398,11 @@ ExecCheckPerms(CmdType operation,
* ===============================================================
*/
typedef
struct
execRowMark
{
Relation
relation
;
char
resname
[
32
];
}
execRowMark
;
/* ----------------------------------------------------------------
* InitPlan
...
...
@@ -398,6 +429,10 @@ InitPlan(CmdType operation, Query *parseTree, Plan *plan, EState *estate)
rangeTable
=
parseTree
->
rtable
;
resultRelation
=
parseTree
->
resultRelation
;
#ifndef NO_SECURITY
ExecCheckPerms
(
operation
,
resultRelation
,
rangeTable
,
parseTree
);
#endif
/******************
* initialize the node's execution state
******************
...
...
@@ -468,9 +503,32 @@ InitPlan(CmdType operation, Query *parseTree, Plan *plan, EState *estate)
estate
->
es_result_relation_info
=
NULL
;
}
#ifndef NO_SECURITY
ExecCheckPerms
(
operation
,
resultRelation
,
rangeTable
,
parseTree
);
#endif
/*
* Have to lock relations selected for update
*/
estate
->
es_rowMark
=
NULL
;
if
(
parseTree
->
rowMark
!=
NULL
)
{
Relation
relation
;
Oid
relid
;
RowMark
*
rm
;
List
*
l
;
execRowMark
*
erm
;
foreach
(
l
,
parseTree
->
rowMark
)
{
rm
=
lfirst
(
l
);
relid
=
((
RangeTblEntry
*
)
nth
(
rm
->
rti
-
1
,
rangeTable
))
->
relid
;
relation
=
heap_open
(
relid
);
LockRelation
(
relation
,
RowShareLock
);
if
(
!
(
rm
->
info
&
ROW_MARK_FOR_UPDATE
))
continue
;
erm
=
(
execRowMark
*
)
palloc
(
sizeof
(
execRowMark
));
erm
->
relation
=
relation
;
sprintf
(
erm
->
resname
,
"ctid%u"
,
rm
->
rti
);
estate
->
es_rowMark
=
lappend
(
estate
->
es_rowMark
,
erm
);
}
}
/******************
* initialize the executor "tuple" table.
...
...
@@ -777,6 +835,49 @@ ExecutePlan(EState *estate,
* ctid!! */
tupleid
=
&
tuple_ctid
;
}
else
if
(
estate
->
es_rowMark
!=
NULL
)
{
List
*
l
;
execRowMark
*
erm
;
Buffer
buffer
;
HeapTupleData
tuple
;
int
test
;
foreach
(
l
,
estate
->
es_rowMark
)
{
erm
=
lfirst
(
l
);
if
(
!
ExecGetJunkAttribute
(
junkfilter
,
slot
,
erm
->
resname
,
&
datum
,
&
isNull
))
elog
(
ERROR
,
"ExecutePlan: NO (junk) `%s' was found!"
,
erm
->
resname
);
if
(
isNull
)
elog
(
ERROR
,
"ExecutePlan: (junk) `%s' is NULL!"
,
erm
->
resname
);
tuple
.
t_self
=
*
((
ItemPointer
)
DatumGetPointer
(
datum
));
test
=
heap_mark4update
(
erm
->
relation
,
&
tuple
,
&
buffer
);
ReleaseBuffer
(
buffer
);
switch
(
test
)
{
case
HeapTupleSelfUpdated
:
case
HeapTupleMayBeUpdated
:
break
;
case
HeapTupleUpdated
:
if
(
XactIsoLevel
==
XACT_SERIALIZABLE
)
elog
(
ERROR
,
"Can't serialize access due to concurrent update"
);
else
elog
(
ERROR
,
"Isolation level %u is not supported"
,
XactIsoLevel
);
return
(
NULL
);
default:
elog
(
ERROR
,
"Unknown status %u from heap_mark4update"
,
test
);
return
(
NULL
);
}
}
}
/******************
* Finally create a new "clean" tuple with all junk attributes
...
...
src/backend/optimizer/plan/planner.c
View file @
247b3f90
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.3
6 1999/01/18 00:09:47 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.3
7 1999/01/25 12:01:04 vadim
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -20,6 +20,8 @@
#include "nodes/plannodes.h"
#include "nodes/parsenodes.h"
#include "nodes/relation.h"
#include "nodes/makefuncs.h"
#include "catalog/pg_type.h"
#include "parser/parse_expr.h"
#include "utils/elog.h"
...
...
@@ -119,6 +121,8 @@ union_planner(Query *parse)
else
if
((
rt_index
=
first_inherit_rt_entry
(
rangetable
))
!=
-
1
)
{
if
(
parse
->
rowMark
!=
NULL
)
elog
(
ERROR
,
"SELECT FOR UPDATE is not supported for inherit queries"
);
result_plan
=
(
Plan
*
)
plan_inherit_queries
(
parse
,
rt_index
);
/* XXX do we need to do this? bjm 12/19/97 */
tlist
=
preprocess_targetlist
(
tlist
,
...
...
@@ -148,17 +152,49 @@ union_planner(Query *parse)
* a new entry and attaches it to the list 'new_tlist' (consisting of the
* VAR node and the RESDOM node as usual with tlists :-) ) */
if
(
parse
->
hasAggs
)
{
{
if
(
parse
->
havingQual
!=
NULL
)
{
new_tlist
=
check_having_qual_for_vars
(
parse
->
havingQual
,
new_tlist
);
}
}
{
new_tlist
=
check_having_qual_for_vars
(
parse
->
havingQual
,
new_tlist
);
}
}
new_tlist
=
preprocess_targetlist
(
new_tlist
,
parse
->
commandType
,
parse
->
resultRelation
,
parse
->
rtable
);
/* FOR UPDATE ... */
if
(
parse
->
rowMark
!=
NULL
)
{
List
*
l
;
TargetEntry
*
ctid
;
Resdom
*
resdom
;
Var
*
var
;
char
*
resname
;
foreach
(
l
,
parse
->
rowMark
)
{
if
(
!
(((
RowMark
*
)
lfirst
(
l
))
->
info
&
ROW_MARK_FOR_UPDATE
))
continue
;
resname
=
(
char
*
)
palloc
(
32
);
sprintf
(
resname
,
"ctid%u"
,
((
RowMark
*
)
lfirst
(
l
))
->
rti
);
resdom
=
makeResdom
(
length
(
new_tlist
)
+
1
,
TIDOID
,
-
1
,
resname
,
0
,
0
,
1
);
var
=
makeVar
(((
RowMark
*
)
lfirst
(
l
))
->
rti
,
-
1
,
TIDOID
,
-
1
,
0
,
((
RowMark
*
)
lfirst
(
l
))
->
rti
,
-
1
);
ctid
=
makeTargetEntry
(
resdom
,
(
Node
*
)
var
);
new_tlist
=
lappend
(
new_tlist
,
ctid
);
}
}
/* Here starts the original (pre having) code */
tlist
=
preprocess_targetlist
(
tlist
,
...
...
@@ -290,7 +326,7 @@ union_planner(Query *parse)
pfree
(
vpm
);
}
}
/*
* For now, before we hand back the plan, check to see if there is a
* user-specified sort that needs to be done. Eventually, this will
...
...
src/backend/parser/analyze.c
View file @
247b3f90
...
...
@@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: analyze.c,v 1.9
4 1999/01/21 22:48:07 momjian
Exp $
* $Id: analyze.c,v 1.9
5 1999/01/25 12:01:05 vadim
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -45,7 +45,8 @@ static Query *transformUpdateStmt(ParseState *pstate, UpdateStmt *stmt);
static
Query
*
transformCursorStmt
(
ParseState
*
pstate
,
SelectStmt
*
stmt
);
static
Query
*
transformCreateStmt
(
ParseState
*
pstate
,
CreateStmt
*
stmt
);
static
void
transformForUpdate
(
Query
*
qry
,
List
*
forUpdate
);
static
void
transformForUpdate
(
Query
*
qry
,
List
*
forUpdate
);
void
CheckSelectForUpdate
(
Query
*
qry
);
List
*
extras_before
=
NIL
;
List
*
extras_after
=
NIL
;
...
...
@@ -1134,6 +1135,19 @@ Node *A_Expr_to_Expr(Node *ptr, bool *intersect_present)
return
result
;
}
void
CheckSelectForUpdate
(
Query
*
qry
)
{
if
(
qry
->
unionClause
!=
NULL
)
elog
(
ERROR
,
"SELECT FOR UPDATE is not allowed with UNION/INTERSECT/EXCEPT clause"
);
if
(
qry
->
uniqueFlag
!=
NULL
)
elog
(
ERROR
,
"SELECT FOR UPDATE is not allowed with DISTINCT clause"
);
if
(
qry
->
groupClause
!=
NULL
)
elog
(
ERROR
,
"SELECT FOR UPDATE is not allowed with GROUP BY clause"
);
if
(
qry
->
hasAggs
)
elog
(
ERROR
,
"SELECT FOR UPDATE is not allowed with AGGREGATE"
);
}
static
void
transformForUpdate
(
Query
*
qry
,
List
*
forUpdate
)
{
...
...
@@ -1142,6 +1156,8 @@ transformForUpdate(Query *qry, List *forUpdate)
List
*
l
;
Index
i
;
CheckSelectForUpdate
(
qry
);
if
(
lfirst
(
forUpdate
)
==
NULL
)
/* all tables */
{
i
=
1
;
...
...
src/backend/parser/gram.c
View file @
247b3f90
...
...
@@ -239,7 +239,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/gram.c,v 2.6
2 1999/01/24 00:28:23 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/gram.c,v 2.6
3 1999/01/25 12:01:07 vadim
Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
...
...
@@ -867,55 +867,55 @@ static const short yyrline[] = { 0,
2456
,
2468
,
2484
,
2501
,
2515
,
2533
,
2534
,
2537
,
2540
,
2544
,
2561
,
2571
,
2579
,
2605
,
2622
,
2639
,
2640
,
2650
,
2672
,
2694
,
2695
,
2696
,
2697
,
2698
,
2701
,
2702
,
2705
,
2706
,
2714
,
2731
,
28
31
,
2835
,
2839
,
2844
,
2853
,
2860
,
2887
,
2888
,
2891
,
2892
,
28
95
,
2896
,
2899
,
2900
,
2901
,
2902
,
2905
,
2906
,
2909
,
2910
,
29
13
,
2921
,
2922
,
2923
,
2924
,
2925
,
2926
,
2936
,
2937
,
2940
,
29
42
,
2944
,
2948
,
2949
,
2952
,
2956
,
2959
,
2964
,
2968
,
2982
,
29
87
,
2988
,
2991
,
2993
,
2995
,
2999
,
3005
,
3011
,
3019
,
3020
,
30
22
,
3024
,
3026
,
3028
,
3030
,
3032
,
3036
,
3037
,
3040
,
3041
,
30
42
,
3045
,
3046
,
3049
,
3064
,
3071
,
3080
,
3081
,
3084
,
3091
,
30
99
,
3101
,
3103
,
3107
,
3109
,
3111
,
3126
,
3148
,
3149
,
3156
,
31
57
,
3158
,
3161
,
3169
,
3170
,
3178
,
3184
,
3189
,
3195
,
3203
,
3
205
,
3207
,
3209
,
3213
,
3224
,
3230
,
3241
,
3249
,
3255
,
3266
,
32
74
,
3288
,
3315
,
3334
,
3354
,
3355
,
3356
,
3357
,
3360
,
3361
,
33
64
,
3365
,
3368
,
3369
,
3372
,
3378
,
3385
,
3391
,
3399
,
3400
,
3
401
,
3402
,
3403
,
3404
,
3407
,
3408
,
3411
,
3412
,
3413
,
3414
,
34
15
,
3416
,
3417
,
3418
,
3419
,
3429
,
3431
,
3448
,
3458
,
3468
,
34
81
,
3494
,
3500
,
3506
,
3510
,
3516
,
3517
,
3518
,
3519
,
3520
,
35
21
,
3522
,
3523
,
3526
,
3527
,
3538
,
3543
,
3545
,
3547
,
3555
,
35
57
,
3559
,
3561
,
3563
,
3565
,
3567
,
3569
,
3571
,
3573
,
3575
,
35
77
,
3593
,
3609
,
3611
,
3613
,
3615
,
3617
,
3619
,
3621
,
3633
,
36
40
,
3647
,
3662
,
3677
,
3699
,
3714
,
3736
,
3743
,
3750
,
3760
,
37
67
,
3774
,
3782
,
3789
,
3796
,
3803
,
3810
,
3812
,
3814
,
3816
,
38
23
,
3833
,
3843
,
3853
,
3863
,
3869
,
3875
,
3875
,
3889
,
3889
,
3
903
,
3913
,
3923
,
3933
,
3943
,
3953
,
3963
,
3973
,
3983
,
3993
,
4003
,
4013
,
4023
,
4033
,
4043
,
4053
,
4063
,
4073
,
4083
,
4093
,
4
103
,
4113
,
4123
,
4133
,
4143
,
4145
,
4147
,
4149
,
4158
,
4163
,
41
65
,
4173
,
4175
,
4177
,
4179
,
4181
,
4183
,
4185
,
4187
,
4189
,
4
205
,
4221
,
4223
,
4225
,
4227
,
4229
,
4236
,
4243
,
4258
,
4273
,
42
95
,
4310
,
4332
,
4339
,
4346
,
4353
,
4361
,
4368
,
4375
,
4382
,
43
91
,
4398
,
4405
,
4409
,
4411
,
4413
,
4417
,
4424
,
4428
,
4429
,
44
30
,
4433
,
4435
,
4439
,
4444
,
4446
,
4448
,
4450
,
4452
,
4454
,
44
56
,
4458
,
4474
,
4490
,
4492
,
4494
,
4496
,
4498
,
4506
,
4513
,
45
20
,
4527
,
4535
,
4542
,
4549
,
4556
,
4565
,
4569
,
4573
,
4575
,
45
84
,
4586
,
4590
,
4592
,
4594
,
4598
,
4604
,
4608
,
4610
,
4616
,
46
22
,
4626
,
4628
,
4649
,
4657
,
4668
,
4686
,
4688
,
4692
,
4701
,
4
702
,
4705
,
4710
,
4718
,
4722
,
4730
,
4740
,
4742
,
4744
,
4755
,
47
57
,
4759
,
4774
,
4781
,
4788
,
4807
,
4809
,
4814
,
4821
,
4828
,
48
40
,
4854
,
4855
,
4858
,
4863
,
4875
,
4876
,
4877
,
4878
,
4879
,
48
85
,
4886
,
4888
,
4889
,
4894
,
4901
,
4908
,
4915
,
4923
,
4925
,
49
35
,
4947
,
4955
,
4956
,
4957
,
4964
,
4966
,
4968
,
4979
,
4980
,
49
81
,
4982
,
4983
,
4984
,
4985
,
4986
,
4987
,
4988
,
4989
,
4990
,
49
91
,
4992
,
4993
,
4994
,
4995
,
4996
,
4997
,
4998
,
4999
,
5000
,
5001
,
5002
,
5003
,
5004
,
5005
,
5006
,
5007
,
5008
,
5009
,
5010
,
50
11
,
5012
,
5013
,
5014
,
5015
,
5016
,
5017
,
5018
,
5019
,
5020
,
50
21
,
5022
,
5023
,
5024
,
5025
,
5026
,
5027
,
5028
,
5029
,
5030
,
50
31
,
5032
,
5033
,
5034
,
5035
,
5036
,
5037
,
5038
,
5039
,
5040
,
50
41
,
5042
,
5043
,
5044
,
5045
,
5046
,
5047
,
5048
,
5049
,
5062
,
50
63
,
5064
,
5065
,
5066
,
5067
,
5068
,
5069
,
5070
,
5071
,
5072
,
50
73
,
5074
,
5075
,
5076
,
5077
,
5078
,
5079
,
5080
,
5081
,
5082
,
50
83
,
5084
,
5085
,
5086
,
5087
,
5088
,
5089
,
5090
,
5091
,
5092
,
50
93
,
5094
,
5095
,
5096
,
5097
,
5098
,
5099
,
5100
,
5103
,
5110
28
20
,
2824
,
2828
,
2833
,
2842
,
2849
,
2876
,
2877
,
2880
,
2881
,
28
84
,
2885
,
2888
,
2889
,
2890
,
2891
,
2894
,
2895
,
2898
,
2899
,
29
02
,
2910
,
2911
,
2912
,
2913
,
2914
,
2915
,
2925
,
2926
,
2929
,
29
31
,
2933
,
2937
,
2938
,
2941
,
2945
,
2948
,
2953
,
2957
,
2971
,
29
76
,
2977
,
2980
,
2982
,
2984
,
2988
,
2994
,
3000
,
3008
,
3009
,
30
11
,
3013
,
3015
,
3017
,
3019
,
3021
,
3025
,
3026
,
3029
,
3030
,
30
31
,
3034
,
3035
,
3038
,
3053
,
3060
,
3069
,
3070
,
3073
,
3080
,
30
88
,
3090
,
3092
,
3096
,
3098
,
3100
,
3115
,
3137
,
3138
,
3145
,
31
46
,
3147
,
3150
,
3158
,
3159
,
3167
,
3173
,
3178
,
3184
,
3192
,
3
194
,
3196
,
3198
,
3202
,
3213
,
3219
,
3230
,
3238
,
3244
,
3255
,
32
63
,
3277
,
3304
,
3323
,
3343
,
3344
,
3345
,
3346
,
3349
,
3350
,
33
53
,
3354
,
3357
,
3358
,
3361
,
3367
,
3374
,
3380
,
3388
,
3389
,
3
390
,
3391
,
3392
,
3393
,
3396
,
3397
,
3400
,
3401
,
3402
,
3403
,
34
04
,
3405
,
3406
,
3407
,
3408
,
3418
,
3420
,
3437
,
3447
,
3457
,
34
70
,
3483
,
3489
,
3495
,
3499
,
3505
,
3506
,
3507
,
3508
,
3509
,
35
10
,
3511
,
3512
,
3515
,
3516
,
3527
,
3532
,
3534
,
3536
,
3544
,
35
46
,
3548
,
3550
,
3552
,
3554
,
3556
,
3558
,
3560
,
3562
,
3564
,
35
66
,
3582
,
3598
,
3600
,
3602
,
3604
,
3606
,
3608
,
3610
,
3622
,
36
29
,
3636
,
3651
,
3666
,
3688
,
3703
,
3725
,
3732
,
3739
,
3749
,
37
56
,
3763
,
3771
,
3778
,
3785
,
3792
,
3799
,
3801
,
3803
,
3805
,
38
12
,
3822
,
3832
,
3842
,
3852
,
3858
,
3864
,
3864
,
3878
,
3878
,
3
892
,
3902
,
3912
,
3922
,
3932
,
3942
,
3952
,
3962
,
3972
,
3982
,
3992
,
4002
,
4012
,
4022
,
4032
,
4042
,
4052
,
4062
,
4072
,
4082
,
4
092
,
4102
,
4112
,
4122
,
4132
,
4134
,
4136
,
4138
,
4147
,
4152
,
41
54
,
4162
,
4164
,
4166
,
4168
,
4170
,
4172
,
4174
,
4176
,
4178
,
4
194
,
4210
,
4212
,
4214
,
4216
,
4218
,
4225
,
4232
,
4247
,
4262
,
42
84
,
4299
,
4321
,
4328
,
4335
,
4342
,
4350
,
4357
,
4364
,
4371
,
43
80
,
4387
,
4394
,
4398
,
4400
,
4402
,
4406
,
4413
,
4417
,
4418
,
44
19
,
4422
,
4424
,
4428
,
4433
,
4435
,
4437
,
4439
,
4441
,
4443
,
44
45
,
4447
,
4463
,
4479
,
4481
,
4483
,
4485
,
4487
,
4495
,
4502
,
45
09
,
4516
,
4524
,
4531
,
4538
,
4545
,
4554
,
4558
,
4562
,
4564
,
45
73
,
4575
,
4579
,
4581
,
4583
,
4587
,
4593
,
4597
,
4599
,
4605
,
46
11
,
4615
,
4617
,
4638
,
4646
,
4657
,
4675
,
4677
,
4681
,
4690
,
4
691
,
4694
,
4699
,
4707
,
4711
,
4719
,
4729
,
4731
,
4733
,
4744
,
47
46
,
4748
,
4763
,
4770
,
4777
,
4796
,
4798
,
4803
,
4810
,
4817
,
48
29
,
4843
,
4844
,
4847
,
4852
,
4864
,
4865
,
4866
,
4867
,
4868
,
48
74
,
4875
,
4877
,
4878
,
4883
,
4890
,
4897
,
4904
,
4912
,
4914
,
49
24
,
4936
,
4944
,
4945
,
4946
,
4953
,
4955
,
4957
,
4968
,
4969
,
49
70
,
4971
,
4972
,
4973
,
4974
,
4975
,
4976
,
4977
,
4978
,
4979
,
49
80
,
4981
,
4982
,
4983
,
4984
,
4985
,
4986
,
4987
,
4988
,
4989
,
4990
,
4991
,
4992
,
4993
,
4994
,
4995
,
4996
,
4997
,
4998
,
4999
,
50
00
,
5001
,
5002
,
5003
,
5004
,
5005
,
5006
,
5007
,
5008
,
5009
,
50
10
,
5011
,
5012
,
5013
,
5014
,
5015
,
5016
,
5017
,
5018
,
5019
,
50
20
,
5021
,
5022
,
5023
,
5024
,
5025
,
5026
,
5027
,
5028
,
5029
,
50
30
,
5031
,
5032
,
5033
,
5034
,
5035
,
5036
,
5037
,
5038
,
5051
,
50
52
,
5053
,
5054
,
5055
,
5056
,
5057
,
5058
,
5059
,
5060
,
5061
,
50
62
,
5063
,
5064
,
5065
,
5066
,
5067
,
5068
,
5069
,
5070
,
5071
,
50
72
,
5073
,
5074
,
5075
,
5076
,
5077
,
5078
,
5079
,
5080
,
5081
,
50
82
,
5083
,
5084
,
5085
,
5086
,
5087
,
5088
,
5089
,
5092
,
5099
};
#endif
...
...
@@ -4791,7 +4791,7 @@ static const short yycheck[] = { 3,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
214
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line 3 "/usr/
local/bison
/bison.simple"
#line 3 "/usr/
share/misc
/bison.simple"
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
...
...
@@ -4984,7 +4984,7 @@ __yy_memcpy (char *to, char *from, int count)
#endif
#endif
#line 196 "/usr/
local/bison
/bison.simple"
#line 196 "/usr/
share/misc
/bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
...
...
@@ -7941,42 +7941,31 @@ case 470:
first_select
->
forUpdate
=
yyvsp
[
0
].
list
;
yyval
.
node
=
(
Node
*
)
first_select
;
}
if
(((
SelectStmt
*
)
yyval
.
node
)
->
forUpdate
!=
NULL
)
{
SelectStmt
*
n
=
(
SelectStmt
*
)
yyval
.
node
;
if
(
n
->
unionClause
!=
NULL
)
elog
(
ERROR
,
"SELECT FOR UPDATE is not allowed with UNION/INTERSECT/EXCEPT clause"
);
if
(
n
->
unique
!=
NULL
)
elog
(
ERROR
,
"SELECT FOR UPDATE is not allowed with DISTINCT clause"
);
if
(
n
->
groupClause
!=
NULL
)
elog
(
ERROR
,
"SELECT FOR UPDATE is not allowed with GROUP BY clause"
);
if
(
n
->
havingClause
!=
NULL
)
elog
(
ERROR
,
"SELECT FOR UPDATE is not allowed with HAVING clause"
);
}
if
(((
SelectStmt
*
)
yyval
.
node
)
->
forUpdate
!=
NULL
&&
QueryIsRule
)
elog
(
ERROR
,
"SELECT FOR UPDATE is not allowed in RULES"
);
;
break
;}
case
471
:
#line 28
32
"gram.y"
#line 28
21
"gram.y"
{
yyval
.
node
=
yyvsp
[
-
1
].
node
;
;
break
;}
case
472
:
#line 28
36
"gram.y"
#line 28
25
"gram.y"
{
yyval
.
node
=
yyvsp
[
0
].
node
;
;
break
;}
case
473
:
#line 28
40
"gram.y"
#line 28
29
"gram.y"
{
yyval
.
node
=
(
Node
*
)
makeA_Expr
(
AND
,
NULL
,
yyvsp
[
-
2
].
node
,
makeA_Expr
(
NOT
,
NULL
,
NULL
,
yyvsp
[
0
].
node
));
;
break
;}
case
474
:
#line 28
45
"gram.y"
#line 28
34
"gram.y"
{
if
(
IsA
(
yyvsp
[
0
].
node
,
SelectStmt
))
{
...
...
@@ -7987,13 +7976,13 @@ case 474:
;
break
;}
case
475
:
#line 28
54
"gram.y"
#line 28
43
"gram.y"
{
yyval
.
node
=
(
Node
*
)
makeA_Expr
(
AND
,
NULL
,
yyvsp
[
-
2
].
node
,
yyvsp
[
0
].
node
);
;
break
;}
case
476
:
#line 28
63
"gram.y"
#line 28
52
"gram.y"
{
SelectStmt
*
n
=
makeNode
(
SelectStmt
);
n
->
unique
=
yyvsp
[
-
6
].
str
;
...
...
@@ -8018,63 +8007,63 @@ case 476:
;
break
;}
case
477
:
#line 28
87
"gram.y"
#line 28
76
"gram.y"
{
yyval
.
str
=
yyvsp
[
0
].
str
;
;
break
;}
case
478
:
#line 28
88
"gram.y"
#line 28
77
"gram.y"
{
yyval
.
str
=
NULL
;
;
break
;}
case
479
:
#line 28
91
"gram.y"
#line 28
80
"gram.y"
{
yyval
.
boolean
=
TRUE
;
;
break
;}
case
480
:
#line 28
92
"gram.y"
#line 28
81
"gram.y"
{
yyval
.
boolean
=
FALSE
;
;
break
;}
case
481
:
#line 28
95
"gram.y"
#line 28
84
"gram.y"
{
yyval
.
boolean
=
TRUE
;
;
break
;}
case
482
:
#line 28
96
"gram.y"
#line 28
85
"gram.y"
{
yyval
.
boolean
=
FALSE
;
;
break
;}
case
483
:
#line 28
99
"gram.y"
#line 28
88
"gram.y"
{
yyval
.
str
=
"*"
;
;
break
;}
case
484
:
#line 2
900
"gram.y"
#line 2
889
"gram.y"
{
yyval
.
str
=
yyvsp
[
0
].
str
;
;
break
;}
case
485
:
#line 2
901
"gram.y"
#line 2
890
"gram.y"
{
yyval
.
str
=
NULL
;
;
break
;}
case
486
:
#line 2
902
"gram.y"
#line 2
891
"gram.y"
{
yyval
.
str
=
NULL
;
;
break
;}
case
487
:
#line 2
905
"gram.y"
#line 2
894
"gram.y"
{
yyval
.
list
=
yyvsp
[
0
].
list
;
;
break
;}
case
488
:
#line 2
906
"gram.y"
#line 2
895
"gram.y"
{
yyval
.
list
=
NIL
;
;
break
;}
case
489
:
#line 2
909
"gram.y"
#line 2
898
"gram.y"
{
yyval
.
list
=
lcons
(
yyvsp
[
0
].
sortgroupby
,
NIL
);
;
break
;}
case
490
:
#line 2
910
"gram.y"
#line 2
899
"gram.y"
{
yyval
.
list
=
lappend
(
yyvsp
[
-
2
].
list
,
yyvsp
[
0
].
sortgroupby
);
;
break
;}
case
491
:
#line 29
14
"gram.y"
#line 29
03
"gram.y"
{
yyval
.
sortgroupby
=
makeNode
(
SortGroupBy
);
yyval
.
sortgroupby
->
node
=
yyvsp
[
-
1
].
node
;
...
...
@@ -8082,110 +8071,110 @@ case 491:
;
break
;}
case
492
:
#line 29
21
"gram.y"
#line 29
10
"gram.y"
{
yyval
.
str
=
yyvsp
[
0
].
str
;
;
break
;}
case
493
:
#line 29
22
"gram.y"
#line 29
11
"gram.y"
{
yyval
.
str
=
"<"
;
;
break
;}
case
494
:
#line 29
23
"gram.y"
#line 29
12
"gram.y"
{
yyval
.
str
=
">"
;
;
break
;}
case
495
:
#line 29
24
"gram.y"
#line 29
13
"gram.y"
{
yyval
.
str
=
"<"
;
;
break
;}
case
496
:
#line 29
25
"gram.y"
#line 29
14
"gram.y"
{
yyval
.
str
=
">"
;
;
break
;}
case
497
:
#line 29
26
"gram.y"
#line 29
15
"gram.y"
{
yyval
.
str
=
"<"
;
/*default*/
;
break
;}
case
498
:
#line 29
36
"gram.y"
#line 29
25
"gram.y"
{
yyval
.
boolean
=
TRUE
;
;
break
;}
case
499
:
#line 29
37
"gram.y"
#line 29
26
"gram.y"
{
yyval
.
boolean
=
FALSE
;
;
break
;}
case
501
:
#line 29
43
"gram.y"
#line 29
32
"gram.y"
{
yyval
.
list
=
lcons
(
makeString
(
yyvsp
[
0
].
str
),
NIL
);
;
break
;}
case
502
:
#line 29
45
"gram.y"
#line 29
34
"gram.y"
{
yyval
.
list
=
lappend
(
yyvsp
[
-
2
].
list
,
makeString
(
yyvsp
[
0
].
str
));
;
break
;}
case
503
:
#line 29
48
"gram.y"
#line 29
37
"gram.y"
{
yyval
.
list
=
yyvsp
[
0
].
list
;
;
break
;}
case
504
:
#line 29
49
"gram.y"
#line 29
38
"gram.y"
{
yyval
.
list
=
NIL
;
;
break
;}
case
505
:
#line 29
53
"gram.y"
#line 29
42
"gram.y"
{
yyval
.
node
=
yyvsp
[
0
].
node
;
;
break
;}
case
506
:
#line 29
56
"gram.y"
#line 29
45
"gram.y"
{
yyval
.
node
=
NULL
;
;
break
;}
case
507
:
#line 29
61
"gram.y"
#line 29
50
"gram.y"
{
yyval
.
list
=
lcons
(
NULL
,
NULL
);
;
break
;}
case
508
:
#line 29
65
"gram.y"
#line 29
54
"gram.y"
{
yyval
.
list
=
yyvsp
[
0
].
list
;
;
break
;}
case
509
:
#line 29
69
"gram.y"
#line 29
58
"gram.y"
{
yyval
.
list
=
NULL
;
;
break
;}
case
510
:
#line 29
83
"gram.y"
#line 29
72
"gram.y"
{
yyval
.
list
=
NIL
;
elog
(
ERROR
,
"JOIN not yet implemented"
);
;
break
;}
case
511
:
#line 29
87
"gram.y"
#line 29
76
"gram.y"
{
yyval
.
list
=
yyvsp
[
0
].
list
;
;
break
;}
case
512
:
#line 29
88
"gram.y"
#line 29
77
"gram.y"
{
yyval
.
list
=
NIL
;
;
break
;}
case
513
:
#line 29
92
"gram.y"
#line 29
81
"gram.y"
{
yyval
.
list
=
lappend
(
yyvsp
[
-
2
].
list
,
yyvsp
[
0
].
range
);
;
break
;}
case
514
:
#line 29
94
"gram.y"
#line 29
83
"gram.y"
{
elog
(
ERROR
,
"CROSS JOIN not yet implemented"
);
;
break
;}
case
515
:
#line 29
96
"gram.y"
#line 29
85
"gram.y"
{
yyval
.
list
=
lcons
(
yyvsp
[
0
].
range
,
NIL
);
;
break
;}
case
516
:
#line
3000
"gram.y"
#line
2989
"gram.y"
{
yyval
.
range
=
makeNode
(
RangeVar
);
yyval
.
range
->
relExpr
=
yyvsp
[
-
2
].
relexp
;
...
...
@@ -8193,7 +8182,7 @@ case 516:
;
break
;}
case
517
:
#line
3006
"gram.y"
#line
2995
"gram.y"
{
yyval
.
range
=
makeNode
(
RangeVar
);
yyval
.
range
->
relExpr
=
yyvsp
[
-
1
].
relexp
;
...
...
@@ -8201,7 +8190,7 @@ case 517:
;
break
;}
case
518
:
#line 30
12
"gram.y"
#line 30
01
"gram.y"
{
yyval
.
range
=
makeNode
(
RangeVar
);
yyval
.
range
->
relExpr
=
yyvsp
[
0
].
relexp
;
...
...
@@ -8209,67 +8198,67 @@ case 518:
;
break
;}
case
519
:
#line 30
19
"gram.y"
#line 30
08
"gram.y"
{
yyval
.
str
=
NULL
;
;
break
;}
case
520
:
#line 30
21
"gram.y"
#line 30
10
"gram.y"
{
elog
(
ERROR
,
"FULL OUTER JOIN not yet implemented"
);
;
break
;}
case
521
:
#line 30
23
"gram.y"
#line 30
12
"gram.y"
{
elog
(
ERROR
,
"LEFT OUTER JOIN not yet implemented"
);
;
break
;}
case
522
:
#line 30
25
"gram.y"
#line 30
14
"gram.y"
{
elog
(
ERROR
,
"RIGHT OUTER JOIN not yet implemented"
);
;
break
;}
case
523
:
#line 30
27
"gram.y"
#line 30
16
"gram.y"
{
elog
(
ERROR
,
"OUTER JOIN not yet implemented"
);
;
break
;}
case
524
:
#line 30
29
"gram.y"
#line 30
18
"gram.y"
{
elog
(
ERROR
,
"INNER JOIN not yet implemented"
);
;
break
;}
case
525
:
#line 30
31
"gram.y"
#line 30
20
"gram.y"
{
elog
(
ERROR
,
"UNION JOIN not yet implemented"
);
;
break
;}
case
526
:
#line 30
33
"gram.y"
#line 30
22
"gram.y"
{
elog
(
ERROR
,
"INNER JOIN not yet implemented"
);
;
break
;}
case
527
:
#line 30
36
"gram.y"
#line 30
25
"gram.y"
{
yyval
.
str
=
NULL
;
;
break
;}
case
528
:
#line 30
37
"gram.y"
#line 30
26
"gram.y"
{
yyval
.
str
=
NULL
;
/* no qualifiers */
;
break
;}
case
529
:
#line 30
40
"gram.y"
#line 30
29
"gram.y"
{
yyval
.
str
=
NULL
;
;
break
;}
case
530
:
#line 30
41
"gram.y"
#line 30
30
"gram.y"
{
yyval
.
str
=
NULL
;
;
break
;}
case
531
:
#line 30
42
"gram.y"
#line 30
31
"gram.y"
{
yyval
.
str
=
NULL
;
/* no qualifiers */
;
break
;}
case
532
:
#line 30
45
"gram.y"
#line 30
34
"gram.y"
{
yyval
.
list
=
lcons
(
yyvsp
[
0
].
joinusing
,
NIL
);
;
break
;}
case
533
:
#line 30
46
"gram.y"
#line 30
35
"gram.y"
{
yyval
.
list
=
lappend
(
yyvsp
[
-
2
].
list
,
yyvsp
[
0
].
joinusing
);
;
break
;}
case
534
:
#line 30
58
"gram.y"
#line 30
47
"gram.y"
{
yyval
.
joinusing
=
makeNode
(
JoinUsing
);
yyval
.
joinusing
->
resno
=
0
;
...
...
@@ -8278,7 +8267,7 @@ case 534:
;
break
;}
case
535
:
#line 30
65
"gram.y"
#line 30
54
"gram.y"
{
yyval
.
joinusing
=
makeNode
(
JoinUsing
);
yyval
.
joinusing
->
resno
=
0
;
...
...
@@ -8287,7 +8276,7 @@ case 535:
;
break
;}
case
536
:
#line 30
72
"gram.y"
#line 30
61
"gram.y"
{
yyval
.
joinusing
=
makeNode
(
JoinUsing
);
yyval
.
joinusing
->
resno
=
yyvsp
[
0
].
ival
;
...
...
@@ -8296,15 +8285,15 @@ case 536:
;
break
;}
case
537
:
#line 30
80
"gram.y"
#line 30
69
"gram.y"
{
yyval
.
node
=
yyvsp
[
0
].
node
;
;
break
;}
case
538
:
#line 30
81
"gram.y"
#line 30
70
"gram.y"
{
yyval
.
node
=
NULL
;
/* no qualifiers */
;
break
;}
case
539
:
#line 30
85
"gram.y"
#line 30
74
"gram.y"
{
/* normal relations */
yyval
.
relexp
=
makeNode
(
RelExpr
);
...
...
@@ -8313,7 +8302,7 @@ case 539:
;
break
;}
case
540
:
#line 30
92
"gram.y"
#line 30
81
"gram.y"
{
/* inheritance query */
yyval
.
relexp
=
makeNode
(
RelExpr
);
...
...
@@ -8322,31 +8311,31 @@ case 540:
;
break
;}
case
541
:
#line 3
100
"gram.y"
#line 3
089
"gram.y"
{
yyval
.
list
=
lcons
(
makeInteger
(
-
1
),
yyvsp
[
0
].
list
);
;
break
;}
case
542
:
#line 3
102
"gram.y"
#line 3
091
"gram.y"
{
yyval
.
list
=
lcons
(
makeInteger
(
yyvsp
[
-
2
].
ival
),
yyvsp
[
0
].
list
);
;
break
;}
case
543
:
#line 3
104
"gram.y"
#line 3
093
"gram.y"
{
yyval
.
list
=
NIL
;
;
break
;}
case
544
:
#line 3
108
"gram.y"
#line 3
097
"gram.y"
{
yyval
.
list
=
lcons
(
makeInteger
(
-
1
),
yyvsp
[
0
].
list
);
;
break
;}
case
545
:
#line 3
110
"gram.y"
#line 3
099
"gram.y"
{
yyval
.
list
=
lcons
(
makeInteger
(
yyvsp
[
-
2
].
ival
),
yyvsp
[
0
].
list
);
;
break
;}
case
546
:
#line 31
12
"gram.y"
#line 31
01
"gram.y"
{
yyval
.
list
=
NIL
;
;
break
;}
case
547
:
#line 31
27
"gram.y"
#line 31
16
"gram.y"
{
yyval
.
typnam
=
yyvsp
[
-
1
].
typnam
;
yyval
.
typnam
->
arrayBounds
=
yyvsp
[
0
].
list
;
...
...
@@ -8370,14 +8359,14 @@ case 547:
;
break
;}
case
549
:
#line 31
50
"gram.y"
#line 31
39
"gram.y"
{
yyval
.
typnam
=
yyvsp
[
0
].
typnam
;
yyval
.
typnam
->
setof
=
TRUE
;
;
break
;}
case
553
:
#line 31
62
"gram.y"
#line 31
51
"gram.y"
{
yyval
.
typnam
=
makeNode
(
TypeName
);
yyval
.
typnam
->
name
=
xlateSqlType
(
yyvsp
[
0
].
str
);
...
...
@@ -8385,15 +8374,15 @@ case 553:
;
break
;}
case
554
:
#line 31
69
"gram.y"
#line 31
58
"gram.y"
{
yyval
.
str
=
yyvsp
[
0
].
str
;
;
break
;}
case
555
:
#line 31
70
"gram.y"
#line 31
59
"gram.y"
{
yyval
.
str
=
xlateSqlType
(
"type"
);
;
break
;}
case
556
:
#line 31
79
"gram.y"
#line 31
68
"gram.y"
{
yyval
.
typnam
=
makeNode
(
TypeName
);
yyval
.
typnam
->
name
=
xlateSqlType
(
yyvsp
[
0
].
str
);
...
...
@@ -8401,14 +8390,14 @@ case 556:
;
break
;}
case
557
:
#line 31
85
"gram.y"
#line 31
74
"gram.y"
{
yyval
.
typnam
=
makeNode
(
TypeName
);
yyval
.
typnam
->
name
=
xlateSqlType
(
"float"
);
;
break
;}
case
558
:
#line 31
90
"gram.y"
#line 31
79
"gram.y"
{
yyval
.
typnam
=
makeNode
(
TypeName
);
yyval
.
typnam
->
name
=
xlateSqlType
(
"numeric"
);
...
...
@@ -8416,7 +8405,7 @@ case 558:
;
break
;}
case
559
:
#line 31
96
"gram.y"
#line 31
85
"gram.y"
{
yyval
.
typnam
=
makeNode
(
TypeName
);
yyval
.
typnam
->
name
=
xlateSqlType
(
"numeric"
);
...
...
@@ -8424,23 +8413,23 @@ case 559:
;
break
;}
case
560
:
#line 3
204
"gram.y"
#line 3
193
"gram.y"
{
yyval
.
str
=
xlateSqlType
(
"float8"
);
;
break
;}
case
561
:
#line 3
206
"gram.y"
#line 3
195
"gram.y"
{
yyval
.
str
=
xlateSqlType
(
"float8"
);
;
break
;}
case
562
:
#line 3
208
"gram.y"
#line 3
197
"gram.y"
{
yyval
.
str
=
xlateSqlType
(
"numeric"
);
;
break
;}
case
563
:
#line 3
210
"gram.y"
#line 3
199
"gram.y"
{
yyval
.
str
=
xlateSqlType
(
"numeric"
);
;
break
;}
case
564
:
#line 32
14
"gram.y"
#line 32
03
"gram.y"
{
if
(
yyvsp
[
-
1
].
ival
<
1
)
elog
(
ERROR
,
"precision for FLOAT must be at least 1"
);
...
...
@@ -8453,13 +8442,13 @@ case 564:
;
break
;}
case
565
:
#line 32
25
"gram.y"
#line 32
14
"gram.y"
{
yyval
.
str
=
xlateSqlType
(
"float8"
);
;
break
;}
case
566
:
#line 32
31
"gram.y"
#line 32
20
"gram.y"
{
if
(
yyvsp
[
-
3
].
ival
<
1
||
yyvsp
[
-
3
].
ival
>
NUMERIC_MAX_PRECISION
)
elog
(
ERROR
,
"NUMERIC precision %d must be beween 1 and %d"
,
...
...
@@ -8472,7 +8461,7 @@ case 566:
;
break
;}
case
567
:
#line 32
42
"gram.y"
#line 32
31
"gram.y"
{
if
(
yyvsp
[
-
1
].
ival
<
1
||
yyvsp
[
-
1
].
ival
>
NUMERIC_MAX_PRECISION
)
elog
(
ERROR
,
"NUMERIC precision %d must be beween 1 and %d"
,
...
...
@@ -8482,13 +8471,13 @@ case 567:
;
break
;}
case
568
:
#line 32
50
"gram.y"
#line 32
39
"gram.y"
{
yyval
.
ival
=
((
NUMERIC_DEFAULT_PRECISION
<<
16
)
|
NUMERIC_DEFAULT_SCALE
)
+
VARHDRSZ
;
;
break
;}
case
569
:
#line 32
56
"gram.y"
#line 32
45
"gram.y"
{
if
(
yyvsp
[
-
3
].
ival
<
1
||
yyvsp
[
-
3
].
ival
>
NUMERIC_MAX_PRECISION
)
elog
(
ERROR
,
"DECIMAL precision %d must be beween 1 and %d"
,
...
...
@@ -8501,7 +8490,7 @@ case 569:
;
break
;}
case
570
:
#line 32
67
"gram.y"
#line 32
56
"gram.y"
{
if
(
yyvsp
[
-
1
].
ival
<
1
||
yyvsp
[
-
1
].
ival
>
NUMERIC_MAX_PRECISION
)
elog
(
ERROR
,
"DECIMAL precision %d must be beween 1 and %d"
,
...
...
@@ -8511,13 +8500,13 @@ case 570:
;
break
;}
case
571
:
#line 32
75
"gram.y"
#line 32
64
"gram.y"
{
yyval
.
ival
=
((
NUMERIC_DEFAULT_PRECISION
<<
16
)
|
NUMERIC_DEFAULT_SCALE
)
+
VARHDRSZ
;
;
break
;}
case
572
:
#line 32
89
"gram.y"
#line 32
78
"gram.y"
{
yyval
.
typnam
=
makeNode
(
TypeName
);
if
(
strcasecmp
(
yyvsp
[
-
3
].
str
,
"char"
)
==
0
)
...
...
@@ -8546,7 +8535,7 @@ case 572:
;
break
;}
case
573
:
#line 33
16
"gram.y"
#line 33
05
"gram.y"
{
yyval
.
typnam
=
makeNode
(
TypeName
);
/* Let's try to make all single-character types into bpchar(1)
...
...
@@ -8565,7 +8554,7 @@ case 573:
;
break
;}
case
574
:
#line 33
35
"gram.y"
#line 33
24
"gram.y"
{
char
*
type
,
*
c
;
if
((
yyvsp
[
-
1
].
str
==
NULL
)
||
(
strcasecmp
(
yyvsp
[
-
1
].
str
,
"sql_text"
)
==
0
))
{
...
...
@@ -8587,47 +8576,47 @@ case 574:
;
break
;}
case
575
:
#line 33
54
"gram.y"
#line 33
43
"gram.y"
{
yyval
.
str
=
xlateSqlType
(
yyvsp
[
0
].
boolean
?
"varchar"
:
"char"
);
;
break
;}
case
576
:
#line 33
55
"gram.y"
#line 33
44
"gram.y"
{
yyval
.
str
=
xlateSqlType
(
"varchar"
);
;
break
;}
case
577
:
#line 33
56
"gram.y"
#line 33
45
"gram.y"
{
yyval
.
str
=
xlateSqlType
(
yyvsp
[
0
].
boolean
?
"varchar"
:
"char"
);
;
break
;}
case
578
:
#line 33
57
"gram.y"
#line 33
46
"gram.y"
{
yyval
.
str
=
xlateSqlType
(
yyvsp
[
0
].
boolean
?
"varchar"
:
"char"
);
;
break
;}
case
579
:
#line 33
60
"gram.y"
#line 33
49
"gram.y"
{
yyval
.
boolean
=
TRUE
;
;
break
;}
case
580
:
#line 33
61
"gram.y"
#line 33
50
"gram.y"
{
yyval
.
boolean
=
FALSE
;
;
break
;}
case
581
:
#line 33
64
"gram.y"
#line 33
53
"gram.y"
{
yyval
.
str
=
yyvsp
[
0
].
str
;
;
break
;}
case
582
:
#line 33
65
"gram.y"
#line 33
54
"gram.y"
{
yyval
.
str
=
NULL
;
;
break
;}
case
583
:
#line 33
68
"gram.y"
#line 33
57
"gram.y"
{
yyval
.
str
=
yyvsp
[
0
].
str
;
;
break
;}
case
584
:
#line 33
69
"gram.y"
#line 33
58
"gram.y"
{
yyval
.
str
=
NULL
;
;
break
;}
case
585
:
#line 33
73
"gram.y"
#line 33
62
"gram.y"
{
yyval
.
typnam
=
makeNode
(
TypeName
);
yyval
.
typnam
->
name
=
xlateSqlType
(
yyvsp
[
0
].
str
);
...
...
@@ -8635,7 +8624,7 @@ case 585:
;
break
;}
case
586
:
#line 33
79
"gram.y"
#line 33
68
"gram.y"
{
yyval
.
typnam
=
makeNode
(
TypeName
);
yyval
.
typnam
->
name
=
xlateSqlType
(
"timestamp"
);
...
...
@@ -8644,7 +8633,7 @@ case 586:
;
break
;}
case
587
:
#line 33
86
"gram.y"
#line 33
75
"gram.y"
{
yyval
.
typnam
=
makeNode
(
TypeName
);
yyval
.
typnam
->
name
=
xlateSqlType
(
"time"
);
...
...
@@ -8652,7 +8641,7 @@ case 587:
;
break
;}
case
588
:
#line 33
92
"gram.y"
#line 33
81
"gram.y"
{
yyval
.
typnam
=
makeNode
(
TypeName
);
yyval
.
typnam
->
name
=
xlateSqlType
(
"interval"
);
...
...
@@ -8660,79 +8649,79 @@ case 588:
;
break
;}
case
589
:
#line 33
99
"gram.y"
#line 33
88
"gram.y"
{
yyval
.
str
=
"year"
;
;
break
;}
case
590
:
#line 3
400
"gram.y"
#line 3
389
"gram.y"
{
yyval
.
str
=
"month"
;
;
break
;}
case
591
:
#line 3
401
"gram.y"
#line 3
390
"gram.y"
{
yyval
.
str
=
"day"
;
;
break
;}
case
592
:
#line 3
402
"gram.y"
#line 3
391
"gram.y"
{
yyval
.
str
=
"hour"
;
;
break
;}
case
593
:
#line 3
403
"gram.y"
#line 3
392
"gram.y"
{
yyval
.
str
=
"minute"
;
;
break
;}
case
594
:
#line 3
404
"gram.y"
#line 3
393
"gram.y"
{
yyval
.
str
=
"second"
;
;
break
;}
case
595
:
#line 3
407
"gram.y"
#line 3
396
"gram.y"
{
yyval
.
boolean
=
TRUE
;
;
break
;}
case
596
:
#line 3
408
"gram.y"
#line 3
397
"gram.y"
{
yyval
.
boolean
=
FALSE
;
;
break
;}
case
597
:
#line 34
11
"gram.y"
#line 34
00
"gram.y"
{
yyval
.
list
=
lcons
(
yyvsp
[
0
].
str
,
NIL
);
;
break
;}
case
598
:
#line 34
12
"gram.y"
#line 34
01
"gram.y"
{
yyval
.
list
=
NIL
;
;
break
;}
case
599
:
#line 34
13
"gram.y"
#line 34
02
"gram.y"
{
yyval
.
list
=
NIL
;
;
break
;}
case
600
:
#line 34
14
"gram.y"
#line 34
03
"gram.y"
{
yyval
.
list
=
NIL
;
;
break
;}
case
601
:
#line 34
15
"gram.y"
#line 34
04
"gram.y"
{
yyval
.
list
=
NIL
;
;
break
;}
case
602
:
#line 34
16
"gram.y"
#line 34
05
"gram.y"
{
yyval
.
list
=
NIL
;
;
break
;}
case
603
:
#line 34
17
"gram.y"
#line 34
06
"gram.y"
{
yyval
.
list
=
NIL
;
;
break
;}
case
604
:
#line 34
18
"gram.y"
#line 34
07
"gram.y"
{
yyval
.
list
=
NIL
;
;
break
;}
case
605
:
#line 34
19
"gram.y"
#line 34
08
"gram.y"
{
yyval
.
list
=
NIL
;
;
break
;}
case
606
:
#line 34
30
"gram.y"
#line 34
19
"gram.y"
{
yyval
.
node
=
yyvsp
[
0
].
node
;
;
break
;}
case
607
:
#line 34
32
"gram.y"
#line 34
21
"gram.y"
{
A_Const
*
n
=
makeNode
(
A_Const
);
n
->
val
.
type
=
T_Null
;
...
...
@@ -8740,7 +8729,7 @@ case 607:
;
break
;}
case
608
:
#line 34
49
"gram.y"
#line 34
38
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
yyvsp
[
-
5
].
list
;
...
...
@@ -8752,7 +8741,7 @@ case 608:
;
break
;}
case
609
:
#line 34
59
"gram.y"
#line 34
48
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
yyvsp
[
-
6
].
list
;
...
...
@@ -8764,7 +8753,7 @@ case 609:
;
break
;}
case
610
:
#line 34
69
"gram.y"
#line 34
58
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
yyvsp
[
-
6
].
list
;
...
...
@@ -8779,7 +8768,7 @@ case 610:
;
break
;}
case
611
:
#line 34
82
"gram.y"
#line 34
71
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
yyvsp
[
-
5
].
list
;
...
...
@@ -8794,86 +8783,86 @@ case 611:
;
break
;}
case
612
:
#line 34
95
"gram.y"
#line 34
84
"gram.y"
{
yyval
.
node
=
makeRowExpr
(
yyvsp
[
-
3
].
str
,
yyvsp
[
-
5
].
list
,
yyvsp
[
-
1
].
list
);
;
break
;}
case
613
:
#line 3
501
"gram.y"
#line 3
490
"gram.y"
{
yyval
.
list
=
lappend
(
yyvsp
[
-
2
].
list
,
yyvsp
[
0
].
node
);
;
break
;}
case
614
:
#line 3
507
"gram.y"
#line 3
496
"gram.y"
{
yyval
.
list
=
lappend
(
yyvsp
[
-
2
].
list
,
yyvsp
[
0
].
node
);
;
break
;}
case
615
:
#line 35
11
"gram.y"
#line 35
00
"gram.y"
{
yyval
.
list
=
lcons
(
yyvsp
[
0
].
node
,
NIL
);
;
break
;}
case
616
:
#line 35
16
"gram.y"
#line 35
05
"gram.y"
{
yyval
.
str
=
yyvsp
[
0
].
str
;
;
break
;}
case
617
:
#line 35
17
"gram.y"
#line 35
06
"gram.y"
{
yyval
.
str
=
"<"
;
;
break
;}
case
618
:
#line 35
18
"gram.y"
#line 35
07
"gram.y"
{
yyval
.
str
=
"="
;
;
break
;}
case
619
:
#line 35
19
"gram.y"
#line 35
08
"gram.y"
{
yyval
.
str
=
">"
;
;
break
;}
case
620
:
#line 35
20
"gram.y"
#line 35
09
"gram.y"
{
yyval
.
str
=
"+"
;
;
break
;}
case
621
:
#line 35
21
"gram.y"
#line 35
10
"gram.y"
{
yyval
.
str
=
"-"
;
;
break
;}
case
622
:
#line 35
22
"gram.y"
#line 35
11
"gram.y"
{
yyval
.
str
=
"*"
;
;
break
;}
case
623
:
#line 35
23
"gram.y"
#line 35
12
"gram.y"
{
yyval
.
str
=
"/"
;
;
break
;}
case
624
:
#line 35
26
"gram.y"
#line 35
15
"gram.y"
{
yyval
.
ival
=
ANY_SUBLINK
;
;
break
;}
case
625
:
#line 35
27
"gram.y"
#line 35
16
"gram.y"
{
yyval
.
ival
=
ALL_SUBLINK
;
;
break
;}
case
626
:
#line 35
39
"gram.y"
#line 35
28
"gram.y"
{
yyvsp
[
-
1
].
attr
->
indirection
=
yyvsp
[
0
].
list
;
yyval
.
node
=
(
Node
*
)
yyvsp
[
-
1
].
attr
;
;
break
;}
case
627
:
#line 35
44
"gram.y"
#line 35
33
"gram.y"
{
yyval
.
node
=
yyvsp
[
0
].
node
;
;
break
;}
case
628
:
#line 35
46
"gram.y"
#line 35
35
"gram.y"
{
yyval
.
node
=
yyvsp
[
0
].
node
;
;
break
;}
case
629
:
#line 35
48
"gram.y"
#line 35
37
"gram.y"
{
/* could be a column name or a relation_name */
Ident
*
n
=
makeNode
(
Ident
);
...
...
@@ -8883,51 +8872,51 @@ case 629:
;
break
;}
case
630
:
#line 35
56
"gram.y"
#line 35
45
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
"-"
,
NULL
,
yyvsp
[
0
].
node
);
;
break
;}
case
631
:
#line 35
58
"gram.y"
#line 35
47
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
"+"
,
yyvsp
[
-
2
].
node
,
yyvsp
[
0
].
node
);
;
break
;}
case
632
:
#line 35
60
"gram.y"
#line 35
49
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
"-"
,
yyvsp
[
-
2
].
node
,
yyvsp
[
0
].
node
);
;
break
;}
case
633
:
#line 35
62
"gram.y"
#line 35
51
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
"/"
,
yyvsp
[
-
2
].
node
,
yyvsp
[
0
].
node
);
;
break
;}
case
634
:
#line 35
64
"gram.y"
#line 35
53
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
"*"
,
yyvsp
[
-
2
].
node
,
yyvsp
[
0
].
node
);
;
break
;}
case
635
:
#line 35
66
"gram.y"
#line 35
55
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
"<"
,
yyvsp
[
-
2
].
node
,
yyvsp
[
0
].
node
);
;
break
;}
case
636
:
#line 35
68
"gram.y"
#line 35
57
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
">"
,
yyvsp
[
-
2
].
node
,
yyvsp
[
0
].
node
);
;
break
;}
case
637
:
#line 35
70
"gram.y"
#line 35
59
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
"="
,
yyvsp
[
-
2
].
node
,
yyvsp
[
0
].
node
);
;
break
;}
case
638
:
#line 35
72
"gram.y"
#line 35
61
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
":"
,
NULL
,
yyvsp
[
0
].
node
);
;
break
;}
case
639
:
#line 35
74
"gram.y"
#line 35
63
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
";"
,
NULL
,
yyvsp
[
0
].
node
);
;
break
;}
case
640
:
#line 35
76
"gram.y"
#line 35
65
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
"|"
,
NULL
,
yyvsp
[
0
].
node
);
;
break
;}
case
641
:
#line 35
78
"gram.y"
#line 35
67
"gram.y"
{
yyval
.
node
=
(
Node
*
)
yyvsp
[
-
2
].
node
;
/* AexprConst can be either A_Const or ParamNo */
...
...
@@ -8945,7 +8934,7 @@ case 641:
;
break
;}
case
642
:
#line 35
94
"gram.y"
#line 35
83
"gram.y"
{
yyval
.
node
=
(
Node
*
)
yyvsp
[
-
3
].
node
;
/* AexprConst can be either A_Const or ParamNo */
...
...
@@ -8963,31 +8952,31 @@ case 642:
;
break
;}
case
643
:
#line 3
610
"gram.y"
#line 3
599
"gram.y"
{
yyval
.
node
=
yyvsp
[
-
1
].
node
;
;
break
;}
case
644
:
#line 36
12
"gram.y"
#line 36
01
"gram.y"
{
yyval
.
node
=
makeIndexable
(
yyvsp
[
-
1
].
str
,
yyvsp
[
-
2
].
node
,
yyvsp
[
0
].
node
);
;
break
;}
case
645
:
#line 36
14
"gram.y"
#line 36
03
"gram.y"
{
yyval
.
node
=
makeIndexable
(
"~~"
,
yyvsp
[
-
2
].
node
,
yyvsp
[
0
].
node
);
;
break
;}
case
646
:
#line 36
16
"gram.y"
#line 36
05
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
"!~~"
,
yyvsp
[
-
3
].
node
,
yyvsp
[
0
].
node
);
;
break
;}
case
647
:
#line 36
18
"gram.y"
#line 36
07
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
yyvsp
[
-
1
].
str
,
NULL
,
yyvsp
[
0
].
node
);
;
break
;}
case
648
:
#line 36
20
"gram.y"
#line 36
09
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
yyvsp
[
0
].
str
,
yyvsp
[
-
1
].
node
,
NULL
);
;
break
;}
case
649
:
#line 36
22
"gram.y"
#line 36
11
"gram.y"
{
/* cheap hack for aggregate (eg. count) */
FuncCall
*
n
=
makeNode
(
FuncCall
);
...
...
@@ -9001,7 +8990,7 @@ case 649:
;
break
;}
case
650
:
#line 36
34
"gram.y"
#line 36
23
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
yyvsp
[
-
2
].
str
;
...
...
@@ -9010,7 +8999,7 @@ case 650:
;
break
;}
case
651
:
#line 36
41
"gram.y"
#line 36
30
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
yyvsp
[
-
3
].
str
;
...
...
@@ -9019,7 +9008,7 @@ case 651:
;
break
;}
case
652
:
#line 36
48
"gram.y"
#line 36
37
"gram.y"
{
A_Const
*
n
=
makeNode
(
A_Const
);
TypeName
*
t
=
makeNode
(
TypeName
);
...
...
@@ -9036,7 +9025,7 @@ case 652:
;
break
;}
case
653
:
#line 36
63
"gram.y"
#line 36
52
"gram.y"
{
A_Const
*
n
=
makeNode
(
A_Const
);
TypeName
*
t
=
makeNode
(
TypeName
);
...
...
@@ -9053,7 +9042,7 @@ case 653:
;
break
;}
case
654
:
#line 36
78
"gram.y"
#line 36
67
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
A_Const
*
s
=
makeNode
(
A_Const
);
...
...
@@ -9077,7 +9066,7 @@ case 654:
;
break
;}
case
655
:
#line 3
700
"gram.y"
#line 3
689
"gram.y"
{
A_Const
*
n
=
makeNode
(
A_Const
);
TypeName
*
t
=
makeNode
(
TypeName
);
...
...
@@ -9094,7 +9083,7 @@ case 655:
;
break
;}
case
656
:
#line 37
15
"gram.y"
#line 37
04
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
A_Const
*
s
=
makeNode
(
A_Const
);
...
...
@@ -9118,7 +9107,7 @@ case 656:
;
break
;}
case
657
:
#line 37
37
"gram.y"
#line 37
26
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
"getpgusername"
;
...
...
@@ -9127,7 +9116,7 @@ case 657:
;
break
;}
case
658
:
#line 37
44
"gram.y"
#line 37
33
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
"getpgusername"
;
...
...
@@ -9136,7 +9125,7 @@ case 658:
;
break
;}
case
659
:
#line 37
51
"gram.y"
#line 37
40
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
NIL
;
...
...
@@ -9148,7 +9137,7 @@ case 659:
;
break
;}
case
660
:
#line 37
61
"gram.y"
#line 37
50
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
"date_part"
;
...
...
@@ -9157,7 +9146,7 @@ case 660:
;
break
;}
case
661
:
#line 37
68
"gram.y"
#line 37
57
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
"strpos"
;
...
...
@@ -9166,7 +9155,7 @@ case 661:
;
break
;}
case
662
:
#line 37
75
"gram.y"
#line 37
64
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
"substr"
;
...
...
@@ -9175,7 +9164,7 @@ case 662:
;
break
;}
case
663
:
#line 37
83
"gram.y"
#line 37
72
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
"btrim"
;
...
...
@@ -9184,7 +9173,7 @@ case 663:
;
break
;}
case
664
:
#line 37
90
"gram.y"
#line 37
79
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
"ltrim"
;
...
...
@@ -9193,7 +9182,7 @@ case 664:
;
break
;}
case
665
:
#line 37
97
"gram.y"
#line 37
86
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
"rtrim"
;
...
...
@@ -9202,7 +9191,7 @@ case 665:
;
break
;}
case
666
:
#line 3
804
"gram.y"
#line 3
793
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
"btrim"
;
...
...
@@ -9211,23 +9200,23 @@ case 666:
;
break
;}
case
667
:
#line 38
11
"gram.y"
#line 38
00
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
ISNULL
,
NULL
,
yyvsp
[
-
1
].
node
,
NULL
);
;
break
;}
case
668
:
#line 38
13
"gram.y"
#line 38
02
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
ISNULL
,
NULL
,
yyvsp
[
-
2
].
node
,
NULL
);
;
break
;}
case
669
:
#line 38
15
"gram.y"
#line 38
04
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
NOTNULL
,
NULL
,
yyvsp
[
-
1
].
node
,
NULL
);
;
break
;}
case
670
:
#line 38
17
"gram.y"
#line 38
06
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
NOTNULL
,
NULL
,
yyvsp
[
-
3
].
node
,
NULL
);
;
break
;}
case
671
:
#line 38
24
"gram.y"
#line 38
13
"gram.y"
{
A_Const
*
n
=
makeNode
(
A_Const
);
n
->
val
.
type
=
T_String
;
...
...
@@ -9239,7 +9228,7 @@ case 671:
;
break
;}
case
672
:
#line 38
34
"gram.y"
#line 38
23
"gram.y"
{
A_Const
*
n
=
makeNode
(
A_Const
);
n
->
val
.
type
=
T_String
;
...
...
@@ -9251,7 +9240,7 @@ case 672:
;
break
;}
case
673
:
#line 38
44
"gram.y"
#line 38
33
"gram.y"
{
A_Const
*
n
=
makeNode
(
A_Const
);
n
->
val
.
type
=
T_String
;
...
...
@@ -9263,7 +9252,7 @@ case 673:
;
break
;}
case
674
:
#line 38
54
"gram.y"
#line 38
43
"gram.y"
{
A_Const
*
n
=
makeNode
(
A_Const
);
n
->
val
.
type
=
T_String
;
...
...
@@ -9275,7 +9264,7 @@ case 674:
;
break
;}
case
675
:
#line 38
64
"gram.y"
#line 38
53
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
AND
,
NULL
,
makeA_Expr
(
OP
,
">="
,
yyvsp
[
-
4
].
node
,
yyvsp
[
-
2
].
node
),
...
...
@@ -9283,7 +9272,7 @@ case 675:
;
break
;}
case
676
:
#line 38
70
"gram.y"
#line 38
59
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OR
,
NULL
,
makeA_Expr
(
OP
,
"<"
,
yyvsp
[
-
5
].
node
,
yyvsp
[
-
2
].
node
),
...
...
@@ -9291,11 +9280,11 @@ case 676:
;
break
;}
case
677
:
#line 38
75
"gram.y"
#line 38
64
"gram.y"
{
saved_In_Expr
=
lcons
(
yyvsp
[
-
1
].
node
,
saved_In_Expr
);
;
break
;}
case
678
:
#line 38
76
"gram.y"
#line 38
65
"gram.y"
{
saved_In_Expr
=
lnext
(
saved_In_Expr
);
if
(
nodeTag
(
yyvsp
[
-
1
].
node
)
==
T_SubLink
)
...
...
@@ -9311,11 +9300,11 @@ case 678:
;
break
;}
case
679
:
#line 38
89
"gram.y"
#line 38
78
"gram.y"
{
saved_In_Expr
=
lcons
(
yyvsp
[
-
2
].
node
,
saved_In_Expr
);
;
break
;}
case
680
:
#line 38
90
"gram.y"
#line 38
79
"gram.y"
{
saved_In_Expr
=
lnext
(
saved_In_Expr
);
if
(
nodeTag
(
yyvsp
[
-
1
].
node
)
==
T_SubLink
)
...
...
@@ -9331,7 +9320,7 @@ case 680:
;
break
;}
case
681
:
#line 3
904
"gram.y"
#line 3
893
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
lcons
(
yyvsp
[
-
4
].
node
,
NULL
);
...
...
@@ -9343,7 +9332,7 @@ case 681:
;
break
;}
case
682
:
#line 39
14
"gram.y"
#line 39
03
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
lcons
(
yyvsp
[
-
4
].
node
,
NULL
);
...
...
@@ -9355,7 +9344,7 @@ case 682:
;
break
;}
case
683
:
#line 39
24
"gram.y"
#line 39
13
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
lcons
(
yyvsp
[
-
4
].
node
,
NULL
);
...
...
@@ -9367,7 +9356,7 @@ case 683:
;
break
;}
case
684
:
#line 39
34
"gram.y"
#line 39
23
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
lcons
(
yyvsp
[
-
4
].
node
,
NULL
);
...
...
@@ -9379,7 +9368,7 @@ case 684:
;
break
;}
case
685
:
#line 39
44
"gram.y"
#line 39
33
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
lcons
(
yyvsp
[
-
4
].
node
,
NULL
);
...
...
@@ -9391,7 +9380,7 @@ case 685:
;
break
;}
case
686
:
#line 39
54
"gram.y"
#line 39
43
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
lcons
(
yyvsp
[
-
4
].
node
,
NULL
);
...
...
@@ -9403,7 +9392,7 @@ case 686:
;
break
;}
case
687
:
#line 39
64
"gram.y"
#line 39
53
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
lcons
(
yyvsp
[
-
4
].
node
,
NULL
);
...
...
@@ -9415,7 +9404,7 @@ case 687:
;
break
;}
case
688
:
#line 39
74
"gram.y"
#line 39
63
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
lcons
(
yyvsp
[
-
4
].
node
,
NULL
);
...
...
@@ -9427,7 +9416,7 @@ case 688:
;
break
;}
case
689
:
#line 39
84
"gram.y"
#line 39
73
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
lcons
(
yyvsp
[
-
5
].
node
,
NIL
);
...
...
@@ -9439,7 +9428,7 @@ case 689:
;
break
;}
case
690
:
#line 39
94
"gram.y"
#line 39
83
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
lcons
(
yyvsp
[
-
5
].
node
,
NIL
);
...
...
@@ -9451,7 +9440,7 @@ case 690:
;
break
;}
case
691
:
#line
4004
"gram.y"
#line
3993
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
lcons
(
yyvsp
[
-
5
].
node
,
NIL
);
...
...
@@ -9463,7 +9452,7 @@ case 691:
;
break
;}
case
692
:
#line 40
14
"gram.y"
#line 40
03
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
lcons
(
yyvsp
[
-
5
].
node
,
NIL
);
...
...
@@ -9475,7 +9464,7 @@ case 692:
;
break
;}
case
693
:
#line 40
24
"gram.y"
#line 40
13
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
lcons
(
yyvsp
[
-
5
].
node
,
NIL
);
...
...
@@ -9487,7 +9476,7 @@ case 693:
;
break
;}
case
694
:
#line 40
34
"gram.y"
#line 40
23
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
lcons
(
yyvsp
[
-
5
].
node
,
NIL
);
...
...
@@ -9499,7 +9488,7 @@ case 694:
;
break
;}
case
695
:
#line 40
44
"gram.y"
#line 40
33
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
lcons
(
yyvsp
[
-
5
].
node
,
NIL
);
...
...
@@ -9511,7 +9500,7 @@ case 695:
;
break
;}
case
696
:
#line 40
54
"gram.y"
#line 40
43
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
lcons
(
yyvsp
[
-
5
].
node
,
NIL
);
...
...
@@ -9523,7 +9512,7 @@ case 696:
;
break
;}
case
697
:
#line 40
64
"gram.y"
#line 40
53
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
lcons
(
yyvsp
[
-
5
].
node
,
NULL
);
...
...
@@ -9535,7 +9524,7 @@ case 697:
;
break
;}
case
698
:
#line 40
74
"gram.y"
#line 40
63
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
lcons
(
yyvsp
[
-
5
].
node
,
NULL
);
...
...
@@ -9547,7 +9536,7 @@ case 698:
;
break
;}
case
699
:
#line 40
84
"gram.y"
#line 40
73
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
lcons
(
yyvsp
[
-
5
].
node
,
NULL
);
...
...
@@ -9559,7 +9548,7 @@ case 699:
;
break
;}
case
700
:
#line 40
94
"gram.y"
#line 40
83
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
lcons
(
yyvsp
[
-
5
].
node
,
NULL
);
...
...
@@ -9571,7 +9560,7 @@ case 700:
;
break
;}
case
701
:
#line 4
104
"gram.y"
#line 4
093
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
lcons
(
yyvsp
[
-
5
].
node
,
NULL
);
...
...
@@ -9583,7 +9572,7 @@ case 701:
;
break
;}
case
702
:
#line 41
14
"gram.y"
#line 41
03
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
lcons
(
yyvsp
[
-
5
].
node
,
NULL
);
...
...
@@ -9595,7 +9584,7 @@ case 702:
;
break
;}
case
703
:
#line 41
24
"gram.y"
#line 41
13
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
lcons
(
yyvsp
[
-
5
].
node
,
NULL
);
...
...
@@ -9607,7 +9596,7 @@ case 703:
;
break
;}
case
704
:
#line 41
34
"gram.y"
#line 41
23
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
lefthand
=
lcons
(
yyvsp
[
-
5
].
node
,
NULL
);
...
...
@@ -9619,34 +9608,34 @@ case 704:
;
break
;}
case
705
:
#line 41
44
"gram.y"
#line 41
33
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
AND
,
NULL
,
yyvsp
[
-
2
].
node
,
yyvsp
[
0
].
node
);
;
break
;}
case
706
:
#line 41
46
"gram.y"
#line 41
35
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OR
,
NULL
,
yyvsp
[
-
2
].
node
,
yyvsp
[
0
].
node
);
;
break
;}
case
707
:
#line 41
48
"gram.y"
#line 41
37
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
NOT
,
NULL
,
NULL
,
yyvsp
[
0
].
node
);
;
break
;}
case
708
:
#line 41
50
"gram.y"
#line 41
39
"gram.y"
{
yyval
.
node
=
yyvsp
[
0
].
node
;
;
break
;}
case
709
:
#line 41
59
"gram.y"
#line 41
48
"gram.y"
{
yyvsp
[
-
1
].
attr
->
indirection
=
yyvsp
[
0
].
list
;
yyval
.
node
=
(
Node
*
)
yyvsp
[
-
1
].
attr
;
;
break
;}
case
710
:
#line 41
64
"gram.y"
#line 41
53
"gram.y"
{
yyval
.
node
=
yyvsp
[
0
].
node
;
;
break
;}
case
711
:
#line 41
66
"gram.y"
#line 41
55
"gram.y"
{
/* could be a column name or a relation_name */
Ident
*
n
=
makeNode
(
Ident
);
...
...
@@ -9656,39 +9645,39 @@ case 711:
;
break
;}
case
712
:
#line 41
74
"gram.y"
#line 41
63
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
"-"
,
NULL
,
yyvsp
[
0
].
node
);
;
break
;}
case
713
:
#line 41
76
"gram.y"
#line 41
65
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
"+"
,
yyvsp
[
-
2
].
node
,
yyvsp
[
0
].
node
);
;
break
;}
case
714
:
#line 41
78
"gram.y"
#line 41
67
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
"-"
,
yyvsp
[
-
2
].
node
,
yyvsp
[
0
].
node
);
;
break
;}
case
715
:
#line 41
80
"gram.y"
#line 41
69
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
"/"
,
yyvsp
[
-
2
].
node
,
yyvsp
[
0
].
node
);
;
break
;}
case
716
:
#line 41
82
"gram.y"
#line 41
71
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
"*"
,
yyvsp
[
-
2
].
node
,
yyvsp
[
0
].
node
);
;
break
;}
case
717
:
#line 41
84
"gram.y"
#line 41
73
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
":"
,
NULL
,
yyvsp
[
0
].
node
);
;
break
;}
case
718
:
#line 41
86
"gram.y"
#line 41
75
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
";"
,
NULL
,
yyvsp
[
0
].
node
);
;
break
;}
case
719
:
#line 41
88
"gram.y"
#line 41
77
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
"|"
,
NULL
,
yyvsp
[
0
].
node
);
;
break
;}
case
720
:
#line 41
90
"gram.y"
#line 41
79
"gram.y"
{
yyval
.
node
=
(
Node
*
)
yyvsp
[
-
2
].
node
;
/* AexprConst can be either A_Const or ParamNo */
...
...
@@ -9706,7 +9695,7 @@ case 720:
;
break
;}
case
721
:
#line 4
206
"gram.y"
#line 4
195
"gram.y"
{
yyval
.
node
=
(
Node
*
)
yyvsp
[
-
3
].
node
;
/* AexprConst can be either A_Const or ParamNo */
...
...
@@ -9724,23 +9713,23 @@ case 721:
;
break
;}
case
722
:
#line 42
22
"gram.y"
#line 42
11
"gram.y"
{
yyval
.
node
=
yyvsp
[
-
1
].
node
;
;
break
;}
case
723
:
#line 42
24
"gram.y"
#line 42
13
"gram.y"
{
yyval
.
node
=
makeIndexable
(
yyvsp
[
-
1
].
str
,
yyvsp
[
-
2
].
node
,
yyvsp
[
0
].
node
);
;
break
;}
case
724
:
#line 42
26
"gram.y"
#line 42
15
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
yyvsp
[
-
1
].
str
,
NULL
,
yyvsp
[
0
].
node
);
;
break
;}
case
725
:
#line 42
28
"gram.y"
#line 42
17
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
yyvsp
[
0
].
str
,
yyvsp
[
-
1
].
node
,
NULL
);
;
break
;}
case
726
:
#line 42
30
"gram.y"
#line 42
19
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
yyvsp
[
-
2
].
str
;
...
...
@@ -9749,7 +9738,7 @@ case 726:
;
break
;}
case
727
:
#line 42
37
"gram.y"
#line 42
26
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
yyvsp
[
-
3
].
str
;
...
...
@@ -9758,7 +9747,7 @@ case 727:
;
break
;}
case
728
:
#line 42
44
"gram.y"
#line 42
33
"gram.y"
{
A_Const
*
n
=
makeNode
(
A_Const
);
TypeName
*
t
=
makeNode
(
TypeName
);
...
...
@@ -9775,7 +9764,7 @@ case 728:
;
break
;}
case
729
:
#line 42
59
"gram.y"
#line 42
48
"gram.y"
{
A_Const
*
n
=
makeNode
(
A_Const
);
TypeName
*
t
=
makeNode
(
TypeName
);
...
...
@@ -9792,7 +9781,7 @@ case 729:
;
break
;}
case
730
:
#line 42
74
"gram.y"
#line 42
63
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
A_Const
*
s
=
makeNode
(
A_Const
);
...
...
@@ -9816,7 +9805,7 @@ case 730:
;
break
;}
case
731
:
#line 42
96
"gram.y"
#line 42
85
"gram.y"
{
A_Const
*
n
=
makeNode
(
A_Const
);
TypeName
*
t
=
makeNode
(
TypeName
);
...
...
@@ -9833,7 +9822,7 @@ case 731:
;
break
;}
case
732
:
#line 43
11
"gram.y"
#line 43
00
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
A_Const
*
s
=
makeNode
(
A_Const
);
...
...
@@ -9857,7 +9846,7 @@ case 732:
;
break
;}
case
733
:
#line 43
33
"gram.y"
#line 43
22
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
"getpgusername"
;
...
...
@@ -9866,7 +9855,7 @@ case 733:
;
break
;}
case
734
:
#line 43
40
"gram.y"
#line 43
29
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
"getpgusername"
;
...
...
@@ -9875,7 +9864,7 @@ case 734:
;
break
;}
case
735
:
#line 43
47
"gram.y"
#line 43
36
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
"strpos"
;
...
...
@@ -9884,7 +9873,7 @@ case 735:
;
break
;}
case
736
:
#line 43
54
"gram.y"
#line 43
43
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
"substr"
;
...
...
@@ -9893,7 +9882,7 @@ case 736:
;
break
;}
case
737
:
#line 43
62
"gram.y"
#line 43
51
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
"btrim"
;
...
...
@@ -9902,7 +9891,7 @@ case 737:
;
break
;}
case
738
:
#line 43
69
"gram.y"
#line 43
58
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
"ltrim"
;
...
...
@@ -9911,7 +9900,7 @@ case 738:
;
break
;}
case
739
:
#line 43
76
"gram.y"
#line 43
65
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
"rtrim"
;
...
...
@@ -9920,7 +9909,7 @@ case 739:
;
break
;}
case
740
:
#line 43
83
"gram.y"
#line 43
72
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
"btrim"
;
...
...
@@ -9929,7 +9918,7 @@ case 740:
;
break
;}
case
741
:
#line 43
92
"gram.y"
#line 43
81
"gram.y"
{
A_Indices
*
ai
=
makeNode
(
A_Indices
);
ai
->
lidx
=
NULL
;
...
...
@@ -9938,7 +9927,7 @@ case 741:
;
break
;}
case
742
:
#line 43
99
"gram.y"
#line 43
88
"gram.y"
{
A_Indices
*
ai
=
makeNode
(
A_Indices
);
ai
->
lidx
=
yyvsp
[
-
4
].
node
;
...
...
@@ -9947,23 +9936,23 @@ case 742:
;
break
;}
case
743
:
#line 4
406
"gram.y"
#line 4
395
"gram.y"
{
yyval
.
list
=
NIL
;
;
break
;}
case
744
:
#line 4
410
"gram.y"
#line 4
399
"gram.y"
{
yyval
.
list
=
lcons
(
yyvsp
[
0
].
node
,
NIL
);
;
break
;}
case
745
:
#line 44
12
"gram.y"
#line 44
01
"gram.y"
{
yyval
.
list
=
lappend
(
yyvsp
[
-
2
].
list
,
yyvsp
[
0
].
node
);
;
break
;}
case
746
:
#line 44
14
"gram.y"
#line 44
03
"gram.y"
{
yyval
.
list
=
lappend
(
yyvsp
[
-
2
].
list
,
yyvsp
[
0
].
node
);
;
break
;}
case
747
:
#line 44
18
"gram.y"
#line 44
07
"gram.y"
{
A_Const
*
n
=
makeNode
(
A_Const
);
n
->
val
.
type
=
T_String
;
...
...
@@ -9972,66 +9961,66 @@ case 747:
;
break
;}
case
748
:
#line 44
25
"gram.y"
#line 44
14
"gram.y"
{
yyval
.
list
=
NIL
;
;
break
;}
case
749
:
#line 44
28
"gram.y"
#line 44
17
"gram.y"
{
yyval
.
str
=
yyvsp
[
0
].
str
;
;
break
;}
case
750
:
#line 44
29
"gram.y"
#line 44
18
"gram.y"
{
yyval
.
str
=
"tz_hour"
;
;
break
;}
case
751
:
#line 44
30
"gram.y"
#line 44
19
"gram.y"
{
yyval
.
str
=
"tz_minute"
;
;
break
;}
case
752
:
#line 44
34
"gram.y"
#line 44
23
"gram.y"
{
yyval
.
list
=
makeList
(
yyvsp
[
0
].
node
,
yyvsp
[
-
2
].
node
,
-
1
);
;
break
;}
case
753
:
#line 44
36
"gram.y"
#line 44
25
"gram.y"
{
yyval
.
list
=
NIL
;
;
break
;}
case
754
:
#line 44
40
"gram.y"
#line 44
29
"gram.y"
{
yyvsp
[
-
1
].
attr
->
indirection
=
yyvsp
[
0
].
list
;
yyval
.
node
=
(
Node
*
)
yyvsp
[
-
1
].
attr
;
;
break
;}
case
755
:
#line 44
45
"gram.y"
#line 44
34
"gram.y"
{
yyval
.
node
=
yyvsp
[
0
].
node
;
;
break
;}
case
756
:
#line 44
47
"gram.y"
#line 44
36
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
"-"
,
NULL
,
yyvsp
[
0
].
node
);
;
break
;}
case
757
:
#line 44
49
"gram.y"
#line 44
38
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
"+"
,
yyvsp
[
-
2
].
node
,
yyvsp
[
0
].
node
);
;
break
;}
case
758
:
#line 44
51
"gram.y"
#line 44
40
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
"-"
,
yyvsp
[
-
2
].
node
,
yyvsp
[
0
].
node
);
;
break
;}
case
759
:
#line 44
53
"gram.y"
#line 44
42
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
"/"
,
yyvsp
[
-
2
].
node
,
yyvsp
[
0
].
node
);
;
break
;}
case
760
:
#line 44
55
"gram.y"
#line 44
44
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
"*"
,
yyvsp
[
-
2
].
node
,
yyvsp
[
0
].
node
);
;
break
;}
case
761
:
#line 44
57
"gram.y"
#line 44
46
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
"|"
,
NULL
,
yyvsp
[
0
].
node
);
;
break
;}
case
762
:
#line 44
59
"gram.y"
#line 44
48
"gram.y"
{
yyval
.
node
=
(
Node
*
)
yyvsp
[
-
2
].
node
;
/* AexprConst can be either A_Const or ParamNo */
...
...
@@ -10049,7 +10038,7 @@ case 762:
;
break
;}
case
763
:
#line 44
75
"gram.y"
#line 44
64
"gram.y"
{
yyval
.
node
=
(
Node
*
)
yyvsp
[
-
3
].
node
;
/* AexprConst can be either A_Const or ParamNo */
...
...
@@ -10067,23 +10056,23 @@ case 763:
;
break
;}
case
764
:
#line 44
91
"gram.y"
#line 44
80
"gram.y"
{
yyval
.
node
=
yyvsp
[
-
1
].
node
;
;
break
;}
case
765
:
#line 44
93
"gram.y"
#line 44
82
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
yyvsp
[
-
1
].
str
,
yyvsp
[
-
2
].
node
,
yyvsp
[
0
].
node
);
;
break
;}
case
766
:
#line 44
95
"gram.y"
#line 44
84
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
yyvsp
[
-
1
].
str
,
NULL
,
yyvsp
[
0
].
node
);
;
break
;}
case
767
:
#line 44
97
"gram.y"
#line 44
86
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
yyvsp
[
0
].
str
,
yyvsp
[
-
1
].
node
,
NULL
);
;
break
;}
case
768
:
#line 44
99
"gram.y"
#line 44
88
"gram.y"
{
/* could be a column name or a relation_name */
Ident
*
n
=
makeNode
(
Ident
);
...
...
@@ -10093,7 +10082,7 @@ case 768:
;
break
;}
case
769
:
#line 4
507
"gram.y"
#line 4
496
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
yyvsp
[
-
2
].
str
;
...
...
@@ -10102,7 +10091,7 @@ case 769:
;
break
;}
case
770
:
#line 45
14
"gram.y"
#line 45
03
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
yyvsp
[
-
3
].
str
;
...
...
@@ -10111,7 +10100,7 @@ case 770:
;
break
;}
case
771
:
#line 45
21
"gram.y"
#line 45
10
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
"strpos"
;
...
...
@@ -10120,7 +10109,7 @@ case 771:
;
break
;}
case
772
:
#line 45
28
"gram.y"
#line 45
17
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
"substr"
;
...
...
@@ -10129,7 +10118,7 @@ case 772:
;
break
;}
case
773
:
#line 45
36
"gram.y"
#line 45
25
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
"btrim"
;
...
...
@@ -10138,7 +10127,7 @@ case 773:
;
break
;}
case
774
:
#line 45
43
"gram.y"
#line 45
32
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
"ltrim"
;
...
...
@@ -10147,7 +10136,7 @@ case 774:
;
break
;}
case
775
:
#line 45
50
"gram.y"
#line 45
39
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
"rtrim"
;
...
...
@@ -10156,7 +10145,7 @@ case 775:
;
break
;}
case
776
:
#line 45
57
"gram.y"
#line 45
46
"gram.y"
{
FuncCall
*
n
=
makeNode
(
FuncCall
);
n
->
funcname
=
"btrim"
;
...
...
@@ -10165,21 +10154,21 @@ case 776:
;
break
;}
case
777
:
#line 45
66
"gram.y"
#line 45
55
"gram.y"
{
yyval
.
list
=
nconc
(
nconc
(
yyvsp
[
-
2
].
list
,
yyvsp
[
-
1
].
list
),
yyvsp
[
0
].
list
);
;
break
;}
case
778
:
#line 45
70
"gram.y"
#line 45
59
"gram.y"
{
yyval
.
list
=
NIL
;
;
break
;}
case
779
:
#line 45
74
"gram.y"
#line 45
63
"gram.y"
{
yyval
.
list
=
yyvsp
[
0
].
list
;
;
break
;}
case
780
:
#line 45
76
"gram.y"
#line 45
65
"gram.y"
{
A_Const
*
n
=
makeNode
(
A_Const
);
n
->
val
.
type
=
T_Integer
;
...
...
@@ -10188,27 +10177,27 @@ case 780:
;
break
;}
case
781
:
#line 45
85
"gram.y"
#line 45
74
"gram.y"
{
yyval
.
list
=
yyvsp
[
0
].
list
;
;
break
;}
case
782
:
#line 45
87
"gram.y"
#line 45
76
"gram.y"
{
yyval
.
list
=
NIL
;
;
break
;}
case
783
:
#line 45
91
"gram.y"
#line 45
80
"gram.y"
{
yyval
.
list
=
lappend
(
yyvsp
[
0
].
list
,
yyvsp
[
-
2
].
node
);
;
break
;}
case
784
:
#line 45
93
"gram.y"
#line 45
82
"gram.y"
{
yyval
.
list
=
yyvsp
[
0
].
list
;
;
break
;}
case
785
:
#line 45
95
"gram.y"
#line 45
84
"gram.y"
{
yyval
.
list
=
yyvsp
[
0
].
list
;
;
break
;}
case
786
:
#line 45
99
"gram.y"
#line 45
88
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
subselect
=
yyvsp
[
0
].
node
;
...
...
@@ -10216,21 +10205,21 @@ case 786:
;
break
;}
case
787
:
#line 4
605
"gram.y"
#line 4
594
"gram.y"
{
yyval
.
node
=
yyvsp
[
0
].
node
;
;
break
;}
case
788
:
#line 4
609
"gram.y"
#line 4
598
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
"="
,
lfirst
(
saved_In_Expr
),
yyvsp
[
0
].
node
);
;
break
;}
case
789
:
#line 46
11
"gram.y"
#line 46
00
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OR
,
NULL
,
yyvsp
[
-
2
].
node
,
makeA_Expr
(
OP
,
"="
,
lfirst
(
saved_In_Expr
),
yyvsp
[
0
].
node
));
;
break
;}
case
790
:
#line 46
17
"gram.y"
#line 46
06
"gram.y"
{
SubLink
*
n
=
makeNode
(
SubLink
);
n
->
subselect
=
yyvsp
[
0
].
node
;
...
...
@@ -10238,21 +10227,21 @@ case 790:
;
break
;}
case
791
:
#line 46
23
"gram.y"
#line 46
12
"gram.y"
{
yyval
.
node
=
yyvsp
[
0
].
node
;
;
break
;}
case
792
:
#line 46
27
"gram.y"
#line 46
16
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
OP
,
"<>"
,
lfirst
(
saved_In_Expr
),
yyvsp
[
0
].
node
);
;
break
;}
case
793
:
#line 46
29
"gram.y"
#line 46
18
"gram.y"
{
yyval
.
node
=
makeA_Expr
(
AND
,
NULL
,
yyvsp
[
-
2
].
node
,
makeA_Expr
(
OP
,
"<>"
,
lfirst
(
saved_In_Expr
),
yyvsp
[
0
].
node
));
;
break
;}
case
794
:
#line 46
50
"gram.y"
#line 46
39
"gram.y"
{
CaseExpr
*
c
=
makeNode
(
CaseExpr
);
c
->
arg
=
yyvsp
[
-
3
].
node
;
...
...
@@ -10262,7 +10251,7 @@ case 794:
;
break
;}
case
795
:
#line 46
58
"gram.y"
#line 46
47
"gram.y"
{
CaseExpr
*
c
=
makeNode
(
CaseExpr
);
CaseWhen
*
w
=
makeNode
(
CaseWhen
);
...
...
@@ -10275,7 +10264,7 @@ case 795:
;
break
;}
case
796
:
#line 46
69
"gram.y"
#line 46
58
"gram.y"
{
CaseExpr
*
c
=
makeNode
(
CaseExpr
);
CaseWhen
*
w
;
...
...
@@ -10293,15 +10282,15 @@ case 796:
;
break
;}
case
797
:
#line 46
87
"gram.y"
#line 46
76
"gram.y"
{
yyval
.
list
=
lappend
(
yyvsp
[
-
1
].
list
,
yyvsp
[
0
].
node
);
;
break
;}
case
798
:
#line 46
89
"gram.y"
#line 46
78
"gram.y"
{
yyval
.
list
=
lcons
(
yyvsp
[
0
].
node
,
NIL
);
;
break
;}
case
799
:
#line 46
93
"gram.y"
#line 46
82
"gram.y"
{
CaseWhen
*
w
=
makeNode
(
CaseWhen
);
w
->
expr
=
yyvsp
[
-
2
].
node
;
...
...
@@ -10310,22 +10299,22 @@ case 799:
;
break
;}
case
800
:
#line 4
701
"gram.y"
#line 4
690
"gram.y"
{
yyval
.
node
=
yyvsp
[
0
].
node
;
;
break
;}
case
801
:
#line 4
702
"gram.y"
#line 4
691
"gram.y"
{
yyval
.
node
=
NULL
;
;
break
;}
case
802
:
#line 4
706
"gram.y"
#line 4
695
"gram.y"
{
yyvsp
[
-
1
].
attr
->
indirection
=
yyvsp
[
0
].
list
;
yyval
.
node
=
(
Node
*
)
yyvsp
[
-
1
].
attr
;
;
break
;}
case
803
:
#line 47
11
"gram.y"
#line 47
00
"gram.y"
{
/* could be a column name or a relation_name */
Ident
*
n
=
makeNode
(
Ident
);
...
...
@@ -10335,11 +10324,11 @@ case 803:
;
break
;}
case
804
:
#line 47
19
"gram.y"
#line 47
08
"gram.y"
{
yyval
.
node
=
NULL
;
;
break
;}
case
805
:
#line 47
23
"gram.y"
#line 47
12
"gram.y"
{
yyval
.
attr
=
makeNode
(
Attr
);
yyval
.
attr
->
relname
=
yyvsp
[
-
2
].
str
;
...
...
@@ -10349,7 +10338,7 @@ case 805:
;
break
;}
case
806
:
#line 47
31
"gram.y"
#line 47
20
"gram.y"
{
yyval
.
attr
=
makeNode
(
Attr
);
yyval
.
attr
->
relname
=
NULL
;
...
...
@@ -10359,27 +10348,27 @@ case 806:
;
break
;}
case
807
:
#line 47
41
"gram.y"
#line 47
30
"gram.y"
{
yyval
.
list
=
lcons
(
makeString
(
yyvsp
[
0
].
str
),
NIL
);
;
break
;}
case
808
:
#line 47
43
"gram.y"
#line 47
32
"gram.y"
{
yyval
.
list
=
lappend
(
yyvsp
[
-
2
].
list
,
makeString
(
yyvsp
[
0
].
str
));
;
break
;}
case
809
:
#line 47
45
"gram.y"
#line 47
34
"gram.y"
{
yyval
.
list
=
lappend
(
yyvsp
[
-
2
].
list
,
makeString
(
"*"
));
;
break
;}
case
810
:
#line 47
56
"gram.y"
#line 47
45
"gram.y"
{
yyval
.
list
=
lappend
(
yyvsp
[
-
2
].
list
,
yyvsp
[
0
].
target
);
;
break
;}
case
811
:
#line 47
58
"gram.y"
#line 47
47
"gram.y"
{
yyval
.
list
=
lcons
(
yyvsp
[
0
].
target
,
NIL
);
;
break
;}
case
812
:
#line 47
60
"gram.y"
#line 47
49
"gram.y"
{
ResTarget
*
rt
=
makeNode
(
ResTarget
);
Attr
*
att
=
makeNode
(
Attr
);
...
...
@@ -10394,7 +10383,7 @@ case 812:
;
break
;}
case
813
:
#line 47
75
"gram.y"
#line 47
64
"gram.y"
{
yyval
.
target
=
makeNode
(
ResTarget
);
yyval
.
target
->
name
=
yyvsp
[
-
3
].
str
;
...
...
@@ -10403,7 +10392,7 @@ case 813:
;
break
;}
case
814
:
#line 47
82
"gram.y"
#line 47
71
"gram.y"
{
yyval
.
target
=
makeNode
(
ResTarget
);
yyval
.
target
->
name
=
NULL
;
...
...
@@ -10412,7 +10401,7 @@ case 814:
;
break
;}
case
815
:
#line 47
89
"gram.y"
#line 47
78
"gram.y"
{
Attr
*
att
=
makeNode
(
Attr
);
att
->
relname
=
yyvsp
[
-
2
].
str
;
...
...
@@ -10426,15 +10415,15 @@ case 815:
;
break
;}
case
816
:
#line 4
808
"gram.y"
#line 4
797
"gram.y"
{
yyval
.
list
=
lappend
(
yyvsp
[
-
2
].
list
,
yyvsp
[
0
].
target
);
;
break
;}
case
817
:
#line 4
810
"gram.y"
#line 4
799
"gram.y"
{
yyval
.
list
=
lcons
(
yyvsp
[
0
].
target
,
NIL
);
;
break
;}
case
818
:
#line 48
15
"gram.y"
#line 48
04
"gram.y"
{
yyval
.
target
=
makeNode
(
ResTarget
);
yyval
.
target
->
name
=
yyvsp
[
0
].
str
;
...
...
@@ -10443,7 +10432,7 @@ case 818:
;
break
;}
case
819
:
#line 48
22
"gram.y"
#line 48
11
"gram.y"
{
yyval
.
target
=
makeNode
(
ResTarget
);
yyval
.
target
->
name
=
NULL
;
...
...
@@ -10452,7 +10441,7 @@ case 819:
;
break
;}
case
820
:
#line 48
29
"gram.y"
#line 48
18
"gram.y"
{
Attr
*
att
=
makeNode
(
Attr
);
att
->
relname
=
yyvsp
[
-
2
].
str
;
...
...
@@ -10466,7 +10455,7 @@ case 820:
;
break
;}
case
821
:
#line 48
41
"gram.y"
#line 48
30
"gram.y"
{
Attr
*
att
=
makeNode
(
Attr
);
att
->
relname
=
"*"
;
...
...
@@ -10480,22 +10469,22 @@ case 821:
;
break
;}
case
822
:
#line 48
54
"gram.y"
#line 48
43
"gram.y"
{
yyval
.
str
=
yyvsp
[
0
].
str
;
;
break
;}
case
823
:
#line 48
55
"gram.y"
#line 48
44
"gram.y"
{
yyval
.
str
=
NULL
;
;
break
;}
case
824
:
#line 48
59
"gram.y"
#line 48
48
"gram.y"
{
yyval
.
str
=
yyvsp
[
0
].
str
;
StrNCpy
(
saved_relname
,
yyvsp
[
0
].
str
,
NAMEDATALEN
);
;
break
;}
case
825
:
#line 48
64
"gram.y"
#line 48
53
"gram.y"
{
/* disallow refs to variable system tables */
if
(
strcmp
(
LogRelationName
,
yyvsp
[
0
].
str
)
==
0
...
...
@@ -10507,43 +10496,43 @@ case 825:
;
break
;}
case
826
:
#line 48
75
"gram.y"
#line 48
64
"gram.y"
{
yyval
.
str
=
yyvsp
[
0
].
str
;
;
break
;}
case
827
:
#line 48
76
"gram.y"
#line 48
65
"gram.y"
{
yyval
.
str
=
yyvsp
[
0
].
str
;
;
break
;}
case
828
:
#line 48
77
"gram.y"
#line 48
66
"gram.y"
{
yyval
.
str
=
yyvsp
[
0
].
str
;
;
break
;}
case
829
:
#line 48
78
"gram.y"
#line 48
67
"gram.y"
{
yyval
.
str
=
yyvsp
[
0
].
str
;
;
break
;}
case
830
:
#line 48
79
"gram.y"
#line 48
68
"gram.y"
{
yyval
.
str
=
yyvsp
[
0
].
str
;
;
break
;}
case
831
:
#line 48
85
"gram.y"
#line 48
74
"gram.y"
{
yyval
.
str
=
yyvsp
[
0
].
str
;
;
break
;}
case
832
:
#line 48
86
"gram.y"
#line 48
75
"gram.y"
{
yyval
.
str
=
xlateSqlFunc
(
yyvsp
[
0
].
str
);
;
break
;}
case
833
:
#line 48
88
"gram.y"
#line 48
77
"gram.y"
{
yyval
.
str
=
yyvsp
[
0
].
str
;
;
break
;}
case
834
:
#line 48
89
"gram.y"
#line 48
78
"gram.y"
{
yyval
.
str
=
yyvsp
[
0
].
str
;
;
break
;}
case
835
:
#line 48
95
"gram.y"
#line 48
84
"gram.y"
{
A_Const
*
n
=
makeNode
(
A_Const
);
n
->
val
.
type
=
T_Integer
;
...
...
@@ -10552,7 +10541,7 @@ case 835:
;
break
;}
case
836
:
#line 4
902
"gram.y"
#line 4
891
"gram.y"
{
A_Const
*
n
=
makeNode
(
A_Const
);
n
->
val
.
type
=
T_Float
;
...
...
@@ -10561,7 +10550,7 @@ case 836:
;
break
;}
case
837
:
#line 4
909
"gram.y"
#line 4
898
"gram.y"
{
A_Const
*
n
=
makeNode
(
A_Const
);
n
->
val
.
type
=
T_String
;
...
...
@@ -10570,7 +10559,7 @@ case 837:
;
break
;}
case
838
:
#line 49
16
"gram.y"
#line 49
05
"gram.y"
{
A_Const
*
n
=
makeNode
(
A_Const
);
n
->
typename
=
yyvsp
[
-
1
].
typnam
;
...
...
@@ -10580,11 +10569,11 @@ case 838:
;
break
;}
case
839
:
#line 49
24
"gram.y"
#line 49
13
"gram.y"
{
yyval
.
node
=
(
Node
*
)
yyvsp
[
0
].
paramno
;
;
break
;}
case
840
:
#line 49
26
"gram.y"
#line 49
15
"gram.y"
{
A_Const
*
n
=
makeNode
(
A_Const
);
n
->
val
.
type
=
T_String
;
...
...
@@ -10596,7 +10585,7 @@ case 840:
;
break
;}
case
841
:
#line 49
36
"gram.y"
#line 49
25
"gram.y"
{
A_Const
*
n
=
makeNode
(
A_Const
);
n
->
val
.
type
=
T_String
;
...
...
@@ -10608,7 +10597,7 @@ case 841:
;
break
;}
case
842
:
#line 49
48
"gram.y"
#line 49
37
"gram.y"
{
yyval
.
paramno
=
makeNode
(
ParamNo
);
yyval
.
paramno
->
number
=
yyvsp
[
-
1
].
ival
;
...
...
@@ -10616,471 +10605,471 @@ case 842:
;
break
;}
case
843
:
#line 49
55
"gram.y"
#line 49
44
"gram.y"
{
yyval
.
ival
=
yyvsp
[
0
].
ival
;
;
break
;}
case
844
:
#line 49
56
"gram.y"
#line 49
45
"gram.y"
{
yyval
.
str
=
yyvsp
[
0
].
str
;
;
break
;}
case
845
:
#line 49
57
"gram.y"
#line 49
46
"gram.y"
{
yyval
.
str
=
yyvsp
[
0
].
str
;
;
break
;}
case
846
:
#line 49
65
"gram.y"
#line 49
54
"gram.y"
{
yyval
.
str
=
xlateSqlType
(
yyvsp
[
0
].
str
);
;
break
;}
case
847
:
#line 49
67
"gram.y"
#line 49
56
"gram.y"
{
yyval
.
str
=
xlateSqlType
(
yyvsp
[
0
].
str
);
;
break
;}
case
848
:
#line 49
69
"gram.y"
#line 49
58
"gram.y"
{
yyval
.
str
=
xlateSqlType
(
yyvsp
[
0
].
str
);
;
break
;}
case
849
:
#line 49
79
"gram.y"
#line 49
68
"gram.y"
{
yyval
.
str
=
yyvsp
[
0
].
str
;
;
break
;}
case
850
:
#line 49
80
"gram.y"
#line 49
69
"gram.y"
{
yyval
.
str
=
yyvsp
[
0
].
str
;
;
break
;}
case
851
:
#line 49
81
"gram.y"
#line 49
70
"gram.y"
{
yyval
.
str
=
"absolute"
;
;
break
;}
case
852
:
#line 49
82
"gram.y"
#line 49
71
"gram.y"
{
yyval
.
str
=
"action"
;
;
break
;}
case
853
:
#line 49
83
"gram.y"
#line 49
72
"gram.y"
{
yyval
.
str
=
"after"
;
;
break
;}
case
854
:
#line 49
84
"gram.y"
#line 49
73
"gram.y"
{
yyval
.
str
=
"aggregate"
;
;
break
;}
case
855
:
#line 49
85
"gram.y"
#line 49
74
"gram.y"
{
yyval
.
str
=
"backward"
;
;
break
;}
case
856
:
#line 49
86
"gram.y"
#line 49
75
"gram.y"
{
yyval
.
str
=
"before"
;
;
break
;}
case
857
:
#line 49
87
"gram.y"
#line 49
76
"gram.y"
{
yyval
.
str
=
"cache"
;
;
break
;}
case
858
:
#line 49
88
"gram.y"
#line 49
77
"gram.y"
{
yyval
.
str
=
"createdb"
;
;
break
;}
case
859
:
#line 49
89
"gram.y"
#line 49
78
"gram.y"
{
yyval
.
str
=
"createuser"
;
;
break
;}
case
860
:
#line 49
90
"gram.y"
#line 49
79
"gram.y"
{
yyval
.
str
=
"cycle"
;
;
break
;}
case
861
:
#line 49
91
"gram.y"
#line 49
80
"gram.y"
{
yyval
.
str
=
"database"
;
;
break
;}
case
862
:
#line 49
92
"gram.y"
#line 49
81
"gram.y"
{
yyval
.
str
=
"delimiters"
;
;
break
;}
case
863
:
#line 49
93
"gram.y"
#line 49
82
"gram.y"
{
yyval
.
str
=
"double"
;
;
break
;}
case
864
:
#line 49
94
"gram.y"
#line 49
83
"gram.y"
{
yyval
.
str
=
"each"
;
;
break
;}
case
865
:
#line 49
95
"gram.y"
#line 49
84
"gram.y"
{
yyval
.
str
=
"encoding"
;
;
break
;}
case
866
:
#line 49
96
"gram.y"
#line 49
85
"gram.y"
{
yyval
.
str
=
"forward"
;
;
break
;}
case
867
:
#line 49
97
"gram.y"
#line 49
86
"gram.y"
{
yyval
.
str
=
"function"
;
;
break
;}
case
868
:
#line 49
98
"gram.y"
#line 49
87
"gram.y"
{
yyval
.
str
=
"handler"
;
;
break
;}
case
869
:
#line 49
99
"gram.y"
#line 49
88
"gram.y"
{
yyval
.
str
=
"increment"
;
;
break
;}
case
870
:
#line
5000
"gram.y"
#line
4989
"gram.y"
{
yyval
.
str
=
"index"
;
;
break
;}
case
871
:
#line
5001
"gram.y"
#line
4990
"gram.y"
{
yyval
.
str
=
"inherits"
;
;
break
;}
case
872
:
#line
5002
"gram.y"
#line
4991
"gram.y"
{
yyval
.
str
=
"insensitive"
;
;
break
;}
case
873
:
#line
5003
"gram.y"
#line
4992
"gram.y"
{
yyval
.
str
=
"instead"
;
;
break
;}
case
874
:
#line
5004
"gram.y"
#line
4993
"gram.y"
{
yyval
.
str
=
"isnull"
;
;
break
;}
case
875
:
#line
5005
"gram.y"
#line
4994
"gram.y"
{
yyval
.
str
=
"key"
;
;
break
;}
case
876
:
#line
5006
"gram.y"
#line
4995
"gram.y"
{
yyval
.
str
=
"language"
;
;
break
;}
case
877
:
#line
5007
"gram.y"
#line
4996
"gram.y"
{
yyval
.
str
=
"lancompiler"
;
;
break
;}
case
878
:
#line
5008
"gram.y"
#line
4997
"gram.y"
{
yyval
.
str
=
"location"
;
;
break
;}
case
879
:
#line
5009
"gram.y"
#line
4998
"gram.y"
{
yyval
.
str
=
"match"
;
;
break
;}
case
880
:
#line
5010
"gram.y"
#line
4999
"gram.y"
{
yyval
.
str
=
"maxvalue"
;
;
break
;}
case
881
:
#line 50
11
"gram.y"
#line 50
00
"gram.y"
{
yyval
.
str
=
"minvalue"
;
;
break
;}
case
882
:
#line 50
12
"gram.y"
#line 50
01
"gram.y"
{
yyval
.
str
=
"next"
;
;
break
;}
case
883
:
#line 50
13
"gram.y"
#line 50
02
"gram.y"
{
yyval
.
str
=
"nocreatedb"
;
;
break
;}
case
884
:
#line 50
14
"gram.y"
#line 50
03
"gram.y"
{
yyval
.
str
=
"nocreateuser"
;
;
break
;}
case
885
:
#line 50
15
"gram.y"
#line 50
04
"gram.y"
{
yyval
.
str
=
"nothing"
;
;
break
;}
case
886
:
#line 50
16
"gram.y"
#line 50
05
"gram.y"
{
yyval
.
str
=
"notnull"
;
;
break
;}
case
887
:
#line 50
17
"gram.y"
#line 50
06
"gram.y"
{
yyval
.
str
=
"of"
;
;
break
;}
case
888
:
#line 50
18
"gram.y"
#line 50
07
"gram.y"
{
yyval
.
str
=
"oids"
;
;
break
;}
case
889
:
#line 50
19
"gram.y"
#line 50
08
"gram.y"
{
yyval
.
str
=
"only"
;
;
break
;}
case
890
:
#line 50
20
"gram.y"
#line 50
09
"gram.y"
{
yyval
.
str
=
"operator"
;
;
break
;}
case
891
:
#line 50
21
"gram.y"
#line 50
10
"gram.y"
{
yyval
.
str
=
"option"
;
;
break
;}
case
892
:
#line 50
22
"gram.y"
#line 50
11
"gram.y"
{
yyval
.
str
=
"password"
;
;
break
;}
case
893
:
#line 50
23
"gram.y"
#line 50
12
"gram.y"
{
yyval
.
str
=
"prior"
;
;
break
;}
case
894
:
#line 50
24
"gram.y"
#line 50
13
"gram.y"
{
yyval
.
str
=
"privileges"
;
;
break
;}
case
895
:
#line 50
25
"gram.y"
#line 50
14
"gram.y"
{
yyval
.
str
=
"procedural"
;
;
break
;}
case
896
:
#line 50
26
"gram.y"
#line 50
15
"gram.y"
{
yyval
.
str
=
"read"
;
;
break
;}
case
897
:
#line 50
27
"gram.y"
#line 50
16
"gram.y"
{
yyval
.
str
=
"recipe"
;
;
break
;}
case
898
:
#line 50
28
"gram.y"
#line 50
17
"gram.y"
{
yyval
.
str
=
"relative"
;
;
break
;}
case
899
:
#line 50
29
"gram.y"
#line 50
18
"gram.y"
{
yyval
.
str
=
"rename"
;
;
break
;}
case
900
:
#line 50
30
"gram.y"
#line 50
19
"gram.y"
{
yyval
.
str
=
"returns"
;
;
break
;}
case
901
:
#line 50
31
"gram.y"
#line 50
20
"gram.y"
{
yyval
.
str
=
"row"
;
;
break
;}
case
902
:
#line 50
32
"gram.y"
#line 50
21
"gram.y"
{
yyval
.
str
=
"rule"
;
;
break
;}
case
903
:
#line 50
33
"gram.y"
#line 50
22
"gram.y"
{
yyval
.
str
=
"scroll"
;
;
break
;}
case
904
:
#line 50
34
"gram.y"
#line 50
23
"gram.y"
{
yyval
.
str
=
"sequence"
;
;
break
;}
case
905
:
#line 50
35
"gram.y"
#line 50
24
"gram.y"
{
yyval
.
str
=
"serial"
;
;
break
;}
case
906
:
#line 50
36
"gram.y"
#line 50
25
"gram.y"
{
yyval
.
str
=
"start"
;
;
break
;}
case
907
:
#line 50
37
"gram.y"
#line 50
26
"gram.y"
{
yyval
.
str
=
"statement"
;
;
break
;}
case
908
:
#line 50
38
"gram.y"
#line 50
27
"gram.y"
{
yyval
.
str
=
"stdin"
;
;
break
;}
case
909
:
#line 50
39
"gram.y"
#line 50
28
"gram.y"
{
yyval
.
str
=
"stdout"
;
;
break
;}
case
910
:
#line 50
40
"gram.y"
#line 50
29
"gram.y"
{
yyval
.
str
=
"time"
;
;
break
;}
case
911
:
#line 50
41
"gram.y"
#line 50
30
"gram.y"
{
yyval
.
str
=
"timestamp"
;
;
break
;}
case
912
:
#line 50
42
"gram.y"
#line 50
31
"gram.y"
{
yyval
.
str
=
"timezone_hour"
;
;
break
;}
case
913
:
#line 50
43
"gram.y"
#line 50
32
"gram.y"
{
yyval
.
str
=
"timezone_minute"
;
;
break
;}
case
914
:
#line 50
44
"gram.y"
#line 50
33
"gram.y"
{
yyval
.
str
=
"trigger"
;
;
break
;}
case
915
:
#line 50
45
"gram.y"
#line 50
34
"gram.y"
{
yyval
.
str
=
"trusted"
;
;
break
;}
case
916
:
#line 50
46
"gram.y"
#line 50
35
"gram.y"
{
yyval
.
str
=
"type"
;
;
break
;}
case
917
:
#line 50
47
"gram.y"
#line 50
36
"gram.y"
{
yyval
.
str
=
"valid"
;
;
break
;}
case
918
:
#line 50
48
"gram.y"
#line 50
37
"gram.y"
{
yyval
.
str
=
"version"
;
;
break
;}
case
919
:
#line 50
49
"gram.y"
#line 50
38
"gram.y"
{
yyval
.
str
=
"zone"
;
;
break
;}
case
920
:
#line 50
62
"gram.y"
#line 50
51
"gram.y"
{
yyval
.
str
=
yyvsp
[
0
].
str
;
;
break
;}
case
921
:
#line 50
63
"gram.y"
#line 50
52
"gram.y"
{
yyval
.
str
=
"abort"
;
;
break
;}
case
922
:
#line 50
64
"gram.y"
#line 50
53
"gram.y"
{
yyval
.
str
=
"analyze"
;
;
break
;}
case
923
:
#line 50
65
"gram.y"
#line 50
54
"gram.y"
{
yyval
.
str
=
"binary"
;
;
break
;}
case
924
:
#line 50
66
"gram.y"
#line 50
55
"gram.y"
{
yyval
.
str
=
"case"
;
;
break
;}
case
925
:
#line 50
67
"gram.y"
#line 50
56
"gram.y"
{
yyval
.
str
=
"cluster"
;
;
break
;}
case
926
:
#line 50
68
"gram.y"
#line 50
57
"gram.y"
{
yyval
.
str
=
"coalesce"
;
;
break
;}
case
927
:
#line 50
69
"gram.y"
#line 50
58
"gram.y"
{
yyval
.
str
=
"constraint"
;
;
break
;}
case
928
:
#line 50
70
"gram.y"
#line 50
59
"gram.y"
{
yyval
.
str
=
"copy"
;
;
break
;}
case
929
:
#line 50
71
"gram.y"
#line 50
60
"gram.y"
{
yyval
.
str
=
"cross"
;
;
break
;}
case
930
:
#line 50
72
"gram.y"
#line 50
61
"gram.y"
{
yyval
.
str
=
"current"
;
;
break
;}
case
931
:
#line 50
73
"gram.y"
#line 50
62
"gram.y"
{
yyval
.
str
=
"do"
;
;
break
;}
case
932
:
#line 50
74
"gram.y"
#line 50
63
"gram.y"
{
yyval
.
str
=
"else"
;
;
break
;}
case
933
:
#line 50
75
"gram.y"
#line 50
64
"gram.y"
{
yyval
.
str
=
"end"
;
;
break
;}
case
934
:
#line 50
76
"gram.y"
#line 50
65
"gram.y"
{
yyval
.
str
=
"explain"
;
;
break
;}
case
935
:
#line 50
77
"gram.y"
#line 50
66
"gram.y"
{
yyval
.
str
=
"extend"
;
;
break
;}
case
936
:
#line 50
78
"gram.y"
#line 50
67
"gram.y"
{
yyval
.
str
=
"false"
;
;
break
;}
case
937
:
#line 50
79
"gram.y"
#line 50
68
"gram.y"
{
yyval
.
str
=
"foreign"
;
;
break
;}
case
938
:
#line 50
80
"gram.y"
#line 50
69
"gram.y"
{
yyval
.
str
=
"group"
;
;
break
;}
case
939
:
#line 50
81
"gram.y"
#line 50
70
"gram.y"
{
yyval
.
str
=
"listen"
;
;
break
;}
case
940
:
#line 50
82
"gram.y"
#line 50
71
"gram.y"
{
yyval
.
str
=
"load"
;
;
break
;}
case
941
:
#line 50
83
"gram.y"
#line 50
72
"gram.y"
{
yyval
.
str
=
"lock"
;
;
break
;}
case
942
:
#line 50
84
"gram.y"
#line 50
73
"gram.y"
{
yyval
.
str
=
"move"
;
;
break
;}
case
943
:
#line 50
85
"gram.y"
#line 50
74
"gram.y"
{
yyval
.
str
=
"new"
;
;
break
;}
case
944
:
#line 50
86
"gram.y"
#line 50
75
"gram.y"
{
yyval
.
str
=
"none"
;
;
break
;}
case
945
:
#line 50
87
"gram.y"
#line 50
76
"gram.y"
{
yyval
.
str
=
"nullif"
;
;
break
;}
case
946
:
#line 50
88
"gram.y"
#line 50
77
"gram.y"
{
yyval
.
str
=
"order"
;
;
break
;}
case
947
:
#line 50
89
"gram.y"
#line 50
78
"gram.y"
{
yyval
.
str
=
"position"
;
;
break
;}
case
948
:
#line 50
90
"gram.y"
#line 50
79
"gram.y"
{
yyval
.
str
=
"precision"
;
;
break
;}
case
949
:
#line 50
91
"gram.y"
#line 50
80
"gram.y"
{
yyval
.
str
=
"reset"
;
;
break
;}
case
950
:
#line 50
92
"gram.y"
#line 50
81
"gram.y"
{
yyval
.
str
=
"setof"
;
;
break
;}
case
951
:
#line 50
93
"gram.y"
#line 50
82
"gram.y"
{
yyval
.
str
=
"show"
;
;
break
;}
case
952
:
#line 50
94
"gram.y"
#line 50
83
"gram.y"
{
yyval
.
str
=
"table"
;
;
break
;}
case
953
:
#line 50
95
"gram.y"
#line 50
84
"gram.y"
{
yyval
.
str
=
"then"
;
;
break
;}
case
954
:
#line 50
96
"gram.y"
#line 50
85
"gram.y"
{
yyval
.
str
=
"transaction"
;
;
break
;}
case
955
:
#line 50
97
"gram.y"
#line 50
86
"gram.y"
{
yyval
.
str
=
"true"
;
;
break
;}
case
956
:
#line 50
98
"gram.y"
#line 50
87
"gram.y"
{
yyval
.
str
=
"vacuum"
;
;
break
;}
case
957
:
#line 50
99
"gram.y"
#line 50
88
"gram.y"
{
yyval
.
str
=
"verbose"
;
;
break
;}
case
958
:
#line 5
100
"gram.y"
#line 5
089
"gram.y"
{
yyval
.
str
=
"when"
;
;
break
;}
case
959
:
#line 5
104
"gram.y"
#line 5
093
"gram.y"
{
if
(
QueryIsRule
)
yyval
.
str
=
"*CURRENT*"
;
...
...
@@ -11089,7 +11078,7 @@ case 959:
;
break
;}
case
960
:
#line 51
11
"gram.y"
#line 51
00
"gram.y"
{
if
(
QueryIsRule
)
yyval
.
str
=
"*NEW*"
;
...
...
@@ -11099,7 +11088,7 @@ case 960:
break
;}
}
/* the action file gets copied in in place of this dollarsign */
#line 498 "/usr/
local/bison
/bison.simple"
#line 498 "/usr/
share/misc
/bison.simple"
yyvsp
-=
yylen
;
yyssp
-=
yylen
;
...
...
@@ -11295,7 +11284,7 @@ yyerrhandle:
yystate
=
yyn
;
goto
yynewstate
;
}
#line 51
19
"gram.y"
#line 51
08
"gram.y"
static
Node
*
...
...
src/backend/parser/gram.y
View file @
247b3f90
...
...
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.4
8 1999/01/22 19:35:54 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.4
9 1999/01/25 12:01:13 vadim
Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
...
...
@@ -2798,19 +2798,8 @@ SelectStmt: select_w_o_sort sort_clause for_update_clause
first_select->forUpdate = $3;
$$ = (Node *)first_select;
}
if (((SelectStmt *)$$)->forUpdate != NULL)
{
SelectStmt *n = (SelectStmt *)$$;
if (n->unionClause != NULL)
elog(ERROR, "SELECT FOR UPDATE is not allowed with UNION/INTERSECT/EXCEPT clause");
if (n->unique != NULL)
elog(ERROR, "SELECT FOR UPDATE is not allowed with DISTINCT clause");
if (n->groupClause != NULL)
elog(ERROR, "SELECT FOR UPDATE is not allowed with GROUP BY clause");
if (n->havingClause != NULL)
elog(ERROR, "SELECT FOR UPDATE is not allowed with HAVING clause");
}
if (((SelectStmt *)$$)->forUpdate != NULL && QueryIsRule)
elog(ERROR, "SELECT FOR UPDATE is not allowed in RULES");
}
;
...
...
src/backend/rewrite/rewriteHandler.c
View file @
247b3f90
...
...
@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.3
0 1999/01/24 00:28:30 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.3
1 1999/01/25 12:01:14 vadim
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1787,6 +1787,7 @@ apply_RIR_view(Node **nodePtr, int rt_index, RangeTblEntry *rte, List *tlist, in
}
}
extern
void
CheckSelectForUpdate
(
Query
*
rule_action
);
/* in analyze.c */
static
void
ApplyRetrieveRule
(
Query
*
parsetree
,
...
...
@@ -1847,6 +1848,7 @@ ApplyRetrieveRule(Query *parsetree,
Index
rti
=
1
;
List
*
l2
;
CheckSelectForUpdate
(
rule_action
);
/*
* We believe that rt_index is VIEW - nothing should be
* marked for VIEW, but ACL check must be done.
...
...
src/include/nodes/execnodes.h
View file @
247b3f90
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: execnodes.h,v 1.2
0 1998/12/14 05:19:16 scrappy
Exp $
* $Id: execnodes.h,v 1.2
1 1999/01/25 12:01:19 vadim
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -208,6 +208,7 @@ typedef struct EState
int
*
es_refcount
;
uint32
es_processed
;
/* # of tuples processed */
Oid
es_lastoid
;
/* last oid processed (by INSERT) */
List
*
es_rowMark
;
/* not good place, but there is no other */
}
EState
;
/* ----------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment