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
3f9ef2bf
Commit
3f9ef2bf
authored
Nov 28, 2007
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly recognize and announce input errors.
parent
492ae18f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
src/bin/psql/input.c
src/bin/psql/input.c
+10
-3
src/bin/psql/mainloop.c
src/bin/psql/mainloop.c
+5
-1
No files found.
src/bin/psql/input.c
View file @
3f9ef2bf
...
...
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2007, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/input.c,v 1.6
2 2007/01/05 22:19:49 momjian
Exp $
* $PostgreSQL: pgsql/src/bin/psql/input.c,v 1.6
3 2007/11/28 09:17:46 petere
Exp $
*/
#include "postgres_fe.h"
...
...
@@ -147,7 +147,7 @@ pg_send_history(PQExpBuffer history_buf)
* gets_fromFile
*
* Gets a line of noninteractive input from a file (which could be stdin).
* The result is a malloc'd string.
* The result is a malloc'd string
, or NULL on EOF or input error
.
*
* Caller *must* have set up sigint_interrupt_jmp before calling.
*
...
...
@@ -179,9 +179,16 @@ gets_fromFile(FILE *source)
/* Disable SIGINT again */
sigint_interrupt_enabled
=
false
;
/* EOF? */
/* EOF
or error
? */
if
(
result
==
NULL
)
{
if
(
ferror
(
source
))
{
psql_error
(
"could not read from input file: %s
\n
"
,
strerror
(
errno
));
return
NULL
;
}
break
;
}
appendPQExpBufferStr
(
buffer
,
line
);
...
...
src/bin/psql/mainloop.c
View file @
3f9ef2bf
...
...
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2007, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/mainloop.c,v 1.8
5 2007/01/05 22:19:49 momjian
Exp $
* $PostgreSQL: pgsql/src/bin/psql/mainloop.c,v 1.8
6 2007/11/28 09:17:46 petere
Exp $
*/
#include "postgres_fe.h"
#include "mainloop.h"
...
...
@@ -129,7 +129,11 @@ MainLoop(FILE *source)
line
=
gets_interactive
(
get_prompt
(
prompt_status
));
}
else
{
line
=
gets_fromFile
(
source
);
if
(
!
line
&&
ferror
(
source
))
successResult
=
EXIT_FAILURE
;
}
/*
* query_buf holds query already accumulated. line is the malloc'd
...
...
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