]> granicus.if.org Git - postgresql/commitdiff
Fix IsBinaryCoercible to not confuse a cast using in/out functions
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 4 Mar 2010 09:39:53 +0000 (09:39 +0000)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 4 Mar 2010 09:39:53 +0000 (09:39 +0000)
with binary compatibility.

Backpatch to 8.4 where INOUT casts were introduced.

src/backend/parser/parse_coerce.c

index 2000dfb93a9b12f411b805bbb8434b8520404f45..45d2c35fa6b4e80b4b524344030556be86f7bc9a 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/parser/parse_coerce.c,v 2.181 2010/02/26 02:00:52 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/parser/parse_coerce.c,v 2.182 2010/03/04 09:39:53 heikki Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1792,7 +1792,7 @@ IsBinaryCoercible(Oid srctype, Oid targettype)
                return false;                   /* no cast */
        castForm = (Form_pg_cast) GETSTRUCT(tuple);
 
-       result = (castForm->castfunc == InvalidOid &&
+       result = (castForm->castmethod == COERCION_METHOD_BINARY &&
                          castForm->castcontext == COERCION_CODE_IMPLICIT);
 
        ReleaseSysCache(tuple);