Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite7c8022

Browse files
committed
Fix counting of lines in scripts with 'copy from stdin'.
1 parent6969b8f commite7c8022

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎src/bin/psql/copy.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/copy.c,v 1.15 2000/04/16 15:46:40 petere Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/copy.c,v 1.16 2000/12/03 15:39:38 petere Exp $
77
*/
88
#include"postgres.h"
99
#include"copy.h"
@@ -403,6 +403,7 @@ handleCopyIn(PGconn *conn, FILE *copystream, const char *prompt)
403403
intbufleft;
404404
intc=0;
405405
intret;
406+
unsignedintlinecount=0;
406407

407408
#ifdefUSE_ASSERT_CHECKING
408409
assert(copy_in_state);
@@ -458,8 +459,10 @@ handleCopyIn(PGconn *conn, FILE *copystream, const char *prompt)
458459
}
459460
}
460461
PQputline(conn,"\n");
462+
linecount++;
461463
}
462464
ret= !PQendcopy(conn);
463465
copy_in_state= false;
466+
pset.lineno+=linecount;
464467
returnret;
465468
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp