提交 63d5743a 编写于 作者: H Heikki Linnakangas

Add missing 'consttypmod' field to outfast/readfast functions.

This field was added to Const struct and the text out/read functions in
PostgreSQL 8.3 (upstream commit 0f4ff460). In the merge, we missed that
it also needs to be handled in the "fast" out/read functions.

I wasn't able to come up with a test case that would misbehave because of
this. When a Const is dispatched from the master to segments, the typmod
has already been "applied" to the value, e.g. a numeric has been rounded
to the desired precision. So it doesn't matter that the typmod is not
available in the segments. However, gpcheckcat complained about the
mismatch, in index expressions stored between the master and segments, as
well as in atttypmod stored for a view. And if we leave the typmod
uninitialized, it's left to 0, rather than -1 which would mean "no typmod",
so clearly this must be fixed, even if it doesn't have any user-visible
effects at the moment.

Reported by Jimmy.
上级 e8cf3855
......@@ -536,6 +536,7 @@ _outConst(StringInfo str, Const *node)
WRITE_NODE_TYPE("CONST");
WRITE_OID_FIELD(consttype);
WRITE_INT_FIELD(consttypmod);
WRITE_INT_FIELD(constlen);
WRITE_BOOL_FIELD(constbyval);
WRITE_BOOL_FIELD(constisnull);
......
......@@ -374,6 +374,7 @@ _readConst(void)
READ_LOCALS(Const);
READ_OID_FIELD(consttype);
READ_INT_FIELD(consttypmod);
READ_INT_FIELD(constlen);
READ_BOOL_FIELD(constbyval);
READ_BOOL_FIELD(constisnull);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册