From 8f72a5704854d292065886eb47ba18fbd504113e Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 1 Mar 2018 11:37:46 -0500 Subject: Fix format_type() to restore its old behavior. Commit a26116c6c accidentally changed the behavior of the SQL format_type() function while refactoring. For the reasons explained in that function's comment, a NULL typemod argument should behave differently from a -1 argument. Since we've managed to break this, add a regression test memorializing the intended behavior. In passing, be consistent about the type of the "flags" parameter. Noted by Rushabh Lathia, though I revised the patch some more. Discussion: https://postgr.es/m/CAGPqQf3RB2q-d2Awp_-x-Ur6aOxTUwnApt-vm-iTtceZxYnePg@mail.gmail.com --- contrib/postgres_fdw/deparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib/postgres_fdw/deparse.c') diff --git a/contrib/postgres_fdw/deparse.c b/contrib/postgres_fdw/deparse.c index 8cd5843885e..6e2fa1420c4 100644 --- a/contrib/postgres_fdw/deparse.c +++ b/contrib/postgres_fdw/deparse.c @@ -854,7 +854,7 @@ foreign_expr_walker(Node *node, static char * deparse_type_name(Oid type_oid, int32 typemod) { - uint8 flags = FORMAT_TYPE_TYPEMOD_GIVEN; + bits16 flags = FORMAT_TYPE_TYPEMOD_GIVEN; if (!is_builtin(type_oid)) flags |= FORMAT_TYPE_FORCE_QUALIFY; -- cgit v1.2.3