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
13b78a24
Commit
13b78a24
authored
Dec 22, 2000
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fixed bug in a connect statement using varchars.
- Synced parser.
parent
1deb6e7d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
29 deletions
+55
-29
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+5
-0
src/interfaces/ecpg/preproc/preproc.y
src/interfaces/ecpg/preproc/preproc.y
+46
-27
src/interfaces/ecpg/test/Makefile
src/interfaces/ecpg/test/Makefile
+1
-1
src/interfaces/ecpg/test/test4.pgc
src/interfaces/ecpg/test/test4.pgc
+3
-1
No files found.
src/interfaces/ecpg/ChangeLog
View file @
13b78a24
...
...
@@ -1029,5 +1029,10 @@ Mon Dec 18 12:27:52 CET 2000
- Synced gram.y and preproc.y.
- Synced keyword.c.
- Added several small patches from Christof.
Fri Dec 22 13:33:31 CET 2000
- Fixed bug in a connect statement using varchars.
- Synced gram.y and preproc.y.
- Set ecpg version to 2.8.0.
- Set library version to 3.2.0.
src/interfaces/ecpg/preproc/preproc.y
View file @
13b78a24
...
...
@@ -313,7 +313,7 @@ make_name(void)
%type <str> index_list func_index index_elem opt_class access_method_clause
%type <str> index_opt_unique IndexStmt func_return ConstInterval
%type <str> func_args_list func_args opt_with ProcedureStmt def_arg
%type <str> def_elem def_list definition
def_name def_type
DefineStmt
%type <str> def_elem def_list definition DefineStmt
%type <str> opt_instead event event_object RuleActionList opt_using
%type <str> RuleActionStmtOrEmpty RuleActionMulti func_as reindex_type
%type <str> RuleStmt opt_column opt_name oper_argtypes sysid_clause
...
...
@@ -1335,7 +1335,7 @@ OptSeqElem: CACHE IntConst
*****************************************************************************/
CreatePLangStmt: CREATE PLangTrusted opt_procedural LANGUAGE StringConst
HANDLER
def
_name LANCOMPILER StringConst
HANDLER
func
_name LANCOMPILER StringConst
{
$$ = cat_str(9, make_str("create"), $2, $3, make_str("language"), $5, make_str("handler"), $7, make_str("langcompiler"), $9);
}
...
...
@@ -1482,23 +1482,20 @@ DropTrigStmt: DROP TRIGGER name ON relation_name
*
*****************************************************************************/
DefineStmt: CREATE def_type def_name definition
{
$$ = cat_str(3, make_str("create"), $2, $3, $4);
}
;
def_type: OPERATOR { $$ = make_str("operator"); }
| TYPE_P { $$ = make_str("type"); }
| AGGREGATE { $$ = make_str("aggregate"); }
DefineStmt: CREATE AGGREGATE func_name definition
{
$$ = cat_str(3, make_str("create aggregate"), $3, $4);
}
| CREATE OPERATOR all_Op definition
{
$$ = cat_str(3, make_str("create operator"), $3, $4);
}
| CREATE TYPE_P name definition
{
$$ = cat_str(3, make_str("create type"), $3, $4);
}
;
def_name: PROCEDURE { $$ = make_str("procedure"); }
| JOIN { $$ = make_str("join"); }
| all_Op { $$ = $1; }
| ColId { $$ = $1; }
;
definition: '(' def_list ')' { $$ = cat_str(3, make_str("("), $2, make_str(")")); }
;
...
...
@@ -1506,17 +1503,13 @@ def_list: def_elem { $$ = $1; }
| def_list ',' def_elem { $$ = cat_str(3, $1, make_str(","), $3); }
;
def_elem:
def_name
'=' def_arg {
def_elem:
ColLabel
'=' def_arg {
$$ = cat_str(3, $1, make_str("="), $3);
}
|
def_name
|
ColLabel
{
$$ = $1;
}
| DEFAULT '=' def_arg
{
$$ = cat2_str(make_str("default ="), $3);
}
;
def_arg: func_return { $$ = $1; }
...
...
@@ -1977,7 +1970,7 @@ RemoveFuncStmt: DROP FUNCTION func_name func_args
}
;
RemoveAggrStmt: DROP AGGREGATE name aggr_argtype
RemoveAggrStmt: DROP AGGREGATE
func_
name aggr_argtype
{
$$ = cat_str(3, make_str("drop aggregate"), $3, $4);
}
...
...
@@ -3964,8 +3957,20 @@ connection_target: database_name opt_server opt_port
{
if ($1[0] == '\"')
$$ = $1;
else if (strcmp($1, "?") == 0)
$$ = mm_strdup(argsinsert->variable->name);
else if (strcmp($1, "?") == 0) /* variable */
{
enum ECPGttype typ = argsinsert->variable->type->typ;
/* if array see what's inside */
if (typ == ECPGt_array)
typ = argsinsert->variable->type->u.element->typ;
/* handle varchars */
if (typ == ECPGt_varchar)
$$ = make2_str(mm_strdup(argsinsert->variable->name), make_str(".arr"));
else
$$ = mm_strdup(argsinsert->variable->name);
}
else
$$ = make3_str(make_str("\""), $1, make_str("\""));
}
...
...
@@ -4040,6 +4045,20 @@ user_name: UserId {
| StringConst {
if ($1[0] == '\"')
$$ = $1;
else if (strcmp($1, "?") == 0) /* variable */
{
enum ECPGttype typ = argsinsert->variable->type->typ;
/* if array see what's inside */
if (typ == ECPGt_array)
typ = argsinsert->variable->type->u.element->typ;
/* handle varchars */
if (typ == ECPGt_varchar)
$$ = make2_str(mm_strdup(argsinsert->variable->name), make_str(".arr"));
else
$$ = mm_strdup(argsinsert->variable->name);
}
else
$$ = make3_str(make_str("\""), $1, make_str("\""));
}
...
...
@@ -5033,6 +5052,7 @@ TokenId: ABSOLUTE { $$ = make_str("absolute"); }
| PRIOR { $$ = make_str("prior"); }
| PRIVILEGES { $$ = make_str("privileges"); }
| PROCEDURAL { $$ = make_str("procedural"); }
| PROCEDURE { $$ = make_str("procedure"); }
| READ { $$ = make_str("read"); }
| REINDEX { $$ = make_str("reindex"); }
| RELATIVE { $$ = make_str("relative"); }
...
...
@@ -5180,7 +5200,6 @@ ECPGColLabel: ECPGColId { $$ = $1; }
| POSITION { $$ = make_str("position"); }
| PRECISION { $$ = make_str("precision"); }
| PRIMARY { $$ = make_str("primary"); }
| PROCEDURE { $$ = make_str("procedure"); }
| PUBLIC { $$ = make_str("public"); }
| REFERENCES { $$ = make_str("references"); }
| RESET { $$ = make_str("reset"); }
...
...
src/interfaces/ecpg/test/Makefile
View file @
13b78a24
...
...
@@ -23,4 +23,4 @@ test_init: test_init.c
$(ECPG)
$?
clean
:
rm
-f
test1 test2 test3 test4 perftest
*
.c log dyntest dyntest2 test_notice test_code100
rm
-f
test1 test2 test3 test4 perftest
*
.c log dyntest dyntest2 test_notice test_code100
test_init
src/interfaces/ecpg/test/test4.pgc
View file @
13b78a24
...
...
@@ -15,6 +15,7 @@ EXEC SQL BEGIN DECLARE SECTION;
char *t = "uvwxyz1234";
double f;
bool b = true;
varchar database[3];
EXEC SQL END DECLARE SECTION;
FILE *dbgs;
...
...
@@ -23,7 +24,8 @@ EXEC SQL END DECLARE SECTION;
if ((dbgs = fopen("log", "w")) != NULL)
ECPGdebug(1, dbgs);
EXEC SQL CONNECT TO mm;
strcpy(database.arr, "mm");
EXEC SQL CONNECT TO :database;
EXEC SQL SET AUTOCOMMIT = ON;
...
...
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