copy.patch
application/octet-stream
Filename: copy.patch
Type: application/octet-stream
Part: 1
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: context
| File | + | − |
|---|---|---|
| src/backend/commands/copy.c | 12 | 3 |
*** org/postgresql-6.5.3/src/backend/commands/copy.c Sat Jul 3 02:32:39 1999
--- postgresql-6.5.3/src/backend/commands/copy.c Tue Apr 18 22:15:30 2000
***************
*** 132,137 ****
--- 132,140 ----
fread(databuf, datasize, 1, fp);
}
+
+ static int lastHitEOF;
+
static int
CopyGetChar(FILE *fp)
{
***************
*** 139,146 ****
{
unsigned char ch;
! if (pq_getbytes((char *) &ch, 1))
return EOF;
return ch;
}
else
--- 142,152 ----
{
unsigned char ch;
! if (pq_getbytes((char *) &ch, 1)) {
! lastHitEOF= 1;
return EOF;
+ }
+ lastHitEOF= 0;
return ch;
}
else
***************
*** 151,158 ****
CopyGetEof(FILE *fp)
{
if (!fp)
! return 0; /* Never return EOF when talking to
! * frontend ? */
else
return feof(fp);
}
--- 157,167 ----
CopyGetEof(FILE *fp)
{
if (!fp)
! #if 0
! return 0; /* Never return EOF when talking to frontend ? */
! #else
! return lastHitEOF;
! #endif
else
return feof(fp);
}