Skip to content

Commit 104d6c8

Browse files
committed
Add ^ precidence.
1 parent 38ff52c commit 104d6c8

File tree

3 files changed

+37
-10
lines changed

3 files changed

+37
-10
lines changed

doc/TODO

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ PARSER
2929
* Select a[1] FROM test fails, it needs test.a[1]
3030
* Array index references without table name cause problems
3131
* Update table SET table.value = 3 fails
32-
* Creating index of timestamp fails
32+
* Creating index of TIMESTAMP fails, rename to DATETIME(Thomas)
3333
* SELECT foo UNION SELECT foo is incorrectly simplified to SELECT foo
34+
* INSERT ... SELECT ... GROUP BY groups by target columns not source columns
35+
* CREATE TABLE test (a char(5) DEFAULT text '', b int4) fails on INSERT
3436

3537
VIEWS
3638

@@ -80,7 +82,8 @@ TYPES
8082
* Large objects
8183
o Fix large object mapping scheme, own typeid or reltype(Peter)
8284
o Allow large text type to use large objects(Peter)
83-
o Not to stuff everything as files in a single directory
85+
o Not to stuff everything as files in a single directory, hash dirs
86+
o Allow large object vacuuming
8487
* Allow pg_descriptions when creating types, tables, columns, and functions
8588
* Add IPv6 capability to INET/CIDR types
8689
* Make a separate SERIAL type?
@@ -90,6 +93,7 @@ TYPES
9093
* Allow LOCALE on a per-column basis, default to ASCII
9194
* Allow array on int8[]
9295
* Remove Money type, add money formatting for decimal type
96+
* Fix typein/out functions to not be user-callable
9397

9498
VIEWS
9599

@@ -132,6 +136,7 @@ CLIENTS
132136
* Allow psql \copy to allow delimiters
133137
* Add a function to return the last inserted oid, for use in psql scripts
134138
* Allow psql to print nulls as distinct from ""(?)
139+
* PQrequestCancel() be able to terminate backend waiting for lock
135140

136141
MISC
137142

@@ -182,17 +187,23 @@ INDEXES
182187
a matching index
183188
* Improve LIMIT processing by using index to limit rows processed
184189
* Have optimizer take LIMIT into account when considering index scans
190+
* Make index creation use psort code, because it is now faster(Vadim)
191+
* Create more system table indexes for faster cache lookups
192+
* fix indexscan() so it does leak memory by not requiring caller to free
193+
* Improve _bt_binsrch() to handle equal keys better, remove _bt_firsteq()(Tom)
185194

186195
CACHE
187196

188197
* Cache most recent query plan(s?)
189198
* Shared catalog cache, reduce lseek()'s by caching table size in shared area
199+
* elog() flushes cache, try invalidating just entries from current xact,
200+
perhaps using invalidation cache
201+
190202

191203
MISC
192204

193205
* Allow compression of log and meta data
194206
* Update pg_statistic table to remove operator column
195-
* Make index creation use psort code, because it is now faster(Vadim)
196207
* Allow char() not to use variable-sized header to reduce disk size
197208
* Do async I/O to do better read-ahead of data
198209
* Fix memory exhaustion when using many OR's
@@ -201,15 +212,15 @@ MISC
201212
* Use mmap() rather than SYSV shared memory(?)
202213
* Process const = const parts of OR clause in separate pass
203214
* Make oid use oidin/oidout not int4in/int4out in pg_type.h
204-
* Create more system table indexes for faster cache lookups
205215
* Improve Subplan list handling
206216
* Allow Subplans to use efficient joins(hash, merge) with upper variable
207217
* use fmgr_info()/fmgr_faddr() instead of fmgr() calls in high-traffic
208218
places, like GROUP BY, UNIQUE, index processing, etc.
209219
* improve dynamic memory allocation by introducing tuple-context memory
210220
allocation
211-
* fix indexscan() so it does leak memory by not requiring caller to free
212-
* fix memory leak in cache code when non-existant table is refer
221+
* fix memory leak in cache code when non-existant table is referenced
222+
* In WHERE x=3 AND x=y, add y=3
223+
* pass atttypmod through parser in more cases(Bruce)
213224

214225
SOURCE CODE
215226
-----------

