Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
21e0b7b8
Commit
21e0b7b8
authored
22 years ago
by
Tom Lane
Browse files
Options
Downloads
Patches
Plain Diff
Get rid of extraneous newline in PQendcopy error output (was causing
regression test diffs...).
parent
efc3a25b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/interfaces/libpq/fe-protocol2.c
+21
-6
21 additions, 6 deletions
src/interfaces/libpq/fe-protocol2.c
src/interfaces/libpq/fe-protocol3.c
+9
-1
9 additions, 1 deletion
src/interfaces/libpq/fe-protocol3.c
with
30 additions
and
7 deletions
src/interfaces/libpq/fe-protocol2.c
+
21
−
6
View file @
21e0b7b8
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-protocol2.c,v 1.
2
2003/06/21 2
1:51
:3
4
tgl Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-protocol2.c,v 1.
3
2003/06/21 2
3:25
:3
8
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1183,15 +1183,30 @@ pqEndcopy2(PGconn *conn)
}
/*
* Trouble. The worst case is that we've lost sync with the backend
* entirely due to application screwup of the copy in/out protocol. To
* recover, reset the connection (talk about using a sledgehammer...)
* Trouble. For backwards-compatibility reasons, we issue the error
* message as if it were a notice (would be nice to get rid of this
* silliness, but too many apps probably don't handle errors from
* PQendcopy reasonably). Note that the app can still obtain the
* error status from the PGconn object.
*/
PQclear
(
result
);
if
(
conn
->
errorMessage
.
len
>
0
)
{
/* We have to strip the trailing newline ... pain in neck... */
char
svLast
=
conn
->
errorMessage
.
data
[
conn
->
errorMessage
.
len
-
1
];
if
(
svLast
==
'\n'
)
conn
->
errorMessage
.
data
[
conn
->
errorMessage
.
len
-
1
]
=
'\0'
;
PGDONOTICE
(
conn
,
conn
->
errorMessage
.
data
);
conn
->
errorMessage
.
data
[
conn
->
errorMessage
.
len
-
1
]
=
svLast
;
}
PQclear
(
result
);
/*
* The worst case is that we've lost sync with the backend
* entirely due to application screwup of the copy in/out protocol. To
* recover, reset the connection (talk about using a sledgehammer...)
*/
PGDONOTICE
(
conn
,
libpq_gettext
(
"lost synchronization with server, resetting connection"
));
/*
...
...
This diff is collapsed.
Click to expand it.
src/interfaces/libpq/fe-protocol3.c
+
9
−
1
View file @
21e0b7b8
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-protocol3.c,v 1.
2
2003/06/21 2
1:51
:3
4
tgl Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-protocol3.c,v 1.
3
2003/06/21 2
3:25
:3
8
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1113,7 +1113,15 @@ pqEndcopy3(PGconn *conn)
* error status from the PGconn object.
*/
if
(
conn
->
errorMessage
.
len
>
0
)
{
/* We have to strip the trailing newline ... pain in neck... */
char
svLast
=
conn
->
errorMessage
.
data
[
conn
->
errorMessage
.
len
-
1
];
if
(
svLast
==
'\n'
)
conn
->
errorMessage
.
data
[
conn
->
errorMessage
.
len
-
1
]
=
'\0'
;
PGDONOTICE
(
conn
,
conn
->
errorMessage
.
data
);
conn
->
errorMessage
.
data
[
conn
->
errorMessage
.
len
-
1
]
=
svLast
;
}
PQclear
(
result
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment