diff --git a/pkg/sql/logictest/testdata/logic_test/pg_catalog b/pkg/sql/logictest/testdata/logic_test/pg_catalog index 284d8a6ed450..33456e8e999e 100644 --- a/pkg/sql/logictest/testdata/logic_test/pg_catalog +++ b/pkg/sql/logictest/testdata/logic_test/pg_catalog @@ -2167,7 +2167,7 @@ oid typname typinput typoutput typreceive 2249 record record_in record_out record_recv record_send 0 0 0 2277 anyarray anyarray_in anyarray_out anyarray_recv anyarray_send 0 0 0 2278 void voidin voidout voidrecv voidsend 0 0 0 -2279 trigger NULL NULL NULL NULL 0 0 0 +2279 trigger - - - - 0 0 0 2283 anyelement anyelement_in anyelement_out anyelement_recv anyelement_send 0 0 0 2287 _record array_in array_out array_recv array_send 0 0 0 2950 uuid uuid_in uuid_out uuid_recv uuid_send 0 0 0 diff --git a/pkg/sql/pg_catalog.go b/pkg/sql/pg_catalog.go index 31a515fbe350..789d3e21c98e 100644 --- a/pkg/sql/pg_catalog.go +++ b/pkg/sql/pg_catalog.go @@ -59,9 +59,10 @@ import ( ) var ( - oidZero = tree.NewDOid(0) - zeroVal = tree.DZero - negOneVal = tree.NewDInt(-1) + oidZero = tree.NewDOid(0) + regProcOidZero = tree.NewDOidWithTypeAndName(0, types.RegProc, "-") + zeroVal = tree.DZero + negOneVal = tree.NewDInt(-1) passwdStarString = tree.NewDString("********") ) @@ -4882,28 +4883,27 @@ https://www.postgresql.org/docs/9.6/catalog-pg-aggregate.html`, } } } - regprocForZeroOid := tree.NewDOidWithTypeAndName(0, types.RegProc, "-") err := addRow( tree.NewDOid(overload.Oid).AsRegProc(name), // aggfnoid - aggregateKind, // aggkind - aggNumDirectArgs, // aggnumdirectargs - regprocForZeroOid, // aggtransfn - regprocForZeroOid, // aggfinalfn - regprocForZeroOid, // aggcombinefn - regprocForZeroOid, // aggserialfn - regprocForZeroOid, // aggdeserialfn - regprocForZeroOid, // aggmtransfn - regprocForZeroOid, // aggminvtransfn - regprocForZeroOid, // aggmfinalfn - tree.DBoolFalse, // aggfinalextra - tree.DBoolFalse, // aggmfinalextra - sortOperatorOid, // aggsortop - tree.DNull, // aggtranstype - tree.DNull, // aggtransspace - tree.DNull, // aggmtranstype - tree.DNull, // aggmtransspace - tree.DNull, // agginitval - tree.DNull, // aggminitval + aggregateKind, // aggkind + aggNumDirectArgs, // aggnumdirectargs + regProcOidZero, // aggtransfn + regProcOidZero, // aggfinalfn + regProcOidZero, // aggcombinefn + regProcOidZero, // aggserialfn + regProcOidZero, // aggdeserialfn + regProcOidZero, // aggmtransfn + regProcOidZero, // aggminvtransfn + regProcOidZero, // aggmfinalfn + tree.DBoolFalse, // aggfinalextra + tree.DBoolFalse, // aggmfinalextra + sortOperatorOid, // aggsortop + tree.DNull, // aggtranstype + tree.DNull, // aggtransspace + tree.DNull, // aggmtranstype + tree.DNull, // aggmtransspace + tree.DNull, // agginitval + tree.DNull, // aggminitval // These columns were automatically created by pg_catalog_test's missing column generator. tree.DNull, // aggfinalmodify tree.DNull, // aggmfinalmodify @@ -5128,7 +5128,7 @@ func (h oidHasher) UniqueConstraintOid( func (h oidHasher) RegProc(name string) tree.Datum { _, overloads := builtinsregistry.GetBuiltinProperties(name) if len(overloads) == 0 { - return tree.DNull + return regProcOidZero } return tree.NewDOid(overloads[0].Oid).AsRegProc(name) }