src/backend/parser/gram.y

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.86 1999/07/04 04:55:59 momjian Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.87 1999/07/08 00:00:42 momjian Exp $
1414
*
1515
* HISTORY
1616
* AUTHOR DATE MAJOR EVENT
@@ -349,7 +349,7 @@ Oid param_type(int t); /* used in parse_expr.c */
349349
%nonassoc NULL_P
350350
%nonassoc IS
351351
%left '+' '-'
352-
%left '*' '/' '%'
352+
%left '*' '/' '%' '^'
353353
%left '|' /* this is the relation union op, not logical or */
354354
/* Unary Operators */
355355
%right ':'
@@ -973,6 +973,8 @@ default_expr: AexprConst
973973
{ $$ = nconc( $1, lcons( makeString( "%"), $3)); }
974974
| default_expr '*' default_expr
975975
{ $$ = nconc( $1, lcons( makeString( "*"), $3)); }
976+
| default_expr '^' default_expr
977+
{ $$ = nconc( $1, lcons( makeString( "^"), $3)); }
976978
| default_expr '=' default_expr
977979
{ elog(ERROR,"boolean expressions not supported in DEFAULT"); }
978980
| default_expr '<' default_expr
@@ -1121,6 +1123,8 @@ constraint_expr: AexprConst
11211123
{ $$ = nconc( $1, lcons( makeString( "%"), $3)); }
11221124
| constraint_expr '*' constraint_expr
11231125
{ $$ = nconc( $1, lcons( makeString( "*"), $3)); }
1126+
| constraint_expr '^' constraint_expr
1127+
{ $$ = nconc( $1, lcons( makeString( "^"), $3)); }
11241128
| constraint_expr '=' constraint_expr
11251129
{ $$ = nconc( $1, lcons( makeString( "="), $3)); }
11261130
| constraint_expr '<' constraint_expr
@@ -3641,8 +3645,12 @@ a_expr: attr opt_indirection
36413645
{ $$ = doNegate($2); }
36423646
| '%' a_expr
36433647
{ $$ = makeA_Expr(OP, "%", NULL, $2); }
3648+
| '^' a_expr
3649+
{ $$ = makeA_Expr(OP, "^", NULL, $2); }
36443650
| a_expr '%'
36453651
{ $$ = makeA_Expr(OP, "%", $1, NULL); }
3652+
| a_expr '^'
3653+
{ $$ = makeA_Expr(OP, "^", $1, NULL); }
36463654
| a_expr '+' a_expr
36473655
{ $$ = makeA_Expr(OP, "+", $1, $3); }
36483656
| a_expr '-' a_expr
@@ -3653,6 +3661,8 @@ a_expr: attr opt_indirection
36533661
{ $$ = makeA_Expr(OP, "%", $1, $3); }
36543662
| a_expr '*' a_expr
36553663
{ $$ = makeA_Expr(OP, "*", $1, $3); }
3664+
| a_expr '^' a_expr
3665+
{ $$ = makeA_Expr(OP, "^", $1, $3); }
36563666
| a_expr '<' a_expr
36573667
{ $$ = makeA_Expr(OP, "<", $1, $3); }
36583668
| a_expr '>' a_expr
@@ -4302,8 +4312,12 @@ b_expr: attr opt_indirection
43024312
{ $$ = doNegate($2); }
43034313
| '%' b_expr
43044314
{ $$ = makeA_Expr(OP, "%", NULL, $2); }
4315+
| '^' b_expr
4316+
{ $$ = makeA_Expr(OP, "^", NULL, $2); }
43054317
| b_expr '%'
43064318
{ $$ = makeA_Expr(OP, "%", $1, NULL); }
4319+
| b_expr '^'
4320+
{ $$ = makeA_Expr(OP, "^", $1, NULL); }
43074321
| b_expr '+' b_expr
43084322
{ $$ = makeA_Expr(OP, "+", $1, $3); }
43094323
| b_expr '-' b_expr
@@ -4312,6 +4326,8 @@ b_expr: attr opt_indirection
43124326
{ $$ = makeA_Expr(OP, "/", $1, $3); }
43134327
| b_expr '%' b_expr
43144328
{ $$ = makeA_Expr(OP, "%", $1, $3); }
4329+
| b_expr '^' b_expr
4330+
{ $$ = makeA_Expr(OP, "^", $1, $3); }
43154331
| b_expr '*' b_expr
43164332
{ $$ = makeA_Expr(OP, "*", $1, $3); }
43174333
| ':' b_expr

src/backend/parser/scan.l

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.49 1999/05/12 07:12:51 thomas Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.50 1999/07/08 00:00:43 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -155,7 +155,7 @@ identifier {letter}{letter_or_digit}*
155155

156156
typecast "::"
157157

158-
self [,()\[\].;$\:\+\-\*\/\%\<\>\=\|]
158+
self [,()\[\].;$\:\+\-\*\/\%\^\<\>\=\|]
159159
op_and_self [\~\!\@\#\^\&\|\`\?\$\:\+\-\*\/\%\<\>\=]
160160
operator {op_and_self}+
161161

0 commit comments

Comments
 (0)