aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-05-05 12:46:04 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2017-05-05 12:46:04 -0400
commitb3a47cdfd692079e36d2055d7d93759e083263ca (patch)
tree05022d443d1d3eca0b7d5fa972cc7b74e1f12e3d
parent14722c69f924810ecf11769e8b9788b3f82d2a0e (diff)
downloadpostgresql-b3a47cdfd692079e36d2055d7d93759e083263ca.tar.gz
postgresql-b3a47cdfd692079e36d2055d7d93759e083263ca.zip
Suppress compiler warning about unportable pointer value.
Setting a pointer value to "0xdeadbeef" draws a warning from some compilers, and for good reason. Be less cute and just set it to NULL. In passing make some other cosmetic adjustments nearby. Discussion: https://postgr.es/m/CAJrrPGdW3EkU-CRobvVKYf3fJuBdgWyuGeAbNzAQ4yBh+bfb_Q@mail.gmail.com
-rw-r--r--src/backend/replication/logical/proto.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/backend/replication/logical/proto.c b/src/backend/replication/logical/proto.c
index 0db5bdf29aa..adc62a0f3bb 100644
--- a/src/backend/replication/logical/proto.c
+++ b/src/backend/replication/logical/proto.c
@@ -95,7 +95,7 @@ logicalrep_read_commit(StringInfo in, LogicalRepCommitData *commit_data)
uint8 flags = pq_getmsgbyte(in);
if (flags != 0)
- elog(ERROR, "unknown flags %u in commit message", flags);
+ elog(ERROR, "unrecognized flags %u in commit message", flags);
/* read fields */
commit_data->commit_lsn = pq_getmsgint64(in);
@@ -468,7 +468,6 @@ logicalrep_read_tuple(StringInfo in, LogicalRepTupleData *tuple)
for (i = 0; i < natts; i++)
{
char kind;
- int len;
kind = pq_getmsgbyte(in);
@@ -479,10 +478,13 @@ logicalrep_read_tuple(StringInfo in, LogicalRepTupleData *tuple)
tuple->changed[i] = true;
break;
case 'u': /* unchanged column */
- tuple->values[i] = (char *) 0xdeadbeef; /* make bad usage more obvious */
+ /* we don't receive the value of an unchanged column */
+ tuple->values[i] = NULL;
break;
case 't': /* text formatted value */
{
+ int len;
+
tuple->changed[i] = true;
len = pq_getmsgint(in, 4); /* read length */
@@ -494,7 +496,7 @@ logicalrep_read_tuple(StringInfo in, LogicalRepTupleData *tuple)
}
break;
default:
- elog(ERROR, "unknown data representation type '%c'", kind);
+ elog(ERROR, "unrecognized data representation type '%c'", kind);
}
}
}