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
2f86ab77
Commit
2f86ab77
authored
Dec 28, 2007
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
79bb2638
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
41 deletions
+53
-41
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+7
-0
src/interfaces/ecpg/preproc/preproc.y
src/interfaces/ecpg/preproc/preproc.y
+2
-2
src/interfaces/ecpg/test/connect/test5.pgc
src/interfaces/ecpg/test/connect/test5.pgc
+2
-1
src/interfaces/ecpg/test/expected/connect-test5.c
src/interfaces/ecpg/test/expected/connect-test5.c
+35
-31
src/interfaces/ecpg/test/expected/connect-test5.stderr
src/interfaces/ecpg/test/expected/connect-test5.stderr
+7
-7
No files found.
src/interfaces/ecpg/ChangeLog
View file @
2f86ab77
...
...
@@ -2272,6 +2272,13 @@ Tue, 06 Nov 2007 09:29:22 +0100
Fri, 21 Dec 2007 15:30:39 +0100
- Fixed a few minor glitches pointed out by splint.
Fri, 28 Dec 2007 12:15:38 +0100
- Applied patch send by ITAGAKI Takahiro
<itagaki.takahiro@oss.ntt.co.jp> to fix bug in connect statement if
user name is a variable.
- Also fixed test case that didn't detect this.
- 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 @
2f86ab77
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.35
6 2007/12/21 14:33:20
meskes Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.35
7 2007/12/28 11:25:21
meskes Exp $ */
/* Copyright comment */
%{
...
...
@@ -5114,7 +5114,7 @@ user_name: RoleId
{
if ($1[0] == '\"')
$$ = $1;
else if (
strcmp($1, " ?") == 0
) /* variable */
else if (
$1[1] == '$'
) /* variable */
{
enum ECPGttype type = argsinsert->variable->type->type;
...
...
src/interfaces/ecpg/test/connect/test5.pgc
View file @
2f86ab77
...
...
@@ -15,6 +15,7 @@ main(void)
exec sql begin declare section;
char db[200];
char id[200];
char *user="connectuser";
exec sql end declare section;
ECPGdebug(1, stderr);
...
...
@@ -49,7 +50,7 @@ exec sql end declare section;
exec sql connect to "unix:postgresql://localhost/connectdb" as main user connectuser;
exec sql disconnect main;
exec sql connect to 'unix:postgresql://localhost/connectdb' as main user
connect
user;
exec sql connect to 'unix:postgresql://localhost/connectdb' as main user
:
user;
exec sql disconnect main;
exec sql connect to "unix:postgresql://200.46.204.71/connectdb" as main user connectuser;
...
...
src/interfaces/ecpg/test/expected/connect-test5.c
View file @
2f86ab77
...
...
@@ -25,121 +25,125 @@ main(void)
/* exec sql begin declare section */
#line 16 "test5.pgc"
char
db
[
200
]
;
#line 17 "test5.pgc"
char
id
[
200
]
;
/* exec sql end declare section */
#line 18 "test5.pgc"
char
*
user
=
"connectuser"
;
/* exec sql end declare section */
#line 19 "test5.pgc"
ECPGdebug
(
1
,
stderr
);
{
ECPGconnect
(
__LINE__
,
0
,
"connectdb"
,
NULL
,
NULL
,
"main"
,
0
);
}
#line 2
2
"test5.pgc"
#line 2
3
"test5.pgc"
{
ECPGdo
(
__LINE__
,
0
,
1
,
NULL
,
0
,
ECPGst_normal
,
"alter user connectuser encrypted password 'connectpw'"
,
ECPGt_EOIT
,
ECPGt_EORT
);}
#line 2
3
"test5.pgc"
#line 2
4
"test5.pgc"
{
ECPGdisconnect
(
__LINE__
,
"CURRENT"
);}
#line 2
4
"test5.pgc"
#line 2
5
"test5.pgc"
/* <-- "main" not specified */
strcpy
(
db
,
"connectdb"
);
strcpy
(
id
,
"main"
);
{
ECPGconnect
(
__LINE__
,
0
,
db
,
NULL
,
NULL
,
id
,
0
);
}
#line 2
8
"test5.pgc"
#line 2
9
"test5.pgc"
{
ECPGdisconnect
(
__LINE__
,
id
);}
#line
29
"test5.pgc"
#line
30
"test5.pgc"
{
ECPGconnect
(
__LINE__
,
0
,
"connectdb"
,
NULL
,
NULL
,
"main"
,
0
);
}
#line 3
1
"test5.pgc"
#line 3
2
"test5.pgc"
{
ECPGdisconnect
(
__LINE__
,
"main"
);}
#line 3
2
"test5.pgc"
#line 3
3
"test5.pgc"
{
ECPGconnect
(
__LINE__
,
0
,
"connectdb"
,
NULL
,
NULL
,
"main"
,
0
);
}
#line 3
4
"test5.pgc"
#line 3
5
"test5.pgc"
{
ECPGdisconnect
(
__LINE__
,
"main"
);}
#line 3
5
"test5.pgc"
#line 3
6
"test5.pgc"
{
ECPGconnect
(
__LINE__
,
0
,
"connectdb"
,
NULL
,
NULL
,
"main"
,
0
);
}
#line 3
7
"test5.pgc"
#line 3
8
"test5.pgc"
{
ECPGdisconnect
(
__LINE__
,
"main"
);}
#line 3
8
"test5.pgc"
#line 3
9
"test5.pgc"
{
ECPGconnect
(
__LINE__
,
0
,
""
,
"connectdb"
,
NULL
,
"main"
,
0
);
}
#line 4
0
"test5.pgc"
#line 4
1
"test5.pgc"
{
ECPGdisconnect
(
__LINE__
,
"main"
);}
#line 4
1
"test5.pgc"
#line 4
2
"test5.pgc"
{
ECPGconnect
(
__LINE__
,
0
,
"connectdb"
,
"connectuser"
,
"connectdb"
,
"main"
,
0
);
}
#line 4
3
"test5.pgc"
#line 4
4
"test5.pgc"
{
ECPGdisconnect
(
__LINE__
,
"main"
);}
#line 4
4
"test5.pgc"
#line 4
5
"test5.pgc"
{
ECPGconnect
(
__LINE__
,
0
,
"unix:postgresql://localhost/connectdb"
,
"connectuser"
,
NULL
,
"main"
,
0
);
}
#line 4
6
"test5.pgc"
#line 4
7
"test5.pgc"
{
ECPGdisconnect
(
__LINE__
,
"main"
);}
#line 4
7
"test5.pgc"
#line 4
8
"test5.pgc"
{
ECPGconnect
(
__LINE__
,
0
,
"unix:postgresql://localhost/connectdb"
,
"connectuser"
,
NULL
,
"main"
,
0
);
}
#line
49
"test5.pgc"
#line
50
"test5.pgc"
{
ECPGdisconnect
(
__LINE__
,
"main"
);}
#line 5
0
"test5.pgc"
#line 5
1
"test5.pgc"
{
ECPGconnect
(
__LINE__
,
0
,
"unix:postgresql://localhost/connectdb"
,
"connectuser"
,
NULL
,
"main"
,
0
);
}
#line 5
2
"test5.pgc"
{
ECPGconnect
(
__LINE__
,
0
,
"unix:postgresql://localhost/connectdb"
,
user
,
NULL
,
"main"
,
0
);
}
#line 5
3
"test5.pgc"
{
ECPGdisconnect
(
__LINE__
,
"main"
);}
#line 5
3
"test5.pgc"
#line 5
4
"test5.pgc"
{
ECPGconnect
(
__LINE__
,
0
,
"unix:postgresql://200.46.204.71/connectdb"
,
"connectuser"
,
NULL
,
"main"
,
0
);
}
#line 5
5
"test5.pgc"
#line 5
6
"test5.pgc"
{
ECPGdisconnect
(
__LINE__
,
"main"
);}
#line 5
6
"test5.pgc"
#line 5
7
"test5.pgc"
{
ECPGconnect
(
__LINE__
,
0
,
"unix:postgresql://localhost/"
,
"connectdb"
,
NULL
,
"main"
,
0
);
}
#line 5
8
"test5.pgc"
#line 5
9
"test5.pgc"
{
ECPGdisconnect
(
__LINE__
,
"main"
);}
#line
59
"test5.pgc"
#line
60
"test5.pgc"
/* connect twice */
{
ECPGconnect
(
__LINE__
,
0
,
"connectdb"
,
NULL
,
NULL
,
"main"
,
0
);
}
#line 6
2
"test5.pgc"
#line 6
3
"test5.pgc"
{
ECPGconnect
(
__LINE__
,
0
,
"connectdb"
,
NULL
,
NULL
,
"main"
,
0
);
}
#line 6
3
"test5.pgc"
#line 6
4
"test5.pgc"
{
ECPGdisconnect
(
__LINE__
,
"main"
);}
#line 6
4
"test5.pgc"
#line 6
5
"test5.pgc"
/* not connected */
{
ECPGdisconnect
(
__LINE__
,
"nonexistant"
);}
#line 6
7
"test5.pgc"
#line 6
8
"test5.pgc"
return
(
0
);
...
...
src/interfaces/ecpg/test/expected/connect-test5.stderr
View file @
2f86ab77
...
...
@@ -2,11 +2,11 @@
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute line 2
3
: QUERY: alter user connectuser encrypted password 'connectpw' with 0 parameter on connection main
[NO_PID]: ecpg_execute line 2
4
: QUERY: alter user connectuser encrypted password 'connectpw' with 0 parameter on connection main
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute line 2
3
: using PQexec
[NO_PID]: ecpg_execute line 2
4
: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute line 2
3
Ok: ALTER ROLE
[NO_PID]: ecpg_execute line 2
4
Ok: ALTER ROLE
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection main closed.
[NO_PID]: sqlca: code: 0, state: 00000
...
...
@@ -46,11 +46,11 @@
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection main closed.
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: non-localhost access via sockets in line 5
5
[NO_PID]: ECPGconnect: non-localhost access via sockets in line 5
6
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode -402 in line 5
5, 'Could not connect to database connectdb in line 55
.'.
[NO_PID]: raising sqlcode -402 in line 5
6, 'Could not connect to database connectdb in line 56
.'.
[NO_PID]: sqlca: code: -402, state: 08001
[NO_PID]: raising sqlcode -220 in line 5
6, 'No such connection main in line 56
.'.
[NO_PID]: raising sqlcode -220 in line 5
7, 'No such connection main in line 57
.'.
[NO_PID]: sqlca: code: -220, state: 08003
[NO_PID]: ECPGconnect: opening database on <DEFAULT> port <DEFAULT> for user connectdb
[NO_PID]: sqlca: code: 0, state: 00000
...
...
@@ -62,5 +62,5 @@
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection main closed.
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode -220 in line 6
7, 'No such connection nonexistant in line 67
.'.
[NO_PID]: raising sqlcode -220 in line 6
8, 'No such connection nonexistant in line 68
.'.
[NO_PID]: sqlca: code: -220, state: 08003
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