Skip to content

Commit 2d248d6

Browse files
author
Michael Meskes
committed
Parser synced.
1 parent 08ea624 commit 2d248d6

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,5 +1019,9 @@ Thu Nov 9 14:40:18 CET 2000
10191019
- Synced gram.y and preproc.y.
10201020
- Synced keyword.c.
10211021
- Added just another patch by Christof Petig.
1022+
1023+
Sat Nov 18 16:28:11 CET 2000
1024+
1025+
- Synced gram.y and preproc.y.
10221026
- Set ecpg version to 2.8.0.
10231027
- Set library version to 3.2.0.

src/interfaces/ecpg/preproc/preproc.y

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ make_name(void)
199199
READ, REFERENCES, RELATIVE, REVOKE, RIGHT, ROLLBACK,
200200
SCHEMA, SCROLL, SECOND_P, SELECT, SESSION, SESSION_USER, SET, SOME, SUBSTRING,
201201
TABLE, TEMPORARY, THEN, TIME, TIMESTAMP, TIMEZONE_HOUR,
202-
TIMEZONE_MINUTE, TO, TOAST, TRAILING, TRANSACTION, TRIM, TRUE_P,
202+
TIMEZONE_MINUTE, TO, TRAILING, TRANSACTION, TRIM, TRUE_P,
203203
UNION, UNIQUE, UPDATE, USER, USING,
204204
VALUES, VARCHAR, VARYING, VIEW,
205205
WHEN, WHERE, WITH, WITHOUT, WORK, YEAR_P, ZONE
@@ -232,7 +232,7 @@ make_name(void)
232232
OPERATOR, OWNER, PASSWORD, PROCEDURAL, REINDEX, RENAME, RESET,
233233
RETURNS, ROW, RULE, SEQUENCE, SERIAL, SETOF, SHARE,
234234
SHOW, START, STATEMENT, STDIN, STDOUT, SYSID TEMP,
235-
TRUNCATE, TRUSTED, UNDER, UNLISTEN, UNTIL, VACUUM,
235+
TEMPLATE, TOAST, TRUNCATE, TRUSTED, UNDER, UNLISTEN, UNTIL, VACUUM,
236236
VALID, VERBOSE, VERSION
237237

238238
/* The grammar thinks these are keywords, but they are not in the keywords.c
@@ -2251,11 +2251,8 @@ LoadStmt: LOAD file_name
22512251
*
22522252
*****************************************************************************/
22532253

2254-
CreatedbStmt: CREATE DATABASE database_name WITH createdb_opt_location createdb_opt_encoding
2254+
CreatedbStmt: CREATE DATABASE database_name WITH createdb_opt_list
22552255
{
2256-
if (strlen($5) == 0 || strlen($6) == 0)
2257-
mmerror(ET_ERROR, "CREATE DATABASE WITH requires at least an option.");
2258-
22592256
$$ = cat_str(5, make_str("create database"), $3, make_str("with"), $5, $6);
22602257
}
22612258
| CREATE DATABASE database_name
@@ -2264,20 +2261,24 @@ CreatedbStmt: CREATE DATABASE database_name WITH createdb_opt_location createdb
22642261
}
22652262
;
22662263

2267-
createdb_opt_location: LOCATION '=' StringConst { $$ = cat2_str(make_str("location ="), $3); }
2268-
| LOCATION '=' DEFAULT { $$ = make_str("location = default"); }
2269-
| /*EMPTY*/ { $$ = EMPTY; }
2270-
;
2264+
createdb_opt_list: createdb_opt_item
2265+
{ $$ = $1; }
2266+
| createdb_opt_list createdb_opt_item
2267+
{ $$ = cat2_str($1, $2); }
2268+
;
22712269

2272-
createdb_opt_encoding: ENCODING '=' PosIntStringConst
2270+
createdb_opt_item: LOCATION '=' StringConst { $$ = cat2_str(make_str("location ="), $3); }
2271+
| LOCATION '=' DEFAULT { $$ = make_str("location = default"); }
2272+
| TEMPLATE '=' name { $$ = cat2_str(make_str("template ="), $3); }
2273+
| TEMPLATE '=' DEFAULT { $$ = make_str("template = default"); }
2274+
| ENCODING '=' PosIntStringConst
22732275
{
22742276
$$ = cat2_str(make_str("encoding ="), $3);
22752277
}
22762278
| ENCODING '=' DEFAULT
22772279
{
22782280
$$ = make_str("encoding = default");
22792281
}
2280-
| /*EMPTY*/ { $$ = NULL; }
22812282
;
22822283

22832284
/*****************************************************************************
@@ -5076,6 +5077,7 @@ TokenId: ABSOLUTE { $$ = make_str("absolute"); }
50765077
| STDOUT { $$ = make_str("stdout"); }
50775078
| SYSID { $$ = make_str("sysid"); }
50785079
| TEMP { $$ = make_str("temp"); }
5080+
| TEMPLATE { $$ = make_str("template"); }
50795081
| TEMPORARY { $$ = make_str("temporary"); }
50805082
| TIMEZONE_HOUR { $$ = make_str("timezone_hour"); }
50815083
| TIMEZONE_MINUTE { $$ = make_str("timezone_minute"); }

0 commit comments

Comments
 (0)