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
3819afa7
Commit
3819afa7
authored
Dec 03, 2003
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added patch by Dave Cramer for array handling in ecpglib.
parent
e2605c83
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
10 deletions
+23
-10
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+8
-0
src/interfaces/ecpg/ecpglib/execute.c
src/interfaces/ecpg/ecpglib/execute.c
+15
-10
No files found.
src/interfaces/ecpg/ChangeLog
View file @
3819afa7
...
...
@@ -1714,3 +1714,11 @@ Mon Nov 3 15:43:19 CET 2003
- Set pgtypes library to 1.0.0
- Set compat library to 1.0.0
Wed Dec 3 09:45:21 CET 2003
- Added patch for array handling by Dave Cramer
- Set ecpg version to 3.1.0
- Set ecpg library to 4.1.0
- Set pgtypes library to 1.1.0
- Set compat library to 1.1.0
src/interfaces/ecpg/ecpglib/execute.c
View file @
3819afa7
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.
29 2003/11/29 19:52:08 pgsql
Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.
30 2003/12/03 08:49:17 meskes
Exp $ */
/*
* The aim is to get a simpler inteface to the database routines.
...
...
@@ -314,16 +314,21 @@ ECPGis_type_an_array(int type, const struct statement * stmt, const struct varia
sprintf
(
array_query
,
"select typlen from pg_type where oid=%d and typelem<>0"
,
type
);
query
=
PQexec
(
stmt
->
connection
->
connection
,
array_query
);
ECPGfree
(
array_query
);
if
(
PQresultStatus
(
query
)
==
PGRES_TUPLES_OK
)
if
(
PQresultStatus
(
query
)
==
PGRES_TUPLES_OK
)
{
isarray
=
(
atol
((
char
*
)
PQgetvalue
(
query
,
0
,
0
))
==
-
1
)
?
ECPG_ARRAY_ARRAY
:
ECPG_ARRAY_VECTOR
;
if
(
ECPGDynamicType
(
type
)
==
SQL3_CHARACTER
||
ECPGDynamicType
(
type
)
==
SQL3_CHARACTER_VARYING
)
{
/*
* arrays of character strings are not yet implemented
*/
if
(
PQntuples
(
query
)
==
0
)
isarray
=
ECPG_ARRAY_NONE
;
else
{
isarray
=
(
atol
((
char
*
)
PQgetvalue
(
query
,
0
,
0
))
==
-
1
)
?
ECPG_ARRAY_ARRAY
:
ECPG_ARRAY_VECTOR
;
if
(
ECPGDynamicType
(
type
)
==
SQL3_CHARACTER
||
ECPGDynamicType
(
type
)
==
SQL3_CHARACTER_VARYING
)
{
/*
* arrays of character strings are not yet implemented
*/
isarray
=
ECPG_ARRAY_NONE
;
}
}
}
PQclear
(
query
);
...
...
@@ -353,7 +358,7 @@ ECPGstore_result(const PGresult *results, int act_field,
{
ECPGlog
(
"ECPGexecute line %d: Incorrect number of matches: %d don't fit into array of %d
\n
"
,
stmt
->
lineno
,
ntuples
,
var
->
arrsize
);
ECPGraise
(
stmt
->
lineno
,
ECPG_TOO_MANY_MATCHES
,
ECPG_SQLSTATE_CARDINALITY_VIOLATION
,
NULL
);
ECPGraise
(
stmt
->
lineno
,
INFORMIX_MODE
(
stmt
->
compat
)
?
ECPG_INFORMIX_SUBSELECT_NOT_ONE
:
ECPG_TOO_MANY_MATCHES
,
ECPG_SQLSTATE_CARDINALITY_VIOLATION
,
NULL
);
return
false
;
}
}
...
...
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