mirror of
https://github.com/postgres/postgres.git
synced 2025-09-03 15:22:11 +03:00
Replace remaining uses of pq_sendint with pq_sendint{8,16,32}.
pq_sendint() remains, so extension code doesn't unnecessarily break. Author: Andres Freund Discussion: https://postgr.es/m/20170914063418.sckdzgjfrsbekae4@alap3.anarazel.de
This commit is contained in:
@@ -444,32 +444,32 @@ SendTimeLineHistory(TimeLineHistoryCmd *cmd)
|
||||
|
||||
/* Send a RowDescription message */
|
||||
pq_beginmessage(&buf, 'T');
|
||||
pq_sendint(&buf, 2, 2); /* 2 fields */
|
||||
pq_sendint16(&buf, 2); /* 2 fields */
|
||||
|
||||
/* first field */
|
||||
pq_sendstring(&buf, "filename"); /* col name */
|
||||
pq_sendint(&buf, 0, 4); /* table oid */
|
||||
pq_sendint(&buf, 0, 2); /* attnum */
|
||||
pq_sendint(&buf, TEXTOID, 4); /* type oid */
|
||||
pq_sendint(&buf, -1, 2); /* typlen */
|
||||
pq_sendint(&buf, 0, 4); /* typmod */
|
||||
pq_sendint(&buf, 0, 2); /* format code */
|
||||
pq_sendint32(&buf, 0); /* table oid */
|
||||
pq_sendint16(&buf, 0); /* attnum */
|
||||
pq_sendint32(&buf, TEXTOID); /* type oid */
|
||||
pq_sendint16(&buf, -1); /* typlen */
|
||||
pq_sendint32(&buf, 0); /* typmod */
|
||||
pq_sendint16(&buf, 0); /* format code */
|
||||
|
||||
/* second field */
|
||||
pq_sendstring(&buf, "content"); /* col name */
|
||||
pq_sendint(&buf, 0, 4); /* table oid */
|
||||
pq_sendint(&buf, 0, 2); /* attnum */
|
||||
pq_sendint(&buf, BYTEAOID, 4); /* type oid */
|
||||
pq_sendint(&buf, -1, 2); /* typlen */
|
||||
pq_sendint(&buf, 0, 4); /* typmod */
|
||||
pq_sendint(&buf, 0, 2); /* format code */
|
||||
pq_sendint32(&buf, 0); /* table oid */
|
||||
pq_sendint16(&buf, 0); /* attnum */
|
||||
pq_sendint32(&buf, BYTEAOID); /* type oid */
|
||||
pq_sendint16(&buf, -1); /* typlen */
|
||||
pq_sendint32(&buf, 0); /* typmod */
|
||||
pq_sendint16(&buf, 0); /* format code */
|
||||
pq_endmessage(&buf);
|
||||
|
||||
/* Send a DataRow message */
|
||||
pq_beginmessage(&buf, 'D');
|
||||
pq_sendint(&buf, 2, 2); /* # of columns */
|
||||
pq_sendint16(&buf, 2); /* # of columns */
|
||||
len = strlen(histfname);
|
||||
pq_sendint(&buf, len, 4); /* col1 len */
|
||||
pq_sendint32(&buf, len); /* col1 len */
|
||||
pq_sendbytes(&buf, histfname, len);
|
||||
|
||||
fd = OpenTransientFile(path, O_RDONLY | PG_BINARY);
|
||||
@@ -489,7 +489,7 @@ SendTimeLineHistory(TimeLineHistoryCmd *cmd)
|
||||
(errcode_for_file_access(),
|
||||
errmsg("could not seek to beginning of file \"%s\": %m", path)));
|
||||
|
||||
pq_sendint(&buf, histfilelen, 4); /* col2 len */
|
||||
pq_sendint32(&buf, histfilelen); /* col2 len */
|
||||
|
||||
bytesleft = histfilelen;
|
||||
while (bytesleft > 0)
|
||||
@@ -646,7 +646,7 @@ StartReplication(StartReplicationCmd *cmd)
|
||||
/* Send a CopyBothResponse message, and start streaming */
|
||||
pq_beginmessage(&buf, 'W');
|
||||
pq_sendbyte(&buf, 0);
|
||||
pq_sendint(&buf, 0, 2);
|
||||
pq_sendint16(&buf, 0);
|
||||
pq_endmessage(&buf);
|
||||
pq_flush();
|
||||
|
||||
@@ -1065,7 +1065,7 @@ StartLogicalReplication(StartReplicationCmd *cmd)
|
||||
/* Send a CopyBothResponse message, and start streaming */
|
||||
pq_beginmessage(&buf, 'W');
|
||||
pq_sendbyte(&buf, 0);
|
||||
pq_sendint(&buf, 0, 2);
|
||||
pq_sendint16(&buf, 0);
|
||||
pq_endmessage(&buf);
|
||||
pq_flush();
|
||||
|
||||
|
Reference in New Issue
Block a user