Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ac3884e

Browse files
author
Michael Meskes
committed
*** empty log message ***
1 parent 3097788 commit ac3884e

File tree

3 files changed

+53
-5
lines changed

3 files changed

+53
-5
lines changed

src/interfaces/ecpg/ChangeLog

+4
Original file line numberDiff line numberDiff line change
@@ -871,5 +871,9 @@ Wed Mar 15 17:36:02 CET 2000
871871
Sun Mar 19 11:03:13 CET 2000
872872

873873
- Fixed quoting bug in disconnect statement.
874+
875+
Thu Mar 23 08:13:39 CET 2000
876+
877+
- Synced preproc.y and keyword.c.
874878
- Set library version to 3.1.0.
875879
- Set ecpg version to 2.7.0.

src/interfaces/ecpg/preproc/keywords.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.24 2000/03/15 19:09:10 meskes Exp $
11+
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.25 2000/03/23 07:53:48 meskes Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -48,6 +48,7 @@ static ScanKeyword ScanKeywords[] = {
4848
{"begin", BEGIN_TRANS},
4949
{"between", BETWEEN},
5050
{"binary", BINARY},
51+
{"bit", BIT},
5152
{"both", BOTH},
5253
{"by", BY},
5354
{"cache", CACHE},

src/interfaces/ecpg/preproc/preproc.y

+47-4
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ make_name(void)
223223
* - Todd A. Brandys 1998-01-01?
224224
*/
225225
%token ABORT_TRANS, ACCESS, AFTER, AGGREGATE, ANALYZE,
226-
BACKWARD, BEFORE, BINARY,
226+
BACKWARD, BEFORE, BINARY, BIT
227227
CACHE, CLUSTER, COMMENT, COPY, CREATEDB, CREATEUSER, CYCLE,
228228
DATABASE, DELIMITERS, DO,
229229
EACH, ENCODING, EXCLUSIVE, EXPLAIN, EXTEND,
@@ -326,7 +326,7 @@ make_name(void)
326326
%type <str> CreatePLangStmt IntegerOnly TriggerFuncArgs TriggerFuncArg
327327
%type <str> ViewStmt LoadStmt CreatedbStmt createdb_opt_encoding
328328
%type <str> createdb_opt_location opt_encoding AlterTableStmt
329-
%type <str> DropdbStmt ClusterStmt grantee RevokeStmt table_expr
329+
%type <str> DropdbStmt ClusterStmt grantee RevokeStmt table_expr Bit bit
330330
%type <str> GrantStmt privileges operation_commalist operation
331331
%type <str> opt_cursor opt_lmode ConstraintsSetStmt comment_tg
332332
%type <str> case_expr when_clause_list case_default case_arg when_clause
@@ -2899,6 +2899,7 @@ Typename: SimpleTypename opt_array_bounds
28992899
SimpleTypename: Generic { $$ = $1; }
29002900
| Datetime { $$ = $1; }
29012901
| Numeric { $$ = $1; }
2902+
| Bit { $$ = $1; }
29022903
| Character { $$ = $1; }
29032904
;
29042905

@@ -3059,6 +3060,35 @@ opt_decimal: '(' Iconst ',' Iconst ')'
30593060
}
30603061
;
30613062

3063+
/*
3064+
* SQL92 bit-field data types
3065+
* The following implements BIT() and BIT VARYING().
3066+
*/
3067+
Bit: bit '(' Iconst ')'
3068+
{
3069+
$$ = cat_str(4, $1, make_str("("), $3, make_str(")"));
3070+
if (atol($3) < 1)
3071+
{
3072+
sprintf(errortext,"length for type '%s' must be at least 1",$1);
3073+
mmerror(ET_ERROR, errortext);
3074+
}
3075+
else if (atol($3) > (MaxAttrSize *sizeof(char)))
3076+
{
3077+
sprintf(errortext, "length for type '%s' cannot exceed %ld", $1,
3078+
(MaxAttrSize * sizeof(char)));
3079+
}
3080+
}
3081+
| bit
3082+
{
3083+
$$ = $1;
3084+
}
3085+
;
3086+
3087+
bit: BIT opt_varying
3088+
{
3089+
$$ = cat2_str(make_str("bit"), $2);
3090+
}
3091+
30623092
/*
30633093
* SQL92 character data types
30643094
* The following implements CHAR() and VARCHAR().
@@ -3250,6 +3280,8 @@ a_expr: c_expr
32503280
* If you add more explicitly-known operators, be sure to add them
32513281
* also to b_expr and to the MathOp list above.
32523282
*/
3283+
| '+' a_expr %prec UMINUS
3284+
{ $$ = cat2_str(make_str("+"), $2); }
32533285
| '-' a_expr %prec UMINUS
32543286
{ $$ = cat2_str(make_str("-"), $2); }
32553287
| '%' a_expr
@@ -3262,7 +3294,10 @@ a_expr: c_expr
32623294
{ $$ = cat2_str(make_str(":"), $2); }
32633295
*/
32643296
| ';' a_expr
3265-
{ $$ = cat2_str(make_str(";"), $2); }
3297+
{ $$ = cat2_str(make_str(";"), $2);
3298+
mmerror(ET_WARN, "The ';' operator is deprecated. Use ln(x) instead."
3299+
"\n\tThis operator will be removed in a future release.");
3300+
}
32663301
| a_expr '%'
32673302
{ $$ = cat2_str($1, make_str("%")); }
32683303
| a_expr '^'
@@ -3380,7 +3415,10 @@ b_expr: c_expr
33803415
{ $$ = cat2_str(make_str(":"), $2); }
33813416
*/
33823417
| ';' b_expr
3383-
{ $$ = cat2_str(make_str(";"), $2); }
3418+
{ $$ = cat2_str(make_str(";"), $2);
3419+
mmerror(ET_WARN, "The ';' operator is deprecated. Use ln(x) instead."
3420+
"\n\tThis operator will be removed in a future release.");
3421+
}
33843422
| b_expr '%'
33853423
{ $$ = cat2_str($1, make_str("%")); }
33863424
| b_expr '^'
@@ -3810,6 +3848,8 @@ TypeId: ColId
38103848
{ $$ = $1; }
38113849
| numeric
38123850
{ $$ = $1; }
3851+
| bit
3852+
{ $$ = $1; }
38133853
| character
38143854
{ $$ = $1; }
38153855
;
@@ -4884,6 +4924,7 @@ ECPGColId: /* to be used instead of ColId */
48844924
| EACH { $$ = make_str("each"); }
48854925
| ENCODING { $$ = make_str("encoding"); }
48864926
| EXCLUSIVE { $$ = make_str("exclusive"); }
4927+
| FORCE { $$ = make_str("force"); }
48874928
| FORWARD { $$ = make_str("forward"); }
48884929
| FUNCTION { $$ = make_str("function"); }
48894930
| HANDLER { $$ = make_str("handler"); }
@@ -4957,7 +4998,9 @@ ECPGColLabel: ECPGColId { $$ = $1; }
49574998
| ABORT_TRANS { $$ = make_str("abort"); }
49584999
| ANALYZE { $$ = make_str("analyze"); }
49595000
| BINARY { $$ = make_str("binary"); }
5001+
| BIT { $$ = make_str("bit"); }
49605002
| CASE { $$ = make_str("case"); }
5003+
| CHARACTER { $$ = make_str("character"); }
49615004
| CLUSTER { $$ = make_str("cluster"); }
49625005
| COALESCE { $$ = make_str("coalesce"); }
49635006
| CONSTRAINT { $$ = make_str("constraint"); }

0 commit comments

Comments
 (0)