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
1460c821
Commit
1460c821
authored
Jan 14, 2008
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set valid return values even in case of an error to prevent segfaults.
parent
b775d93a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
23 deletions
+56
-23
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+5
-0
src/interfaces/ecpg/preproc/preproc.y
src/interfaces/ecpg/preproc/preproc.y
+51
-23
No files found.
src/interfaces/ecpg/ChangeLog
View file @
1460c821
...
...
@@ -2288,6 +2288,11 @@ Sun, 13 Jan 2008 12:52:15 +0100
- Changed prototype for ECPGdo because some compilers don't like
int/enum aliasing in there.
Mon, 14 Jan 2008 10:42:23 +0100
- Set valid return values even in case of an error to prevent
segfaults.
- Set pgtypes library version to 3.0.
- Set compat library version to 3.0.
- Set ecpg library version to 6.0.
...
...
src/interfaces/ecpg/preproc/preproc.y
View file @
1460c821
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.35
7 2007/12/28 11:25:21
meskes Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.35
8 2008/01/14 09:43:42
meskes Exp $ */
/* Copyright comment */
%{
...
...
@@ -1288,7 +1288,10 @@ VariableShowStmt: SHOW var_name ecpg_into
| SHOW SESSION AUTHORIZATION ecpg_into
{ $$ = make_str("show session authorization"); }
| SHOW ALL
{ mmerror(PARSE_ERROR, ET_ERROR, "SHOW ALL not implemented"); }
{
mmerror(PARSE_ERROR, ET_ERROR, "SHOW ALL not implemented");
$$ = EMPTY;
}
;
VariableResetStmt: RESET var_name
...
...
@@ -2340,19 +2343,28 @@ fetch_direction: NEXT { $$ = make_str("next"); }
| LAST_P { $$ = make_str("last"); }
| ABSOLUTE_P IntConst {
if ($2[1] == '$')
mmerror(PARSE_ERROR, ET_ERROR, "fetch/move count must not be a variable.\n");
{
mmerror(PARSE_ERROR, ET_ERROR, "fetch/move count must not be a variable, ignoring it.\n");
$$ = make_str("absolute");
}
else
$$ = cat2_str(make_str("absolute"), $2);
}
| RELATIVE_P IntConst {
if ($2[1] == '$')
mmerror(PARSE_ERROR, ET_ERROR, "fetch/move count must not be a variable.\n");
{
mmerror(PARSE_ERROR, ET_ERROR, "fetch/move count must not be a variable, ignoring it.\n");
$$ = make_str("relative");
}
else
$$ = cat2_str(make_str("relative"), $2);
}
| IntConst {
if ($1[1] == '$')
mmerror(PARSE_ERROR, ET_ERROR, "fetch/move count must not be a variable.\n");
{
mmerror(PARSE_ERROR, ET_ERROR, "fetch/move count must not be a variablei, ignoring it.\n");
$$ = EMPTY;
}
else
$$ = $1;
}
...
...
@@ -2360,7 +2372,10 @@ fetch_direction: NEXT { $$ = make_str("next"); }
| FORWARD { $$ = make_str("forward"); }
| FORWARD IntConst {
if ($2[1] == '$')
mmerror(PARSE_ERROR, ET_ERROR, "fetch/move count must not be a variable.\n");
{
mmerror(PARSE_ERROR, ET_ERROR, "fetch/move count must not be a variable, ignoring it.\n");
$$ = make_str("forward");
}
else
$$ = cat2_str(make_str("forward"), $2);
}
...
...
@@ -2368,7 +2383,10 @@ fetch_direction: NEXT { $$ = make_str("next"); }
| BACKWARD { $$ = make_str("backward"); }
| BACKWARD IntConst {
if ($2[1] == '$')
mmerror(PARSE_ERROR, ET_ERROR, "fetch/move count must not be a variable.\n");
{
mmerror(PARSE_ERROR, ET_ERROR, "fetch/move count must not be a variable, ignoring it.\n");
$$ = make_str("backward");
}
else
$$ = cat2_str(make_str("backward"), $2);
}
...
...
@@ -2744,7 +2762,10 @@ RemoveOperStmt: DROP OPERATOR all_Op '(' oper_argtypes ')' opt_drop_behavior
;
oper_argtypes: Typename
{ mmerror(PARSE_ERROR, ET_ERROR, "parser: argument type missing (use NONE for unary operators)"); }
{
mmerror(PARSE_ERROR, ET_ERROR, "parser: argument type missing (use NONE for unary operators)");
$$ = make_str("none");
}
| Typename ',' Typename
{ $$ = cat_str(3, $1, make_str(","), $3); }
| NONE ',' Typename /* left unary */
...
...
@@ -3665,7 +3686,10 @@ select_limit: LIMIT select_limit_value OFFSET select_offset_value
| OFFSET select_offset_value
{ $$ = cat2_str(make_str("offset"), $2); }
| LIMIT select_limit_value ',' select_offset_value
{ mmerror(PARSE_ERROR, ET_WARNING, "No longer supported LIMIT #,# syntax passed to backend."); }
{
mmerror(PARSE_ERROR, ET_WARNING, "No longer supported LIMIT #,# syntax passed to backend.");
$$ = cat_str(4, make_str("limit"), $2, make_str(","), $4);
}
;
opt_select_limit: select_limit { $$ = $1; }
...
...
@@ -3757,25 +3781,28 @@ from_list: from_list ',' table_ref { $$ = cat_str(3, $1, make_str(","), $3); }
table_ref: relation_expr
{ $$ = $1; }
| relation_expr alias_clause
{ $$= cat2_str($1, $2); }
{ $$
= cat2_str($1, $2); }
| func_table
{ $$ = $1; }
| func_table alias_clause
{ $$= cat2_str($1, $2); }
{ $$
= cat2_str($1, $2); }
| func_table AS '(' TableFuncElementList ')'
{ $$
=
cat_str(4, $1, make_str("as ("), $4, make_str(")")); }
{ $$
=
cat_str(4, $1, make_str("as ("), $4, make_str(")")); }
| func_table AS ColId '(' TableFuncElementList ')'
{ $$
=
cat_str(6, $1, make_str("as"), $3, make_str("("), $5, make_str(")"));}
{ $$
=
cat_str(6, $1, make_str("as"), $3, make_str("("), $5, make_str(")"));}
| func_table ColId '(' TableFuncElementList ')'
{ $$
=
cat_str(5, $1, $2, make_str("("), $4, make_str(")")); }
{ $$
=
cat_str(5, $1, $2, make_str("("), $4, make_str(")")); }
| select_with_parens
{mmerror(PARSE_ERROR, ET_ERROR, "sub-SELECT in FROM must have an alias");}
{
mmerror(PARSE_ERROR, ET_ERROR, "sub-SELECT in FROM must have an alias");
$$ = $1;
}
| select_with_parens alias_clause
{ $$
=
cat2_str($1, $2); }
{ $$
=
cat2_str($1, $2); }
| joined_table
{ $$ = $1; }
| '(' joined_table ')' alias_clause
{ $$
=
cat_str(4, make_str("("), $2, make_str(")"), $4); }
{ $$
=
cat_str(4, make_str("("), $2, make_str(")"), $4); }
;
/*
...
...
@@ -5159,6 +5186,7 @@ char_variable: cvariable
break;
default:
mmerror(PARSE_ERROR, ET_ERROR, "invalid datatype");
$$ = $1;
break;
}
}
...
...
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