Commit 1ebc028c authored by Michael Meskes's avatar Michael Meskes

- Fixed GRANT statement.

        - Synced preproc.y with gram.y.
parent e482dcb0
...@@ -1102,28 +1102,32 @@ Tue Sep 25 20:10:03 CEST 2001 ...@@ -1102,28 +1102,32 @@ Tue Sep 25 20:10:03 CEST 2001
- Synced preproc.y with gram.y. - Synced preproc.y with gram.y.
- Changed locale handling. - Changed locale handling.
Mon Okt 1 13:49:40 CEST 2001 Mon Oct 1 13:49:40 CEST 2001
- Fixed truncate bug. - Fixed truncate bug.
- Added patch by Christof Petig <christof.petig@wtal.de> to clean up - Added patch by Christof Petig <christof.petig@wtal.de> to clean up
ecpglib. ecpglib.
TUe Okt 2 16:09:26 CEST 2001 TUe Oct 2 16:09:26 CEST 2001
- Re-added Tom's patch fixing my setlocale patch. I accidently - Re-added Tom's patch fixing my setlocale patch. I accidently
deleted it. deleted it.
Fri Okt 5 08:37:01 CEST 2001 Fri Oct 5 08:37:01 CEST 2001
- Fixed yet another typo in preproc.y. - Fixed yet another typo in preproc.y.
Fri Okt 5 19:33:46 CEST 2001 Fri Oct 5 19:33:46 CEST 2001
- Make sure every call to ECPGraise is logged. - Make sure every call to ECPGraise is logged.
Mon Okt 8 10:10:23 CEST 2001 Mon Oct 8 10:10:23 CEST 2001
- Fix include file so library is binary compatible again. - Fix include file so library is binary compatible again.
Sun Oct 14 14:07:59 CEST 2001
- Fixed GRANT statement.
- Synced preproc.y with gram.y.
- Set ecpg version to 2.9.0. - Set ecpg version to 2.9.0.
- Set library version to 3.3.0. - Set library version to 3.3.0.
...@@ -192,8 +192,8 @@ make_name(void) ...@@ -192,8 +192,8 @@ make_name(void)
PARTIAL, PATH_P, POSITION, PRECISION, PRIMARY, PRIOR, PRIVILEGES, PROCEDURE, PUBLIC, PARTIAL, PATH_P, POSITION, PRECISION, PRIMARY, PRIOR, PRIVILEGES, PROCEDURE, PUBLIC,
READ, REFERENCES, RELATIVE, REVOKE, RIGHT, ROLLBACK, READ, REFERENCES, RELATIVE, REVOKE, RIGHT, ROLLBACK,
SCHEMA, SCROLL, SECOND_P, SELECT, SESSION, SESSION_USER, SET, SOME, SUBSTRING, SCHEMA, SCROLL, SECOND_P, SELECT, SESSION, SESSION_USER, SET, SOME, SUBSTRING,
TABLE, TEMPORARY, THEN, TIME, TIMESTAMP, TIMEZONE_HOUR, TABLE, TEMPORARY, THEN, TIME, TIMESTAMP
TIMEZONE_MINUTE, TO, TRAILING, TRANSACTION, TRIM, TRUE_P, TO, TRAILING, TRANSACTION, TRIM, TRUE_P,
UNENCRYPTED, UNION, UNIQUE, UNKNOWN, UPDATE, USER, USING, UNENCRYPTED, UNION, UNIQUE, UNKNOWN, UPDATE, USER, USING,
VALUES, VARCHAR, VARYING, VIEW, VALUES, VARCHAR, VARYING, VIEW,
WHEN, WHERE, WITH, WITHOUT, WORK, YEAR_P, ZONE WHEN, WHERE, WITH, WITHOUT, WORK, YEAR_P, ZONE
...@@ -335,7 +335,7 @@ make_name(void) ...@@ -335,7 +335,7 @@ make_name(void)
%type <str> opt_level opt_lock lock_type OptGroupList OptGroupElem %type <str> opt_level opt_lock lock_type OptGroupList OptGroupElem
%type <str> OptConstrFromTable OptTempTableName StringConst %type <str> OptConstrFromTable OptTempTableName StringConst
%type <str> constraints_set_list constraints_set_namelist %type <str> constraints_set_list constraints_set_namelist
%type <str> constraints_set_mode comment_type %type <str> constraints_set_mode comment_type opt_empty_parentheses
%type <str> CreateGroupStmt AlterGroupStmt DropGroupStmt key_delete %type <str> CreateGroupStmt AlterGroupStmt DropGroupStmt key_delete
%type <str> opt_force key_update CreateSchemaStmt PosIntStringConst %type <str> opt_force key_update CreateSchemaStmt PosIntStringConst
%type <str> IntConst PosIntConst grantee_list func_type opt_or_replace %type <str> IntConst PosIntConst grantee_list func_type opt_or_replace
...@@ -1693,7 +1693,7 @@ comment_text: StringConst { $$ = $1; } ...@@ -1693,7 +1693,7 @@ comment_text: StringConst { $$ = $1; }
GrantStmt: GRANT privileges ON opt_table relation_name_list TO grantee_list opt_with_grant GrantStmt: GRANT privileges ON opt_table relation_name_list TO grantee_list opt_with_grant
{ {
$$ = cat_str(8, make_str("grant"), $2, make_str("on"), $4, $5, make_str("to"), $7); $$ = cat_str(7, make_str("grant"), $2, make_str("on"), $4, $5, make_str("to"), $7);
} }
; ;
...@@ -3064,19 +3064,19 @@ bit: BIT opt_varying ...@@ -3064,19 +3064,19 @@ bit: BIT opt_varying
* The following implements CHAR() and VARCHAR(). * The following implements CHAR() and VARCHAR().
* - ay 6/95 * - ay 6/95
*/ */
Character: character '(' PosIntConst ')' Character: character '(' PosIntConst ')' opt_charset
{ {
$$ = cat_str(4, $1, make_str("("), $3, make_str(")")); $$ = cat_str(5, $1, make_str("("), $3, make_str(")"), $5);
} }
| character | character opt_charset
{ {
$$ = $1; $$ = cat2_str($1, $2);
} }
; ;
character: CHARACTER opt_varying opt_charset character: CHARACTER opt_varying
{ {
$$ = cat_str(3, make_str("character"), $2, $3); $$ = cat2_str(make_str("character"), $2);
} }
| CHAR opt_varying { $$ = cat2_str(make_str("char"), $2); } | CHAR opt_varying { $$ = cat2_str(make_str("char"), $2); }
| VARCHAR { $$ = make_str("varchar"); } | VARCHAR { $$ = make_str("varchar"); }
...@@ -3101,10 +3101,18 @@ ConstDatetime: datetime ...@@ -3101,10 +3101,18 @@ ConstDatetime: datetime
{ {
$$ = $1; $$ = $1;
} }
| TIMESTAMP '(' PosIntConst ')' opt_timezone
{
$$ = cat_str(4, make_str("timestamp("), $3, make_str(")"), $5);
}
| TIMESTAMP opt_timezone | TIMESTAMP opt_timezone
{ {
$$ = cat2_str(make_str("timestamp"), $2); $$ = cat2_str(make_str("timestamp"), $2);
} }
| TIME '(' PosIntConst ')' opt_timezone
{
$$ = cat_str(4, make_str("time("), $3, make_str(")"), $5);
}
| TIME opt_timezone | TIME opt_timezone
{ {
$$ = cat2_str(make_str("time"), $2); $$ = cat2_str(make_str("time"), $2);
...@@ -3439,36 +3447,24 @@ c_expr: attr ...@@ -3439,36 +3447,24 @@ c_expr: attr
{ $$ = cat2_str($1, make_str("(*)")); } { $$ = cat2_str($1, make_str("(*)")); }
| CURRENT_DATE | CURRENT_DATE
{ $$ = make_str("current_date"); } { $$ = make_str("current_date"); }
| CURRENT_TIME | CURRENT_TIME opt_empty_parentheses
{ $$ = make_str("current_time"); } { $$ = cat2_str(make_str("current_time"), $2); }
| CURRENT_TIME '(' PosIntConst ')' | CURRENT_TIME '(' PosIntConst ')'
{ {
if (atol($3) != 0)
{
sprintf(errortext, "CURRENT_TIME(%s) precision not implemented; backend will use zero instead", $3);
mmerror(ET_NOTICE, errortext);
}
$$ = make_str("current_time"); $$ = make_str("current_time");
} }
| CURRENT_TIMESTAMP | CURRENT_TIMESTAMP opt_empty_parentheses
{ $$ = make_str("current_timestamp"); } { $$ = cat2_str(make_str("current_timestamp"), $2); }
| CURRENT_TIMESTAMP '(' PosIntConst ')' | CURRENT_TIMESTAMP '(' PosIntConst ')'
{ {
if (atol($3) != 0)
{
sprintf(errortext, "CURRENT_TIMESTAMP(%s) precision not implemented; backend will use zero instead", $3);
mmerror(ET_NOTICE, errortext);
}
$$ = make_str("current_timestamp"); $$ = make_str("current_timestamp");
} }
| CURRENT_USER | CURRENT_USER opt_empty_parentheses
{ $$ = make_str("current_user"); } { $$ = cat2_str(make_str("current_user"), $2); }
| SESSION_USER | SESSION_USER opt_empty_parentheses
{ $$ = make_str("session_user"); } { $$ = cat2_str(make_str("session_user"), $2); }
| USER | USER opt_empty_parentheses
{ $$ = make_str("user"); } { $$ = cat2_str(make_str("user"), $2); }
| EXTRACT '(' extract_list ')' | EXTRACT '(' extract_list ')'
{ $$ = cat_str(3, make_str("extract("), $3, make_str(")")); } { $$ = cat_str(3, make_str("extract("), $3, make_str(")")); }
| POSITION '(' position_list ')' | POSITION '(' position_list ')'
...@@ -3528,8 +3524,6 @@ extract_list: extract_arg FROM a_expr ...@@ -3528,8 +3524,6 @@ extract_list: extract_arg FROM a_expr
extract_arg: datetime { $$ = $1; } extract_arg: datetime { $$ = $1; }
| SCONST { $$ = $1; } | SCONST { $$ = $1; }
| IDENT { $$ = $1; } | IDENT { $$ = $1; }
| TIMEZONE_HOUR { $$ = make_str("timezone_hour"); }
| TIMEZONE_MINUTE { $$ = make_str("timezone_minute"); }
; ;
/* position_list uses b_expr not a_expr to avoid conflict with general IN */ /* position_list uses b_expr not a_expr to avoid conflict with general IN */
...@@ -3663,6 +3657,8 @@ attrs: attr_name ...@@ -3663,6 +3657,8 @@ attrs: attr_name
{ $$ = make2_str($1, make_str(".*")); } { $$ = make2_str($1, make_str(".*")); }
; ;
opt_empty_parentheses: '(' ')' { $$ = make_str("()"); }
| /*EMPTY*/ { $$ = EMPTY; }
/***************************************************************************** /*****************************************************************************
* *
...@@ -5063,8 +5059,6 @@ TokenId: ABSOLUTE { $$ = make_str("absolute"); } ...@@ -5063,8 +5059,6 @@ TokenId: ABSOLUTE { $$ = make_str("absolute"); }
| TEMP { $$ = make_str("temp"); } | TEMP { $$ = make_str("temp"); }
| TEMPLATE { $$ = make_str("template"); } | TEMPLATE { $$ = make_str("template"); }
| TEMPORARY { $$ = make_str("temporary"); } | TEMPORARY { $$ = make_str("temporary"); }
| TIMEZONE_HOUR { $$ = make_str("timezone_hour"); }
| TIMEZONE_MINUTE { $$ = make_str("timezone_minute"); }
| TOAST { $$ = make_str("toast"); } | TOAST { $$ = make_str("toast"); }
| TRIGGER { $$ = make_str("trigger"); } | TRIGGER { $$ = make_str("trigger"); }
| TRUNCATE { $$ = make_str("truncate"); } | TRUNCATE { $$ = make_str("truncate"); }
...@@ -5092,8 +5086,6 @@ ECPGColId: ident { $$ = $1; } ...@@ -5092,8 +5086,6 @@ ECPGColId: ident { $$ = $1; }
| NATIONAL { $$ = make_str("national"); } | NATIONAL { $$ = make_str("national"); }
| NONE { $$ = make_str("none"); } | NONE { $$ = make_str("none"); }
| PATH_P { $$ = make_str("path_p"); } | PATH_P { $$ = make_str("path_p"); }
| TIME { $$ = make_str("time"); }
| TIMESTAMP { $$ = make_str("timestamp"); }
| ECPGKeywords { $$ = $1; } | ECPGKeywords { $$ = $1; }
; ;
...@@ -5195,6 +5187,8 @@ ECPGColLabel: ECPGColId { $$ = $1; } ...@@ -5195,6 +5187,8 @@ ECPGColLabel: ECPGColId { $$ = $1; }
| SUBSTRING { $$ = make_str("substring"); } | SUBSTRING { $$ = make_str("substring"); }
| TABLE { $$ = make_str("table"); } | TABLE { $$ = make_str("table"); }
| THEN { $$ = make_str("then"); } | THEN { $$ = make_str("then"); }
| TIME { $$ = make_str("time"); }
| TIMESTAMP { $$ = make_str("timestamp"); }
| TO { $$ = make_str("to"); } | TO { $$ = make_str("to"); }
| TRANSACTION { $$ = make_str("transaction"); } | TRANSACTION { $$ = make_str("transaction"); }
| TRIM { $$ = make_str("trim"); } | TRIM { $$ = make_str("trim"); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment