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
9b559046
Commit
9b559046
authored
Dec 24, 1996
by
Bryan Henderson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify error message about trying to PQgetvalue() nonexistent row.
parent
ab90c18d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
12 deletions
+17
-12
src/interfaces/libpq/fe-exec.c
src/interfaces/libpq/fe-exec.c
+17
-12
No files found.
src/interfaces/libpq/fe-exec.c
View file @
9b559046
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.2
2 1996/12/20 20:34:38 momjian
Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.2
3 1996/12/24 09:03:16 bryanh
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -1486,8 +1486,7 @@ const char* PQoidStatus(PGresult *res) {
...
@@ -1486,8 +1486,7 @@ const char* PQoidStatus(PGresult *res) {
/*
/*
PQgetvalue:
PQgetvalue:
return the attribute value of field 'field_num' of
return the value of field 'field_num' of row 'tup_num'
row 'tup_num'
If res is binary, then the value returned is NOT a null-terminated
If res is binary, then the value returned is NOT a null-terminated
ASCII string, but the binary representation in the server's native
ASCII string, but the binary representation in the server's native
...
@@ -1499,21 +1498,27 @@ char*
...
@@ -1499,21 +1498,27 @@ char*
PQgetvalue
(
PGresult
*
res
,
int
tup_num
,
int
field_num
)
PQgetvalue
(
PGresult
*
res
,
int
tup_num
,
int
field_num
)
{
{
if
(
!
res
)
{
if
(
!
res
)
{
fprintf
(
stderr
,
"PQgetvalue() -- pointer to PQresult is null"
);
fprintf
(
stderr
,
"PQgetvalue: pointer to PQresult is null
\n
"
);
return
NULL
;
}
else
if
(
tup_num
>
(
res
->
ntups
-
1
))
{
fprintf
(
stderr
,
"PQgetvalue: There is no row %d in the query results. "
"The highest numbered row is %d.
\n
"
,
tup_num
,
res
->
ntups
-
1
);
return
NULL
;
}
else
if
(
field_num
>
(
res
->
numAttributes
-
1
))
{
fprintf
(
stderr
,
"PQgetvalue: There is no field %d in the query results. "
"The highest numbered field is %d.
\n
"
,
field_num
,
res
->
numAttributes
-
1
);
return
NULL
;
return
NULL
;
}
if
(
tup_num
>
(
res
->
ntups
-
1
)
||
field_num
>
(
res
->
numAttributes
-
1
))
{
fprintf
(
stderr
,
"PQgetvalue: ERROR! field %d(of %d) of row %d(of %d) "
"is not available"
,
field_num
,
res
->
numAttributes
-
1
,
tup_num
,
res
->
ntups
);
}
}
return
res
->
tuples
[
tup_num
][
field_num
].
value
;
return
res
->
tuples
[
tup_num
][
field_num
].
value
;
}
}
/* PQgetlength:
/* PQgetlength:
returns the length of a field value in bytes. If res is binary,
returns the length of a field value in bytes. If res is binary,
i.e. a result of a binary portal, then the length returned does
i.e. a result of a binary portal, then the length returned does
...
...
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