8000 Unbreak overflow test for attinhcount/coninhcount · postgres/postgres@fd64ed6 · GitHub
[go: up one dir, main page]

Skip to content
{"payload":{"commit":{"oid":"fd64ed60b62697984bb69a09a3ae19fbe2905eb6","url":"/postgres/postgres/commit/fd64ed60b62697984bb69a09a3ae19fbe2905eb6","authoredDate":"2024-10-10T17:41:01.000+02:00","committedDate":"2024-10-10T17:41:01.000+02:00","shortMessage":null,"shortMessageMarkdown":"\u003cdiv\u003eUnbreak overflow test for attinhcount/coninhcount\u003c/div\u003e","shortMessageMarkdownLink":null,"bodyMessageHtml":"Commit \u003ca class=\"commit-link\" data-hovercard-type=\"commit\" data-hovercard-url=\"https://github.com/postgres/postgres/commit/90189eefc1e11822794e3386d9bafafd3ba3a6e8/hovercard\" href=\"https://github.com/postgres/postgres/commit/90189eefc1e11822794e3386d9bafafd3ba3a6e8\"\u003e\u003ctt\u003e90189ee\u003c/tt\u003e\u003c/a\u003e narrowed pg_attribute.attinhcount and\npg_constraint.coninhcount from 32 to 16 bits, but kept other related\nstructs with 32-bit wide fields: ColumnDef and CookedConstraint contain\nan int 'inhcount' field which is itself checked for overflow on\nincrements, but there's no check that the values aren't above INT16_MAX\nbefore assigning to the catalog columns. This means that a creative\nuser can get a inconsistent table definition and override some\nprotections.\n\nFix it by changing those other structs to also use int16.\n\nAlso, modernize style by using pg_add_s16_overflow for overflow testing\ninstead of checking for negative values.\n\nWe also have Constraint.inhcount, which is here removed completely.\nThis was added by commit \u003ca class=\"commit-link\" data-hovercard-type=\"commit\" data-hovercard-url=\"https://github.com/postgres/postgres/commit/b0e96f311985bceba79825214f8e43f65afa653a/hovercard\" href=\"https://github.com/postgres/postgres/commit/b0e96f311985bceba79825214f8e43f65afa653a\"\u003e\u003ctt\u003eb0e96f3\u003c/tt\u003e\u003c/a\u003e and not removed by its revert at\n\u003ca class=\"commit-link\" data-hovercard-type=\"commit\" data-hovercard-url=\"https://github.com/postgres/postgres/commit/6f8bb7c1e9610dd7af20cdaf74c4ff6e6d678d44/hovercard\" href=\"https://github.com/postgres/postgres/commit/6f8bb7c1e9610dd7af20cdaf74c4ff6e6d678d44\"\u003e\u003ctt\u003e6f8bb7c\u003c/tt\u003e\u003c/a\u003e. It is not needed by the upcoming not-null constraints\npatch.\n\nThis is mostly academic, so we agreed not to backpatch to avoid ABI\nproblems.\n\nBump catversion because of the changes to parse nodes.\n\nCo-authored-by: Álvaro Herrera \u0026lt;alvherre@alvh.no-ip.org\u0026gt;\nCo-authored-by: 何建 (jian he) \u0026lt;jian.universality@gmail.com\u0026gt;\nReviewed-by: Tom Lane \u0026lt;tgl@sss.pgh.pa.us\u0026gt;\nDiscussion: \u003ca href=\"https://postgr.es/m/202410081611.up4iyofb5ie7@alvherre.pgsql\" rel=\"nofollow\"\u003ehttps://postgr.es/m/202410081611.up4iyofb5ie7@alvherre.pgsql\u003c/a\u003e","authors":[{"login":"alvherre","displayName":"Álvaro Herrera","avatarUrl":"https://avatars.githubusercontent.com/u/340005?v=4","path":"/alvherre","isGitHub":false},{"login":"jianhe-fun","displayName":"何建 (jian he)","avatarUrl":"https://avatars.githubusercontent.com/u/85830881?v=4","path":"/jianhe-fun","isGitHub":false}],"committerAttribution":false,"committer":{"login":"alvherre","displayName":"Álvaro Herrera","avatarUrl":"https://avatars.githubusercontent.com/u/340005?v=4","path":"/alvherre","isGitHub":false},"parents":["1909835c28a144bf957254eea1f4a4dabafbbaee"],"globalRelayId":"C_kwDOAA4m0toAKGZkNjRlZDYwYjYyNjk3OTg0YmI2OWEwOWEzYWUxOWZiZTI5MDVlYjY","sha1":"1909835c28a144bf957254eea1f4a4dabafbbaee","sha2":"fd64ed60b62697984bb69a09a3ae19fbe2905eb6"},"currentUser":null,"repo":{"id":927442,"defaultBranch":"master","name":"postgres","ownerLogin":"postgres","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2010-09-21T11:35:45.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/177543?v=4","public":true,"private":false,"isOrgOwned":true},"diffEntryData":[{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":101,"text":"@@ -102,7 +102,7 @@ static ObjectAddress AddNewRelationType(const char *typeName,","html":"@@ -102,7 +102,7 @@ static ObjectAddress AddNewRelationType(const char *typeName,","displayNoNewLineWarning":false,"position":0,"left":101,"right":101},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":102,"text":" \t\t\t\t\t\t\t\t\t\tOid new_array_type);","html":" \t\t\t\t\t\t\t\t\t\t\u003cspan class=pl-smi\u003eOid\u003c/span\u003e \u003cspan class=pl-s1\u003enew_array_type\u003c/span\u003e);","displayNoNewLineWarning":false,"position":1,"left":102,"right":102},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":103,"text":" static void RelationRemoveInheritance(Oid relid);","html":" \u003cspan class=pl-k\u003estatic\u003c/span\u003e \u003cspan class=pl-smi\u003evoid\u003c/span\u003e \u003cspan class=pl-en\u003eRelationRemoveInheritance\u003c/span\u003e(\u003cspan class=pl-smi\u003eOid\u003c/span\u003e \u003cspan class=pl-s1\u003erelid\u003c/span\u003e);","displayNoNewLineWarning":false,"position":2,"left":103,"right":103},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":104,"text":" static Oid\tStoreRelCheck(Relation rel, const char *ccname, Node *expr,","html":" \u003cspan class=pl-k\u003estatic\u003c/span\u003e \u003cspan class=pl-smi\u003eOid\u003c/span\u003e\t\u003cspan class=pl-en\u003eStoreRelCheck\u003c/span\u003e(\u003cspan class=pl-smi\u003eRelation\u003c/span\u003e \u003cspan class=pl-s1\u003erel\u003c/span\u003e, \u003cspan class=pl-k\u003econst\u003c/span\u003e \u003cspan class=pl-smi\u003echar\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003eccname\u003c/span\u003e, \u003cspan class=pl-smi\u003eNode\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003eexpr\u003c/span\u003e,","displayNoNewLineWarning":false,"position":3,"left":104,"right":104},{"stylingDirective":null,"type":"DELETION","blobLineNumber":105,"text":"-\t\t\t\t\t\t bool is_validated, bool is_local, int inhcount,","html":"-\t\t\t\t\t\t \u003cspan class=\"pl-smi\"\u003ebool\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eis_validated\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003ebool\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eis_local\u003c/span\u003e, \u003cspan class=\"pl-smi x x-first x-last\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003einhcount\u003c/span\u003e,","displayNoNewLineWarning":false,"position":4,"left":105,"right":104},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":105,"text":"+\t\t\t\t\t\t bool is_validated, bool is_local, int16 inhcount,","html":"+\t\t\t\t\t\t \u003cspan class=\"pl-smi\"\u003ebool\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eis_validated\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003ebool\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eis_local\u003c/span\u003e, \u003cspan class=\"pl-smi x x-first x-last\"\u003eint16\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003einhcount\u003c/span\u003e,","displayNoNewLineWarning":false,"position":5,"left":105,"right":105},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":106,"text":" \t\t\t\t\t\t bool is_no_inherit, bool is_internal);","html":" \t\t\t\t\t\t \u003cspan class=pl-smi\u003ebool\u003c/span\u003e \u003cspan class=pl-s1\u003eis_no_inherit\u003c/span\u003e, \u003cspan class=pl-smi\u003ebool\u003c/span\u003e \u003cspan class=pl-s1\u003eis_internal\u003c/span\u003e);","displayNoNewLineWarning":false,"position":6,"left":106,"right":106},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":107,"text":" static void StoreConstraints(Relation rel, List *cooked_constraints,","html":" \u003cspan class=pl-k\u003estatic\u003c/span\u003e \u003cspan class=pl-smi\u003evoid\u003c/span\u003e \u003cspan class=pl-en\u003eStoreConstraints\u003c/span\u003e(\u003cspan class=pl-smi\u003eRelation\u003c/span\u003e \u003cspan class=pl-s1\u003erel\u003c/span\u003e, \u003cspan class=pl-smi\u003eList\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003ecooked_constraints\u003c/span\u003e,","displayNoNewLineWarning":false,"position":7,"left":107,"right":107},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":108,"text":" \t\t\t\t\t\t\t bool is_internal);","html":" \t\t\t\t\t\t\t \u003cspan class=pl-smi\u003ebool\u003c/span\u003e \u003cspan class=pl-s1\u003eis_internal\u003c/span\u003e);","displayNoNewLineWarning":false,"position":8,"left":108,"right":108},{"stylingDirective":null,"type":"HUNK","blobLineNumber":2071,"text":"@@ -2072,7 +2072,7 @@ SetAttrMissing(Oid relid, char *attname, char *value)","html":"@@ -2072,7 +2072,7 @@ SetAttrMissing(Oid relid, char *attname, char *value)","displayNoNewLineWarning":false,"position":9,"left":2071,"right":2071},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2072,"text":" */","html":" \u003cspan class=pl-c\u003e */\u003c/span\u003e","displayNoNewLineWarning":false,"position":10,"left":2072,"right":2072},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2073,"text":" static Oid","html":" \u003cspan class=pl-k\u003estatic\u003c/span\u003e \u003cspan class=pl-smi\u003eOid\u003c/span\u003e","displayNoNewLineWarning":false,"position":11,"left":2073,"right":2073},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2074,"text":" StoreRelCheck(Relation rel, const char *ccname, Node *expr,","html":" \u003cspan class=pl-en\u003eStoreRelCheck\u003c/span\u003e(\u003cspan class=pl-smi\u003eRelation\u003c/span\u003e \u003cspan class=pl-s1\u003erel\u003c/span\u003e, \u003cspan class=pl-k\u003econst\u003c/span\u003e \u003cspan class=pl-smi\u003echar\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003eccname\u003c/span\u003e, \u003cspan class=pl-smi\u003eNode\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003eexpr\u003c/span\u003e,","displayNoNewLineWarning":false,"position":12,"left":2074,"right":2074},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2075,"text":"-\t\t\t bool is_validated, bool is_local, int inhcount,","html":"-\t\t\t \u003cspan class=\"pl-smi\"\u003ebool\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eis_validated\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003ebool\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eis_local\u003c/span\u003e, \u003cspan class=\"pl-smi x x-first x-last\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003einhcount\u003c/span\u003e,","displayNoNewLineWarning":false,"position":13,"left":2075,"right":2074},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2075,"text":"+\t\t\t bool is_validated, bool is_local, int16 inhcount,","html":"+\t\t\t \u003cspan class=\"pl-smi\"\u003ebool\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eis_validated\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003ebool\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eis_local\u003c/span\u003e, \u003cspan class=\"pl-smi x x-first x-last\"\u003eint16\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003einhcount\u003c/span\u003e,","displayNoNewLineWarning":false,"position":14,"left":2075,"right":2075},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2076,"text":" \t\t\t bool is_no_inherit, bool is_internal)","html":" \t\t\t \u003cspan class=pl-smi\u003ebool\u003c/span\u003e \u003cspan class=pl-s1\u003eis_no_inherit\u003c/span\u003e, \u003cspan class=pl-smi\u003ebool\u003c/span\u003e \u003cspan class=pl-s1\u003eis_internal\u003c/span\u003e)","displayNoNewLineWarning":false,"position":15,"left":2076,"right":2076},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2077,"text":" {","html":" {","displayNoNewLineWarning":false,"position":16,"left":2077,"right":2077},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2078,"text":" \tchar\t *ccbin;","html":" \t\u003cspan class=pl-smi\u003echar\u003c/span\u003e\t \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003eccbin\u003c/span\u003e;","displayNoNewLineWarning":false,"position":17,"left":2078,"right":2078},{"stylingDirective":null,"type":"HUNK","blobLineNumber":2623,"text":"@@ -2624,10 +2624,8 @@ MergeWithExistingConstraint(Relation rel, const char *ccname, Node *expr,","html":"@@ -2624,10 +2624,8 @@ MergeWithExistingConstraint(Relation rel, const char *ccname, Node *expr,","displayNoNewLineWarning":false,"position":18,"left":2623,"right":2623},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2624,"text":" \t\t{","html":" \t\t{","displayNoNewLineWarning":false,"position":19,"left":2624,"right":2624},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2625,"text":" \t\t\tif (is_local)","html":" \t\t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-s1\u003eis_local\u003c/span\u003e)","displayNoNewLineWarning":false,"position":20,"left":2625,"right":2625},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2626,"text":" \t\t\t\tcon-\u003econislocal = true;","html":" \t\t\t\t\u003cspan class=pl-s1\u003econ\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003econislocal\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e true;","displayNoNewLineWarning":false,"position":21,"left":2626,"right":2626},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2627,"text":"-\t\t\telse","html":"-\t\t\t\u003cspan class=pl-k\u003eelse\u003c/span\u003e","displayNoNewLineWarning":false,"position":22,"left":2627,"right":2626},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2628,"text":"-\t\t\t\tcon-\u003econinhcount++;","html":"-\t\t\t\t\u003cspan class=pl-s1\u003econ\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003econinhcount\u003c/span\u003e\u003cspan class=pl-c1\u003e++\u003c/span\u003e;","displayNoNewLineWarning":false,"position":23,"left":2628,"right":2626},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2629,"text":"-","html":"-","displayNoNewLineWarning":false,"position":24,"left":2629,"right":2626},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2630,"text":"-\t\t\tif (con-\u003econinhcount \u003c 0)","html":"-\t\t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-s1\u003econ\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003econinhcount\u003c/span\u003e \u003cspan class=pl-c1\u003e\u0026lt;\u003c/span\u003e \u003cspan class=pl-c1\u003e0\u003c/span\u003e)","displayNoNewLineWarning":false,"position":25,"left":2630,"right":2626},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2627,"text":"+\t\t\telse if (pg_add_s16_overflow(con-\u003econinhcount, 1,","html":"+\t\t\t\u003cspan class=pl-k\u003eelse\u003c/span\u003e \u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-en\u003epg_add_s16_overflow\u003c/span\u003e(\u003cspan class=pl-s1\u003econ\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003econinhcount\u003c/span\u003e, \u003cspan class=pl-c1\u003e1\u003c/span\u003e,","displayNoNewLineWarning":false,"position":26,"left":2630,"right":2627},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2628,"text":"+\t\t\t\t\t\t\t\t\t\t \u0026con-\u003econinhcount))","html":"+\t\t\t\t\t\t\t\t\t\t \u003cspan class=pl-c1\u003e\u0026amp;\u003c/span\u003e\u003cspan class=pl-s1\u003econ\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003econinhcount\u003c/span\u003e))","displayNoNewLineWarning":false,"position":27,"left":2630,"right":2628},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2629,"text":" \t\t\t\tereport(ERROR,","html":" \t\t\t\t\u003cspan class=pl-en\u003eereport\u003c/span\u003e(\u003cspan class=pl-c1\u003eERROR\u003c/span\u003e,","displayNoNewLineWarning":false,"position":28,"left":2631,"right":2629},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2630,"text":" \t\t\t\t\t\terrcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),","html":" \t\t\t\t\t\t\u003cspan class=pl-en\u003eerrcode\u003c/span\u003e(\u003cspan class=pl-c1\u003eERRCODE_PROGRAM_LIMIT_EXCEEDED\u003c/span\u003e),","displayNoNewLineWarning":false,"position":29,"left":2632,"right":2630},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2631,"text":" \t\t\t\t\t\terrmsg(\"too many inheritance parents\"));","html":" \t\t\t\t\t\t\u003cspan class=pl-en\u003eerrmsg\u003c/span\u003e(\u003cspan class=pl-s\u003e\u0026quot;too many inheritance parents\u0026quot;\u003c/span\u003e));","displayNoNewLineWarning":false,"position":30,"left":2633,"right":2631}],"diffNumber":0,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":3557,"linesChanged":10,"newTreeEntry":{"lineCount":3557,"path":"src/backend/catalog/heap.c","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"src/backend/catalog/heap.c","mode":100644},"linesAdded":4,"linesDeleted":6,"path":"src/backend/catalog/heap.c","pathDigest":"5a6264cd54cb3f2e22f2adcd2997803d89f9494bf15fd75e4147bac30138601d","status":"MODIFIED","truncatedReason":null,"oldOid":"1909835c28a144bf957254eea1f4a4dabafbbaee","newOid":"fd64ed60b62697984bb69a09a3ae19fbe2905eb6","copilotChatReference":null,"deletedSha":"1909835c28a144bf957254eea1f4a4dabafbbaee","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null},{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":1899,"text":"@@ -1900,7 +1900,7 @@ index_constraint_create(Relation heapRelation,","html":"@@ -1900,7 +1900,7 @@ index_constraint_create(Relation heapRelation,","displayNoNewLineWarning":false,"position":0,"left":1899,"right":1899},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1900,"text":" \tbool\t\tislocal;","html":" \t\u003cspan class=pl-smi\u003ebool\u003c/span\u003e\t\t\u003cspan class=pl-s1\u003eislocal\u003c/span\u003e;","displayNoNewLineWarning":false,"position":1,"left":1900,"right":1900},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1901,"text":" \tbool\t\tnoinherit;","html":" \t\u003cspan class=pl-smi\u003ebool\u003c/span\u003e\t\t\u003cspan class=pl-s1\u003enoinherit\u003c/span\u003e;","displayNoNewLineWarning":false,"position":2,"left":1901,"right":1901},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1902,"text":" \tbool\t\tis_without_overlaps;","html":" \t\u003cspan class=pl-smi\u003ebool\u003c/span\u003e\t\t\u003cspan class=pl-s1\u003eis_without_overlaps\u003c/span\u003e;","displayNoNewLineWarning":false,"position":3,"left":1902,"right":1902},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1903,"text":"-\tint\t\t\tinhcount;","html":"-\t\u003cspan class=\"pl-smi x x-first\"\u003eint\u003c/span\u003e\u003cspan class=\"x x-last\"\u003e\t\u003c/span\u003e\t\t\u003cspan class=\"pl-s1\"\u003einhcount\u003c/span\u003e;","displayNoNewLineWarning":false,"position":4,"left":1903,"right":1902},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1903,"text":"+\tint16\t\tinhcount;","html":"+\t\u003cspan class=\"pl-smi x x-first x-last\"\u003eint16\u003c/span\u003e\t\t\u003cspan class=\"pl-s1\"\u003einhcount\u003c/span\u003e;","displayNoNewLineWarning":false,"position":5,"left":1903,"right":1903},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1904,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":6,"left":1904,"right":1904},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1905,"text":" \tdeferrable = (constr_flags \u0026 INDEX_CONSTR_CREATE_DEFERRABLE) != 0;","html":" \t\u003cspan class=pl-s1\u003edeferrable\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e (\u003cspan class=pl-s1\u003econstr_flags\u003c/span\u003e \u003cspan class=pl-c1\u003e\u0026amp;\u003c/span\u003e \u003cspan class=pl-c1\u003eINDEX_CONSTR_CREATE_DEFERRABLE\u003c/span\u003e) \u003cspan class=pl-c1\u003e!=\u003c/span\u003e \u003cspan class=pl-c1\u003e0\u003c/span\u003e;","displayNoNewLineWarning":false,"position":7,"left":1905,"right":1905},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1906,"text":" \tinitdeferred = (constr_flags \u0026 INDEX_CONSTR_CREATE_INIT_DEFERRED) != 0;","html":" \t\u003cspan class=pl-s1\u003einitdeferred\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e (\u003cspan class=pl-s1\u003econstr_flags\u003c/span\u003e \u003cspan class=pl-c1\u003e\u0026amp;\u003c/span\u003e \u003cspan class=pl-c1\u003eINDEX_CONSTR_CREATE_INIT_DEFERRED\u003c/span\u003e) \u003cspan class=pl-c1\u003e!=\u003c/span\u003e \u003cspan class=pl-c1\u003e0\u003c/span\u003e;","displayNoNewLineWarning":false,"position":8,"left":1906,"right":1906}],"diffNumber":1,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":4241,"linesChanged":2,"newTreeEntry":{"lineCount":4241,"path":"src/backend/catalog/index.c","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"src/backend/catalog/index.c","mode":100644},"linesAdded":1,"linesDeleted":1,"path":"src/backend/catalog/index.c","pathDigest":"586c72d2cf381d9ba233e5324edeccfa0debb512306bd7dfcfafbd9f0d67ac08","status":"MODIFIED","truncatedReason":null,"oldOid":"1909835c28a144bf957254eea1f4a4dabafbbaee","newOid":"fd64ed60b62697984bb69a09a3ae19fbe2905eb6","copilotChatReference":null,"deletedSha":"1909835c28a144bf957254eea1f4a4dabafbbaee","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null},{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":26,"text":"@@ -27,6 +27,7 @@","html":"@@ -27,6 +27,7 @@","displayNoNewLineWarning":false,"position":0,"left":26,"right":26},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":27,"text":" #include \"catalog/pg_operator.h\"","html":" \u003cspan class=pl-k\u003e#include\u003c/span\u003e \u003cspan class=pl-s\u003e\u0026quot;catalog/pg_operator.h\u0026quot;\u003c/span\u003e","displayNoNewLineWarning":false,"position":1,"left":27,"right":27},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":28,"text":" #include \"catalog/pg_type.h\"","html":" \u003cspan class=pl-k\u003e#include\u003c/span\u003e \u003cspan class=pl-s\u003e\u0026quot;catalog/pg_type.h\u0026quot;\u003c/span\u003e","displayNoNewLineWarning":false,"position":2,"left":28,"right":28},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":29,"text":" #include \"commands/defrem.h\"","html":" \u003cspan class=pl-k\u003e#include\u003c/span\u003e \u003cspan class=pl-s\u003e\u0026quot;commands/defrem.h\u0026quot;\u003c/span\u003e","displayNoNewLineWarning":false,"position":3,"left":29,"right":29},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":30,"text":"+#include \"common/int.h\"","html":"+\u003cspan class=pl-k\u003e#include\u003c/span\u003e \u003cspan class=pl-s\u003e\u0026quot;common/int.h\u0026quot;\u003c/span\u003e","displayNoNewLineWarning":false,"position":4,"left":29,"right":30},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":31,"text":" #include \"utils/array.h\"","html":" \u003cspan class=pl-k\u003e#include\u003c/span\u003e \u003cspan class=pl-s\u003e\u0026quot;utils/array.h\u0026quot;\u003c/span\u003e","displayNoNewLineWarning":false,"position":5,"left":30,"right":31},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":32,"text":" #include \"utils/builtins.h\"","html":" \u003cspan class=pl-k\u003e#include\u003c/span\u003e \u003cspan class=pl-s\u003e\u0026quot;utils/builtins.h\u0026quot;\u003c/span\u003e","displayNoNewLineWarning":false,"position":6,"left":31,"right":32},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":33,"text":" #include \"utils/fmgroids.h\"","html":" \u003cspan class=pl-k\u003e#include\u003c/span\u003e \u003cspan class=pl-s\u003e\u0026quot;utils/fmgroids.h\u0026quot;\u003c/span\u003e","displayNoNewLineWarning":false,"position":7,"left":32,"right":33},{"stylingDirective":null,"type":"HUNK","blobLineNumber":74,"text":"@@ -74,7 +75,7 @@ CreateConstraintEntry(const char *constraintName,","html":"@@ -74,7 +75,7 @@ CreateConstraintEntry(const char *constraintName,","displayNoNewLineWarning":false,"position":8,"left":73,"right":74},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":75,"text":" \t\t\t\t\t Node *conExpr,","html":" \t\t\t\t\t \u003cspan class=pl-smi\u003eNode\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003econExpr\u003c/span\u003e,","displayNoNewLineWarning":false,"position":9,"left":74,"right":75},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":76,"text":" \t\t\t\t\t const char *conBin,","html":" \t\t\t\t\t \u003cspan class=pl-k\u003econst\u003c/span\u003e \u003cspan class=pl-smi\u003echar\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003econBin\u003c/span\u003e,","displayNoNewLineWarning":false,"position":10,"left":75,"right":76},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":77,"text":" \t\t\t\t\t bool conIsLocal,","html":" \t\t\t\t\t \u003cspan class=pl-smi\u003ebool\u003c/span\u003e \u003cspan class=pl-s1\u003econIsLocal\u003c/span\u003e,","displayNoNewLineWarning":false,"position":11,"left":76,"right":77},{"stylingDirective":null,"type":"DELETION","blobLineNumber":77,"text":"-\t\t\t\t\t int conInhCount,","html":"-\t\t\t\t\t \u003cspan class=\"pl-smi x x-first x-last\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003econInhCount\u003c/span\u003e,","displayNoNewLineWarning":false,"position":12,"left":77,"right":77},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":78,"text":"+\t\t\t\t\t int16 conInhCount,","html":"+\t\t\t\t\t \u003cspan class=\"pl-smi x x-first x-last\"\u003eint16\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003econInhCount\u003c/span\u003e,","displayNoNewLineWarning":false,"position":13,"left":77,"right":78},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":79,"text":" \t\t\t\t\t bool conNoInherit,","html":" \t\t\t\t\t \u003cspan class=pl-smi\u003ebool\u003c/span\u003e \u003cspan class=pl-s1\u003econNoInherit\u003c/span\u003e,","displayNoNewLineWarning":false,"position":14,"left":78,"right":79},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":80,"text":" \t\t\t\t\t bool conPeriod,","html":" \t\t\t\t\t \u003cspan class=pl-smi\u003ebool\u003c/span\u003e \u003cspan class=pl-s1\u003econPeriod\u003c/span\u003e,","displayNoNewLineWarning":false,"position":15,"left":79,"right":80},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":81,"text":" \t\t\t\t\t bool is_internal)","html":" \t\t\t\t\t \u003cspan class=pl-smi\u003ebool\u003c/span\u003e \u003cspan class=pl-s1\u003eis_internal\u003c/span\u003e)","displayNoNewLineWarning":false,"position":16,"left":80,"right":81},{"stylingDirective":null,"type":"HUNK","blobLineNumber":849,"text":"@@ -849,11 +850,12 @@ ConstraintSetParentConstraint(Oid childConstrId,","html":"@@ -849,11 +850,12 @@ ConstraintSetParentConstraint(Oid childConstrId,","displayNoNewLineWarning":false,"position":17,"left":848,"right":849},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":850,"text":" \t\t\t\t childConstrId);","html":" \t\t\t\t \u003cspan class=pl-s1\u003echildConstrId\u003c/span\u003e);","displayNoNewLineWarning":false,"position":18,"left":849,"right":850},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":851,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":19,"left":850,"right":851},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":852,"text":" \t\tconstrForm-\u003econislocal = false;","html":" \t\t\u003cspan class=pl-s1\u003econstrForm\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003econislocal\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e false;","displayNoNewLineWarning":false,"position":20,"left":851,"right":852},{"stylingDirective":null,"type":"DELETION","blobLineNumber":852,"text":"-\t\tconstrForm-\u003econinhcount++;","html":"-\t\t\u003cspan class=\"pl-s1\"\u003econstrForm\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003econinhcount\u003c/span\u003e\u003cspan class=\"pl-c1 x x-first\"\u003e++\u003c/span\u003e\u003cspan class=\"x x-last\"\u003e;\u003c/span\u003e","displayNoNewLineWarning":false,"position":21,"left":852,"right":852},{"stylingDirective":null,"type":"DELETION","blobLineNumber":853,"text":"-\t\tif (constrForm-\u003econinhcount \u003c 0)","html":"-\t\t\u003cspan class=\"pl-k x x-first\"\u003eif\u003c/span\u003e\u003cspan class=\"x x-last\"\u003e (\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003econstrForm\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003econinhcount\u003c/span\u003e\u003cspan class=\"x x-first\"\u003e \u003c/span\u003e\u003cspan class=\"pl-c1 x\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"x\"\u003e \u003c/span\u003e\u003cspan class=\"pl-c1 x x-last\"\u003e0\u003c/span\u003e)","displayNoNewLineWarning":false,"position":22,"left":853,"right":852},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":853,"text":"+\t\tif (pg_add_s16_overflow(constrForm-\u003econinhcount, 1,","html":"+\t\t\u003cspan class=\"pl-k x x-first\"\u003eif\u003c/span\u003e\u003cspan class=\"x\"\u003e (\u003c/span\u003e\u003cspan class=\"pl-en x\"\u003epg_add_s16_overflow\u003c/span\u003e\u003cspan class=\"x x-last\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003econstrForm\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003econinhcount\u003c/span\u003e\u003cspan class=\"x x-first\"\u003e, \u003c/span\u003e\u003cspan class=\"pl-c1 x\"\u003e1\u003c/span\u003e\u003cspan class=\"x x-last\"\u003e,\u003c/span\u003e","displayNoNewLineWarning":false,"position":23,"left":853,"right":853},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":854,"text":"+\t\t\t\t\t\t\t\t\u0026constrForm-\u003econinhcount))","html":"+\t\t\u003cspan class=\"x x-first\"\u003e\t\t\t\t\t\t\u003c/span\u003e\u003cspan class=\"pl-c1 x x-last\"\u003e\u0026amp;\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003econstrForm\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003econinhcount\u003c/span\u003e\u003cspan class=\"x x-first x-last\"\u003e)\u003c/span\u003e)","displayNoNewLineWarning":false,"position":24,"left":853,"right":854},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":855,"text":" \t\t\tereport(ERROR,","html":" \t\t\t\u003cspan class=pl-en\u003eereport\u003c/span\u003e(\u003cspan class=pl-c1\u003eERROR\u003c/span\u003e,","displayNoNewLineWarning":false,"position":25,"left":854,"right":855},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":856,"text":" \t\t\t\t\terrcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),","html":" \t\t\t\t\t\u003cspan class=pl-en\u003eerrcode\u003c/span\u003e(\u003cspan class=pl-c1\u003eERRCODE_PROGRAM_LIMIT_EXCEEDED\u003c/span\u003e),","displayNoNewLineWarning":false,"position":26,"left":855,"right":856},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":857,"text":" \t\t\t\t\terrmsg(\"too many inheritance parents\"));","html":" \t\t\t\t\t\u003cspan class=pl-en\u003eerrmsg\u003c/span\u003e(\u003cspan class=pl-s\u003e\u0026quot;too many inheritance parents\u0026quot;\u003c/span\u003e));","displayNoNewLineWarning":false,"position":27,"left":856,"right":857},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":858,"text":"+","html":"+","displayNoNewLineWarning":false,"position":28,"left":856,"right":858},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":859,"text":" \t\tconstrForm-\u003econparentid = parentConstrId;","html":" \t\t\u003cspan class=pl-s1\u003econstrForm\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003econparentid\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-s1\u003eparentConstrId\u003c/span\u003e;","displayNoNewLineWarning":false,"position":29,"left":857,"right":859},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":860,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":30,"left":858,"right":860},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":861,"text":" \t\tCatalogTupleUpdate(constrRel, \u0026tuple-\u003et_self, newtup);","html":" \t\t\u003cspan class=pl-en\u003eCatalogTupleUpdate\u003c/span\u003e(\u003cspan class=pl-s1\u003econstrRel\u003c/span\u003e, \u003cspan class=pl-c1\u003e\u0026amp;\u003c/span\u003e\u003cspan 8000 class=pl-s1\u003etuple\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003et_self\u003c/span\u003e, \u003cspan class=pl-s1\u003enewtup\u003c/span\u003e);","displayNoNewLineWarning":false,"position":31,"left":859,"right":861}],"diffNumber":2,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":1464,"linesChanged":8,"newTreeEntry":{"lineCount":1464,"path":"src/backend/catalog/pg_constraint.c","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"src/backend/catalog/pg_constraint.c","mode":100644},"linesAdded":5,"linesDeleted":3,"path":"src/backend/catalog/pg_constraint.c","pathDigest":"3615747e9ead8c02efc0a9b688dfcee9782bb96c8401a3cc3a5b0ebf55aa6b40","status":"MODIFIED","truncatedReason":null,"oldOid":"1909835c28a144bf957254eea1f4a4dabafbbaee","newOid":"fd64ed60b62697984bb69a09a3ae19fbe2905eb6","copilotChatReference":null,"deletedSha":"1909835c28a144bf957254eea1f4a4dabafbbaee","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null},{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":65,"text":"@@ -66,6 +66,7 @@","html":"@@ -66,6 +66,7 @@","displayNoNewLineWarning":false,"position":0,"left":65,"right":65},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":66,"text":" #include \"commands/typecmds.h\"","html":" #include \u0026quot;commands/typecmds.h\u0026quot;","displayNoNewLineWarning":false,"position":1,"left":66,"right":66},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":67,"text":" #include \"commands/user.h\"","html":" #include \u0026quot;commands/user.h\u0026quot;","displayNoNewLineWarning":false,"position":2,"left":67,"right":67},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":68,"text":" #include \"commands/vacuum.h\"","html":" #include \u0026quot;commands/vacuum.h\u0026quot;","displayNoNewLineWarning":false,"position":3,"left":68,"right":68},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":69,"text":"+#include \"common/int.h\"","html":"+#include \u0026quot;common/int.h\u0026quot;","displayNoNewLineWarning":false,"position":4,"left":68,"right":69},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":70,"text":" #include \"executor/executor.h\"","html":" #include \u0026quot;executor/executor.h\u0026quot;","displayNoNewLineWarning":false,"position":5,"left":69,"right":70},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":71,"text":" #include \"foreign/fdwapi.h\"","html":" #include \u0026quot;foreign/fdwapi.h\u0026quot;","displayNoNewLineWarning":false,"position":6,"left":70,"right":71},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":72,"text":" #include \"foreign/foreign.h\"","html":" #include \u0026quot;foreign/foreign.h\u0026quot;","displayNoNewLineWarning":false,"position":7,"left":71,"right":72},{"stylingDirective":null,"type":"HUNK","blobLineNumber":3044,"text":"@@ -3044,8 +3045,8 @@ MergeCheckConstraint(List *constraints, const char *name, Node *expr)","html":"@@ -3044,8 +3045,8 @@ MergeCheckConstraint(List *constraints, const char *name, Node *expr)","displayNoNewLineWarning":false,"position":8,"left":3043,"right":3044},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":3045,"text":" \t\tif (equal(expr, ccon-\u003eexpr))","html":" \t\tif (equal(expr, ccon-\u0026gt;expr))","displayNoNewLineWarning":false,"position":9,"left":3044,"right":3045},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":3046,"text":" \t\t{","html":" \t\t{","displayNoNewLineWarning":false,"position":10,"left":3045,"right":3046},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":3047,"text":" \t\t\t/* OK to merge constraint with existing */","html":" \t\t\t/* OK to merge constraint with existing */","displayNoNewLineWarning":false,"position":11,"left":3046,"right":3047},{"stylingDirective":null,"type":"DELETION","blobLineNumber":3047,"text":"-\t\t\tccon-\u003einhcount++;","html":"-\t\t\tccon-\u0026gt;inhcount\u003cspan class=\"x x-first x-last\"\u003e++;\u003c/span\u003e","displayNoNewLineWarning":false,"position":12,"left":3047,"right":3047},{"stylingDirective":null,"type":"DELETION","blobLineNumber":3048,"text":"-\t\t\tif (ccon-\u003einhcount \u003c 0)","html":"-\t\t\t\u003cspan class=\"x x-first x-last\"\u003eif (\u003c/span\u003eccon-\u0026gt;inhcount\u003cspan class=\"x x-first x-last\"\u003e \u0026lt; 0\u003c/span\u003e)","displayNoNewLineWarning":false,"position":13,"left":3048,"right":3047},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":3048,"text":"+\t\t\tif (pg_add_s16_overflow(ccon-\u003einhcount, 1,","html":"+\t\t\t\u003cspan class=\"x x-first x-last\"\u003eif (pg_add_s16_overflow(\u003c/span\u003eccon-\u0026gt;inhcount\u003cspan class=\"x x-first x-last\"\u003e, 1,\u003c/span\u003e","displayNoNewLineWarning":false,"position":14,"left":3048,"right":3048},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":3049,"text":"+\t\t\t\t\t\t\t\t\t\u0026ccon-\u003einhcount))","html":"+\t\t\t\u003cspan class=\"x x-first x-last\"\u003e\t\t\t\t\t\t\u0026amp;\u003c/span\u003eccon-\u0026gt;inhcount\u003cspan class=\"x x-first x-last\"\u003e)\u003c/span\u003e)","displayNoNewLineWarning":false,"position":15,"left":3048,"right":3049},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":3050,"text":" \t\t\t\tereport(ERROR,","html":" \t\t\t\tereport(ERROR,","displayNoNewLineWarning":false,"position":16,"left":3049,"right":3050},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":3051,"text":" \t\t\t\t\t\terrcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),","html":" \t\t\t\t\t\terrcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),","displayNoNewLineWarning":false,"position":17,"left":3050,"right":3051},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":3052,"text":" \t\t\t\t\t\terrmsg(\"too many inheritance parents\"));","html":" \t\t\t\t\t\terrmsg(\u0026quot;too many inheritance parents\u0026quot;));","displayNoNewLineWarning":false,"position":18,"left":3051,"right":3052},{"stylingDirective":null,"type":"HUNK","blobLineNumber":3347,"text":"@@ -3347,8 +3348,8 @@ MergeInheritedAttribute(List *inh_columns,","html":"@@ -3347,8 +3348,8 @@ MergeInheritedAttribute(List *inh_columns,","displayNoNewLineWarning":false,"position":19,"left":3346,"right":3347},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":3348,"text":" \t * Default and other constraints are handled by the caller.","html":" \t * Default and other constraints are handled by the caller.","displayNoNewLineWarning":false,"position":20,"left":3347,"right":3348},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":3349,"text":" \t */","html":" \t */","displayNoNewLineWarning":false,"position":21,"left":3348,"right":3349},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":3350,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":22,"left":3349,"right":3350},{"stylingDirective":null,"type":"DELETION","blobLineNumber":3350,"text":"-\tprevdef-\u003einhcount++;","html":"-\tprevdef-\u0026gt;inhcount\u003cspan class=\"x x-first x-last\"\u003e++;\u003c/span\u003e","displayNoNewLineWarning":false,"position":23,"left":3350,"right":3350},{"stylingDirective":null,"type":"DELETION","blobLineNumber":3351,"text":"-\tif (prevdef-\u003einhcount \u003c 0)","html":"-\t\u003cspan class=\"x x-first x-last\"\u003eif (\u003c/span\u003eprevdef-\u0026gt;inhcount\u003cspan class=\"x x-first x-last\"\u003e \u0026lt; 0\u003c/span\u003e)","displayNoNewLineWarning":false,"position":24,"left":3351,"right":3350},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":3351,"text":"+\tif (pg_add_s16_overflow(prevdef-\u003einhcount, 1,","html":"+\t\u003cspan class=\"x x-first x-last\"\u003eif (pg_add_s16_overflow(\u003c/span\u003eprevdef-\u0026gt;inhcount\u003cspan class=\"x x-first x-last\"\u003e, 1,\u003c/span\u003e","displayNoNewLineWarning":false,"position":25,"left":3351,"right":3351},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":3352,"text":"+\t\t\t\t\t\t\t\u0026prevdef-\u003einhcount))","html":"+\t\u003cspan class=\"x x-first x-last\"\u003e\t\t\t\t\t\t\u0026amp;\u003c/span\u003eprevdef-\u0026gt;inhcount\u003cspan class=\"x x-first x-last\"\u003e)\u003c/span\u003e)","displayNoNewLineWarning":false,"position":26,"left":3351,"right":3352},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":3353,"text":" \t\tereport(ERROR,","html":" \t\tereport(ERROR,","displayNoNewLineWarning":false,"position":27,"left":3352,"right":3353},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":3354,"text":" \t\t\t\terrcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),","html":" \t\t\t\terrcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),","displayNoNewLineWarning":false,"position":28,"left":3353,"right":3354},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":3355,"text":" \t\t\t\terrmsg(\"too many inheritance parents\"));","html":" \t\t\t\terrmsg(\u0026quot;too many inheritance parents\u0026quot;));","displayNoNewLineWarning":false,"position":29,"left":3354,"right":3355},{"stylingDirective":null,"type":"HUNK","blobLineNumber":7089,"text":"@@ -7089,8 +7090,8 @@ ATExecAddColumn(List **wqueue, AlteredTableInfo *tab, Relation rel,","html":"@@ -7089,8 +7090,8 @@ ATExecAddColumn(List **wqueue, AlteredTableInfo *tab, Relation rel,","displayNoNewLineWarning":false,"position":30,"left":7088,"right":7089},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":7090,"text":" \t\t\t\t\t\t\t\t get_collation_name(childatt-\u003eattcollation))));","html":" \t\t\t\t\t\t\t\t get_collation_name(childatt-\u0026gt;attcollation))));","displayNoNewLineWarning":false,"position":31,"left":7089,"right":7090},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":7091,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":32,"left":7090,"right":7091},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":7092,"text":" \t\t\t/* Bump the existing child att's inhcount */","html":" \t\t\t/* Bump the existing child att\u0026#39;s inhcount */","displayNoNewLineWarning":false,"position":33,"left":7091,"right":7092},{"stylingDirective":null,"type":"DELETION","blobLineNumber":7092,"text":"-\t\t\tchildatt-\u003eattinhcount++;","html":"-\t\t\tchildatt-\u0026gt;attinhcount\u003cspan class=\"x x-first x-last\"\u003e++;\u003c/span\u003e","displayNoNewLineWarning":false,"position":34,"left":7092,"right":7092},{"stylingDirective":null,"type":"DELETION","blobLineNumber":7093,"text":"-\t\t\tif (childatt-\u003eattinhcount \u003c 0)","html":"-\t\t\t\u003cspan class=\"x x-first x-last\"\u003eif (\u003c/span\u003echildatt-\u0026gt;attinhcount\u003cspan class=\"x x-first x-last\"\u003e \u0026lt; 0\u003c/span\u003e)","displayNoNewLineWarning":false,"position":35,"left":7093,"right":7092},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":7093,"text":"+\t\t\tif (pg_add_s16_overflow(childatt-\u003eattinhcount, 1,","html":"+\t\t\t\u003cspan class=\"x x-first x-last\"\u003eif (pg_add_s16_overflow(\u003c/span\u003echildatt-\u0026gt;attinhcount\u003cspan class=\"x x-first x-last\"\u003e, 1,\u003c/span\u003e","displayNoNewLineWarning":false,"position":36,"left":7093,"right":7093},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":7094,"text":"+\t\t\t\t\t\t\t\t\t\u0026childatt-\u003eattinhcount))","html":"+\t\t\t\u003cspan class=\"x x-first x-last\"\u003e\t\t\t\t\t\t\u0026amp;\u003c/span\u003echildatt-\u0026gt;attinhcount\u003cspan class=\"x x-first x-last\"\u003e)\u003c/span\u003e)","displayNoNewLineWarning":false,"position":37,"left":7093,"right":7094},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":7095,"text":" \t\t\t\tereport(ERROR,","html":" \t\t\t\tereport(ERROR,","displayNoNewLineWarning":false,"position":38,"left":7094,"right":7095},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":7096,"text":" \t\t\t\t\t\terrcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),","html":" \t\t\t\t\t\terrcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),","displayNoNewLineWarning":false,"position":39,"left":7095,"right":7096},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":7097,"text":" \t\t\t\t\t\terrmsg(\"too many inheritance parents\"));","html":" \t\t\t\t\t\terrmsg(\u0026quot;too many inheritance parents\u0026quot;));","displayNoNewLineWarning":false,"position":40,"left":7096,"right":7097},{"stylingDirective":null,"type":"HUNK","blobLineNumber":10170,"text":"@@ -10170,7 +10171,7 @@ addFkRecurseReferenced(List **wqueue, Constraint *fkconstraint, Relation rel,","html":"@@ -10170,7 +10171,7 @@ addFkRecurseReferenced(List **wqueue, Constraint *fkconstraint, Relation rel,","displayNoNewLineWarning":false,"position":41,"left":10169,"right":10170},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":10171,"text":" \tOid\t\t\tconstrOid;","html":" \tOid\t\t\tconstrOid;","displayNoNewLineWarning":false,"position":42,"left":10170,"right":10171},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":10172,"text":" \tchar\t *conname;","html":" \tchar\t *conname;","displayNoNewLineWarning":false,"position":43,"left":10171,"right":10172},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":10173,"text":" \tbool\t\tconislocal;","html":" \tbool\t\tconislocal;","displayNoNewLineWarning":false,"position":44,"left":10172,"right":10173},{"stylingDirective":null,"type":"DELETION","blobLineNumber":10173,"text":"-\tint\t\t\tconinhcount;","html":"-\t\u003cspan class=\"x x-first x-last\"\u003eint\t\u003c/span\u003e\t\tconinhcount;","displayNoNewLineWarning":false,"position":45,"left":10173,"right":10173},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":10174,"text":"+\tint16\t\tconinhcount;","html":"+\t\u003cspan class=\"x x-first x-last\"\u003eint16\u003c/span\u003e\t\tconinhcount;","displayNoNewLineWarning":false,"position":46,"left":10173,"right":10174},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":10175,"text":" \tbool\t\tconnoinherit;","html":" \tbool\t\tconnoinherit;","displayNoNewLineWarning":false,"position":47,"left":10174,"right":10175},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":10176,"text":" \tOid\t\t\tdeleteTriggerOid,","html":" \tOid\t\t\tdeleteTriggerOid,","displayNoNewLineWarning":false,"position":48,"left":10175,"right":10176},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":10177,"text":" \t\t\t\tupdateTriggerOid;","html":" \t\t\t\tupdateTriggerOid;","displayNoNewLineWarning":false,"position":49,"left":10176,"right":10177},{"stylingDirective":null,"type":"HUNK","blobLineNumber":10549,"text":"@@ -10549,9 +10550,9 @@ addFkRecurseReferencing(List **wqueue, Constraint *fkconstraint, Relation rel,","html":"@@ -10549,9 +10550,9 @@ addFkRecurseReferencing(List **wqueue, Constraint *fkconstraint, Relation rel,","displayNoNewLineWarning":false,"position":50,"left":10548,"right":10549},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":10550,"text":" \t\t\t\t\t\t\t\t\t NULL,","html":" \t\t\t\t\t\t\t\t\t NULL,","displayNoNewLineWarning":false,"position":51,"left":10549,"right":10550},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":10551,"text":" \t\t\t\t\t\t\t\t\t NULL,","html":" \t\t\t\t\t\t\t\t\t NULL,","displayNoNewLineWarning":false,"position":52,"left":10550,"right":10551},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":10552,"text":" \t\t\t\t\t\t\t\t\t NULL,","html":" \t\t\t\t\t\t\t\t\t NULL,","displayNoNewLineWarning":false,"position":53,"left":10551,"right":10552},{"stylingDirective":null,"type":"DELETION","blobLineNumber":10552,"text":"-\t\t\t\t\t\t\t\t\t false,","html":"-\t\t\t\t\t\t\t\t\t false,","displayNoNewLineWarning":false,"position":54,"left":10552,"right":10552},{"stylingDirective":null,"type":"DELETION","blobLineNumber":10553,"text":"-\t\t\t\t\t\t\t\t\t 1,","html":"-\t\t\t\t\t\t\t\t\t 1,","displayNoNewLineWarning":false,"position":55,"left":10553,"right":10552},{"stylingDirective":null,"type":"DELETION","blobLineNumber":10554,"text":"-\t\t\t\t\t\t\t\t\t false,","html":"-\t\t\t\t\t\t\t\t\t false,","displayNoNewLineWarning":false,"position":56,"left":10554,"right":10552},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":10553,"text":"+\t\t\t\t\t\t\t\t\t false,\t/* conIsLocal */","html":"+\t\t\t\t\t\t\t\t\t false,\u003cspan class=\"x x-first x-last\"\u003e\t/* conIsLocal */\u003c/span\u003e","displayNoNewLineWarning":false,"position":57,"left":10554,"right":10553},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":10554,"text":"+\t\t\t\t\t\t\t\t\t 1,\t/* conInhCount */","html":"+\t\t\t\t\t\t\t\t\t 1,\u003cspan class=\"x x-first x-last\"\u003e\t/* conInhCount */\u003c/span\u003e","displayNoNewLineWarning":false,"position":58,"left":10554,"right":10554},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":10555,"text":"+\t\t\t\t\t\t\t\t\t false,\t/* conNoInherit */","html":"+\t\t\t\t\t\t\t\t\t false,\u003cspan class=\"x x-first x-last\"\u003e\t/* conNoInherit */\u003c/span\u003e","displayNoNewLineWarning":false,"position":59,"left":10554,"right":10555},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":10556,"text":" \t\t\t\t\t\t\t\t\t with_period,\t/* conPeriod */","html":" \t\t\t\t\t\t\t\t\t with_period,\t/* conPeriod */","displayNoNewLineWarning":false,"position":60,"left":10555,"right":10556},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":10557,"text":" \t\t\t\t\t\t\t\t\t false);","html":" \t\t\t\t\t\t\t\t\t false);","displayNoNewLineWarning":false,"position":61,"left":10556,"right":10557},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":10558,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":62,"left":10557,"right":10558},{"stylingDirective":null,"type":"HUNK","blobLineNumber":11076,"text":"@@ -11076,8 +11077,8 @@ CloneFkReferencing(List **wqueue, Relation parentRel, Relation partRel)","html":"@@ -11076,8 +11077,8 @@ CloneFkReferencing(List **wqueue, Relation parentRel, Relation partRel)","displayNoNewLineWarning":false,"position":63,"left":11075,"right":11076},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":11077,"text":" \t\t\t\t\t\t\t\t NULL,","html":" \t\t\t\t\t\t\t\t NULL,","displayNoNewLineWarning":false,"position":64,"left":11076,"right":11077},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":11078,"text":" \t\t\t\t\t\t\t\t NULL,","html":" \t\t\t\t\t\t\t\t NULL,","displayNoNewLineWarning":false,"position":65,"left":11077,"right":11078},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":11079,"text":" \t\t\t\t\t\t\t\t NULL,","html":" \t\t\t\t\t\t\t\t NULL,","displayNoNewLineWarning":false,"position":66,"left":11078,"right":11079},{"stylingDirective":null,"type":"DELETION","blobLineNumber":11079,"text":"-\t\t\t\t\t\t\t\t false,\t/* islocal */","html":"-\t\t\t\t\t\t\t\t false,\t/* \u003cspan class=\"x x-first x-last\"\u003eislocal\u003c/span\u003e */","displayNoNewLineWarning":false,"position":67,"left":11079,"right":11079},{"stylingDirective":null,"type":"DELETION","blobLineNumber":11080,"text":"-\t\t\t\t\t\t\t\t 1,\t/* inhcount */","html":"-\t\t\t\t\t\t\t\t 1,\t/* \u003cspan class=\"x x-first x-last\"\u003einhcount\u003c/span\u003e */","displayNoNewLineWarning":false,"position":68,"left":11080,"right":11079},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":11080,"text":"+\t\t\t\t\t\t\t\t false,\t/* conIsLocal */","html":"+\t\t\t\t\t\t\t\t false,\t/* \u003cspan class=\"x x-first x-last\"\u003econIsLocal\u003c/span\u003e */","displayNoNewLineWarning":false,"position":69,"left":11080,"right":11080},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":11081,"text":"+\t\t\t\t\t\t\t\t 1,\t/* conInhCount */","html":"+\t\t\t\t\t\t\t\t 1,\t/* \u003cspan class=\"x x-first x-last\"\u003econInhCount\u003c/span\u003e */","displayNoNewLineWarning":false,"position":70,"left":11080,"right":11081},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":11082,"text":" \t\t\t\t\t\t\t\t false,\t/* conNoInherit */","html":" \t\t\t\t\t\t\t\t false,\t/* conNoInherit */","displayNoNewLineWarning":false,"position":71,"left":11081,"right":11082},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":11083,"text":" \t\t\t\t\t\t\t\t with_period,\t/* conPeriod */","html":" \t\t\t\t\t\t\t\t with_period,\t/* conPeriod */","displayNoNewLineWarning":false,"position":72,"left":11082,"right":11083},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":11084,"text":" \t\t\t\t\t\t\t\t true);","html":" \t\t\t\t\t\t\t\t true);","displayNoNewLineWarning":false,"position":73,"left":11083,"right":11084},{"stylingDirective":null,"type":"HUNK","blobLineNumber":15944,"text":"@@ -15944,8 +15945,8 @@ MergeAttributesIntoExisting(Relation child_rel, Relation parent_rel, bool ispart","html":"@@ -15944,8 +15945,8 @@ MergeAttributesIntoExisting(Relation child_rel, Relation parent_rel, bool ispart","displayNoNewLineWarning":false,"position":74,"left":15943,"right":15944},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":15945,"text":" \t\t\t * OK, bump the child column's inheritance count. (If we fail","html":" \t\t\t * OK, bump the child column\u0026#39;s inheritance count. (If we fail","displayNoNewLineWarning":false,"position":75,"left":15944,"right":15945},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":15946,"text":" \t\t\t * later on, this change will just roll back.)","html":" \t\t\t * later on, this change will just roll back.)","displayNoNewLineWarning":false,"position":76,"left":15945,"right":15946},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":15947,"text":" \t\t\t */","html":" \t\t\t */","displayNoNewLineWarning":false,"position":77,"left":15946,"right":15947},{"stylingDirective":null,"type":"DELETION","blobLineNumber":15947,"text":"-\t\t\tchild_att-\u003eattinhcount++;","html":"-\t\t\tchild_att-\u0026gt;attinhcount\u003cspan class=\"x x-first x-last\"\u003e++;\u003c/span\u003e","displayNoNewLineWarning":false,"position":78,"left":15947,"right":15947},{"stylingDirective":null,"type":"DELETION","blobLineNumber":15948,"text":"-\t\t\tif (child_att-\u003eattinhcount \u003c 0)","html":"-\t\t\t\u003cspan class=\"x x-first x-last\"\u003eif (\u003c/span\u003echild_att-\u0026gt;attinhcount\u003cspan class=\"x x-first x-last\"\u003e \u0026lt; 0\u003c/span\u003e)","displayNoNewLineWarning":false,"position":79,"left":15948,"right":15947},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":15948,"text":"+\t\t\tif (pg_add_s16_overflow(child_att-\u003eattinhcount, 1,","html":"+\t\t\t\u003cspan class=\"x x-first x-last\"\u003eif (pg_add_s16_overflow(\u003c/span\u003echild_att-\u0026gt;attinhcount\u003cspan class=\"x x-first x-last\"\u003e, 1,\u003c/span\u003e","displayNoNewLineWarning":false,"position":80,"left":15948,"right":15948},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":15949,"text":"+\t\t\t\t\t\t\t\t\t\u0026child_att-\u003eattinhcount))","html":"+\t\t\t\u003cspan class=\"x x-first x-last\"\u003e\t\t\t\t\t\t\u0026amp;\u003c/span\u003echild_att-\u0026gt;attinhcount\u003cspan class=\"x x-first x-last\"\u003e)\u003c/span\u003e)","displayNoNewLineWarning":false,"position":81,"left":15948,"right":15949},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":15950,"text":" \t\t\t\tereport(ERROR,","html":" \t\t\t\tereport(ERROR,","displayNoNewLineWarning":false,"position":82,"left":15949,"right":15950},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":15951,"text":" \t\t\t\t\t\terrcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),","html":" \t\t\t\t\t\terrcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),","displayNoNewLineWarning":false,"position":83,"left":15950,"right":15951},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":15952,"text":" \t\t\t\t\t\terrmsg(\"too many inheritance parents\"));","html":" \t\t\t\t\t\terrmsg(\u0026quot;too many inheritance parents\u0026quot;));","displayNoNewLineWarning":false,"position":84,"left":15951,"right":15952},{"stylingDirective":null,"type":"HUNK","blobLineNumber":16075,"text":"@@ -16075,8 +16076,9 @@ MergeConstraintsIntoExisting(Relation child_rel, Relation parent_rel)","html":"@@ -16075,8 +16076,9 @@ MergeConstraintsIntoExisting(Relation child_rel, Relation parent_rel)","displayNoNewLineWarning":false,"position":85,"left":16074,"right":16075},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":16076,"text":" \t\t\t */","html":" \t\t\t */","displayNoNewLineWarning":false,"position":86,"left":16075,"right":16076},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":16077,"text":" \t\t\tchild_copy = heap_copytuple(child_tuple);","html":" \t\t\tchild_copy = heap_copytuple(child_tuple);","displayNoNewLineWarning":false,"position":87,"left":16076,"right":16077},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":16078,"text":" \t\t\tchild_con = (Form_pg_constraint) GETSTRUCT(child_copy);","html":" \t\t\tchild_con = (Form_pg_constraint) GETSTRUCT(child_copy);","displayNoNewLineWarning":false,"position":88,"left":16077,"right":16078},{"stylingDirective":null,"type":"DELETION","blobLineNumber":16078,"text":"-\t\t\tchild_con-\u003econinhcount++;","html":"-\t\t\tchild_con-\u0026gt;coninhcount++;","displayNoNewLineWarning":false,"position":89,"left":16078,"right":16078},{"stylingDirective":null,"type":"DELETION","blobLineNumber":16079,"text":"-\t\t\tif (child_con-\u003econinhcount \u003c 0)","html":"-\t\t\tif (child_con-\u0026gt;coninhcount \u0026lt; 0)","displayNoNewLineWarning":false,"position":90,"left":16079,"right":16078},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":16079,"text":"+","html":"+","displayNoNewLineWarning":false,"position":91,"left":16079,"right":16079},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":16080,"text":"+\t\t\tif (pg_add_s16_overflow(child_con-\u003econinhcount, 1,","html":"+\t\t\tif (pg_add_s16_overflow(child_con-\u0026gt;coninhcount, 1,","displayNoNewLineWarning":false,"position":92,"left":16079,"right":16080},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":16081,"text":"+\t\t\t\t\t\t\t\t\t\u0026child_con-\u003econinhcount))","html":"+\t\t\t\t\t\t\t\t\t\u0026amp;child_con-\u0026gt;coninhcount))","displayNoNewLineWarning":false,"position":93,"left":16079,"right":16081},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":16082,"text":" \t\t\t\tereport(ERROR,","html":" \t\t\t\tereport(ERROR,","displayNoNewLineWarning":false,"position":94,"left":16080,"right":16082},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":16083,"text":" \t\t\t\t\t\terrcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),","html":" \t\t\t\t\t\terrcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),","displayNoNewLineWarning":false,"position":95,"left":16081,"right":16083},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":16084,"text":" \t\t\t\t\t\terrmsg(\"too many inheritance parents\"));","html":" \t\t\t\t\t\terrmsg(\u0026quot;too many inheritance parents\u0026quot;));","displayNoNewLineWarning":false,"position":96,"left":16082,"right":16084}],"diffNumber":3,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":20205,"linesChanged":34,"newTreeEntry":{"lineCount":20205,"path":"src/backend/commands/tablecmds.c","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"src/backend/commands/tablecmds.c","mode":100644},"linesAdded":18,"linesDeleted":16,"path":"src/backend/commands/tablecmds.c","pathDigest":"d373fb790605aded212c2e3a0fbe8c015d110077ff46c07d0a6d6647a2d7e928","status":"MODIFIED","truncatedReason":null,"oldOid":"1909835c28a144bf957254eea1f4a4dabafbbaee","newOid":"fd64ed60b62697984bb69a09a3ae19fbe2905eb6","copilotChatReference":null,"deletedSha":"1909835c28a144bf957254eea1f4a4dabafbbaee","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null},{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":56,"text":"@@ -57,6 +57,6 @@","html":"@@ -57,6 +57,6 @@","displayNoNewLineWarning":false,"position":0,"left":56,"right":56},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":57,"text":" */","html":" \u003cspan class=pl-c\u003e */\u003c/span\u003e","displayNoNewLineWarning":false,"position":1,"left":57,"right":57},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":58,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":2,"left":58,"right":58},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":59,"text":" /*\t\t\t\t\t\t\tyyyymmddN */","html":" \u003cspan class=pl-c\u003e/*\t\t\t\t\t\t\tyyyymmddN */\u003c/span\u003e","displayNoNewLineWarning":false,"position":3,"left":59,"right":59},{"stylingDirective":null,"type":"DELETION","blobLineNumber":60,"text":"-#define CATALOG_VERSION_NO\t202410111","html":"-\u003cspan class=\"pl-k\"\u003e#define\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003eCATALOG_VERSION_NO\u003c/span\u003e\t\u003cspan class=\"x x-first x-last\"\u003e202410111\u003c/span\u003e","displayNoNewLineWarning":false,"position":4,"left":60,"right":59},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":60,"text":"+#define CATALOG_VERSION_NO\t202410112","html":"+\u003cspan class=\"pl-k\"\u003e#define\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003eCATALOG_VERSION_NO\u003c/span\u003e\t\u003cspan class=\"x x-first x-last\"\u003e202410112\u003c/span\u003e","displayNoNewLineWarning":false,"position":5,"left":60,"right":60},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":61,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":6,"left":61,"right":61},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":62,"text":" #endif","html":" \u003cspan class=pl-k\u003e#endif\u003c/span\u003e","displayNoNewLineWarning":false,"position":7,"left":62,"right":62}],"diffNumber":4,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":62,"linesChanged":2,"newTreeEntry":{"lineCount":62,"path":"src/include/catalog/catversion.h","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"src/include/catalog/catversion.h","mode":100644},"linesAdded":1,"linesDeleted":1,"path":"src/include/catalog/catversion.h","pathDigest":"ee3a5187a356cefc95d2bd7330e9f5de9f7606e872b36b834d9c03f0b6cb4e32","status":"MODIFIED","truncatedReason":null,"oldOid":"1909835c28a144bf957254eea1f4a4dabafbbaee","newOid":"fd64ed60b62697984bb69a09a3ae19fbe2905eb6","copilotChatReference":null,"deletedSha":"1909835c28a144bf957254eea1f4a4dabafbbaee","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null},{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":40,"text":"@@ -41,7 +41,7 @@ typedef struct CookedConstraint","html":"@@ -41,7 +41,7 @@ typedef struct CookedConstraint","displayNoNewLineWarning":false,"position":0,"left":40,"right":40},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":41,"text":" \tNode\t *expr;\t\t\t/* transformed default or check expr */","html":" \t\u003cspan class=pl-smi\u003eNode\u003c/span\u003e\t \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-c1\u003eexpr\u003c/span\u003e;\t\t\t\u003cspan class=pl-c\u003e/* transformed default or check expr */\u003c/span\u003e","displayNoNewLineWarning":false,"position":1,"left":41,"right":41},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":42,"text":" \tbool\t\tskip_validation;\t/* skip validation? (only for CHECK) */","html":" \t\u003cspan class=pl-smi\u003ebool\u003c/span\u003e\t\t\u003cspan class=pl-c1\u003eskip_validation\u003c/span\u003e;\t\u003cspan class=pl-c\u003e/* skip validation? (only for CHECK) */\u003c/span\u003e","displayNoNewLineWarning":false,"position":2,"left":42,"right":42},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":43,"text":" \tbool\t\tis_local;\t\t/* constraint has local (non-inherited) def */","html":" \t\u003cspan class=pl-smi\u003ebool\u003c/span\u003e\t\t\u003cspan class=pl-c1\u003eis_local\u003c/span\u003e;\t\t\u003cspan class=pl-c\u003e/* constraint has local (non-inherited) def */\u003c/span\u003e","displayNoNewLineWarning":false,"position":3,"left":43,"right":43},{"stylingDirective":null,"type":"DELETION","blobLineNumber":44,"text":"-\tint\t\t\tinhcount;\t\t/* number of times constraint is inherited */","html":"-\t\u003cspan class=\"pl-smi x x-first\"\u003eint\u003c/span\u003e\u003cspan class=\"x x-last\"\u003e\t\u003c/span\u003e\t\t\u003cspan class=\"pl-c1\"\u003einhcount\u003c/span\u003e;\t\t\u003cspan class=\"pl-c\"\u003e/* number of times constraint is inherited */\u003c/span\u003e","displayNoNewLineWarning":false,"position":4,"left":44,"right":43},{"stylingDirective":null,"type":"ADDITION","blobLineNumb 8000 er":44,"text":"+\tint16\t\tinhcount;\t\t/* number of times constraint is inherited */","html":"+\t\u003cspan class=\"pl-smi x x-first x-last\"\u003eint16\u003c/span\u003e\t\t\u003cspan class=\"pl-c1\"\u003einhcount\u003c/span\u003e;\t\t\u003cspan class=\"pl-c\"\u003e/* number of times constraint is inherited */\u003c/span\u003e","displayNoNewLineWarning":false,"position":5,"left":44,"right":44},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":45,"text":" \tbool\t\tis_no_inherit;\t/* constraint has local def and cannot be","html":" \t\u003cspan class=pl-smi\u003ebool\u003c/span\u003e\t\t\u003cspan class=pl-c1\u003eis_no_inherit\u003c/span\u003e;\t\u003cspan class=pl-c\u003e/* constraint has local def and cannot be\u003c/span\u003e","displayNoNewLineWarning":false,"position":6,"left":45,"right":45},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":46,"text":" \t\t\t\t\t\t\t\t * inherited */","html":" \u003cspan class=pl-c\u003e\t\t\t\t\t\t\t\t * inherited */\u003c/span\u003e","displayNoNewLineWarning":false,"position":7,"left":46,"right":46},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":47,"text":" } CookedConstraint;","html":" } \u003cspan class=pl-smi\u003eCookedConstraint\u003c/span\u003e;","displayNoNewLineWarning":false,"position":8,"left":47,"right":47}],"diffNumber":5,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":159,"linesChanged":2,"newTreeEntry":{"lineCount":159,"path":"src/include/catalog/heap.h","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"src/include/catalog/heap.h","mode":100644},"linesAdded":1,"linesDeleted":1,"path":"src/include/catalog/heap.h","pathDigest":"314181e929ceabb3622edd6dd606dce97621220f17b19157ca3af5f50144c656","status":"MODIFIED","truncatedReason":null,"oldOid":"1909835c28a144bf957254eea1f4a4dabafbbaee","newOid":"fd64ed60b62697984bb69a09a3ae19fbe2905eb6","copilotChatReference":null,"deletedSha":"1909835c28a144bf957254eea1f4a4dabafbbaee","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null},{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":244,"text":"@@ -245,7 +245,7 @@ extern Oid\tCreateConstraintEntry(const char *constraintName,","html":"@@ -245,7 +245,7 @@ extern Oid\tCreateConstraintEntry(const char *constraintName,","displayNoNewLineWarning":false,"position":0,"left":244,"right":244},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":245,"text":" \t\t\t\t\t\t\t\t Node *conExpr,","html":" \t\t\t\t\t\t\t\t \u003cspan class=pl-smi\u003eNode\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003econExpr\u003c/span\u003e,","displayNoNewLineWarning":false,"position":1,"left":245,"right":245},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":246,"text":" \t\t\t\t\t\t\t\t const char *conBin,","html":" \t\t\t\t\t\t\t\t \u003cspan class=pl-k\u003econst\u003c/span\u003e \u003cspan class=pl-smi\u003echar\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003econBin\u003c/span\u003e,","displayNoNewLineWarning":false,"position":2,"left":246,"right":246},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":247,"text":" \t\t\t\t\t\t\t\t bool conIsLocal,","html":" \t\t\t\t\t\t\t\t \u003cspan class=pl-smi\u003ebool\u003c/span\u003e \u003cspan class=pl-s1\u003econIsLocal\u003c/span\u003e,","displayNoNewLineWarning":false,"position":3,"left":247,"right":247},{"stylingDirective":null,"type":"DELETION","blobLineNumber":248,"text":"-\t\t\t\t\t\t\t\t int conInhCount,","html":"-\t\t\t\t\t\t\t\t \u003cspan class=\"pl-smi x x-first x-last\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003econInhCount\u003c/span\u003e,","displayNoNewLineWarning":false,"position":4,"left":248,"right":247},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":248,"text":"+\t\t\t\t\t\t\t\t int16 conInhCount,","html":"+\t\t\t\t\t\t\t\t \u003cspan class=\"pl-smi x x-first x-last\"\u003eint16\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003econInhCount\u003c/span\u003e,","displayNoNewLineWarning":false,"position":5,"left":248,"right":248},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":249,"text":" \t\t\t\t\t\t\t\t bool conNoInherit,","html":" \t\t\t\t\t\t\t\t \u003cspan class=pl-smi\u003ebool\u003c/span\u003e \u003cspan class=pl-s1\u003econNoInherit\u003c/span\u003e,","displayNoNewLineWarning":false,"position":6,"left":249,"right":249},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":250,"text":" \t\t\t\t\t\t\t\t bool conPeriod,","html":" \t\t\t\t\t\t\t\t \u003cspan class=pl-smi\u003ebool\u003c/span\u003e \u003cspan class=pl-s1\u003econPeriod\u003c/span\u003e,","displayNoNewLineWarning":false,"position":7,"left":250,"right":250},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":251,"text":" \t\t\t\t\t\t\t\t bool is_internal);","html":" \t\t\t\t\t\t\t\t \u003cspan class=pl-smi\u003ebool\u003c/span\u003e \u003cspan class=pl-s1\u003eis_internal\u003c/span\u003e);","displayNoNewLineWarning":false,"position":8,"left":251,"right":251}],"diffNumber":6,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":291,"linesChanged":2,"newTreeEntry":{"lineCount":291,"path":"src/include/catalog/pg_constraint.h","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"src/include/catalog/pg_constraint.h","mode":100644},"linesAdded":1,"linesDeleted":1,"path":"src/include/catalog/pg_constraint.h","pathDigest":"10df2d867c1a97ac545971bff4d5011cf34fcb44d12edc2818f38056fb453b97","status":"MODIFIED","truncatedReason":null,"oldOid":"1909835c28a144bf957254eea1f4a4dabafbbaee","newOid":"fd64ed60b62697984bb69a09a3ae19fbe2905eb6","copilotChatReference":null,"deletedSha":"1909835c28a144bf957254eea1f4a4dabafbbaee","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null},{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":727,"text":"@@ -728,7 +728,7 @@ typedef struct ColumnDef","html":"@@ -728,7 +728,7 @@ typedef struct ColumnDef","displayNoNewLineWarning":false,"position":0,"left":727,"right":727},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":728,"text":" \tchar\t *colname;\t\t/* name of column */","html":" \t\u003cspan class=pl-smi\u003echar\u003c/span\u003e\t \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-c1\u003ecolname\u003c/span\u003e;\t\t\u003cspan class=pl-c\u003e/* name of column */\u003c/span\u003e","displayNoNewLineWarning":false,"position":1,"left":728,"right":728},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":729,"text":" \tTypeName *typeName;\t\t/* type of column */","html":" \t\u003cspan class=pl-smi\u003eTypeName\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-c1\u003etypeName\u003c/span\u003e;\t\t\u003cspan class=pl-c\u003e/* type of column */\u003c/span\u003e","displayNoNewLineWarning":false,"position":2,"left":729,"right":729},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":730,"text":" \tchar\t *compression;\t/* compression method for column */","html":" \t\u003cspan class=pl-smi\u003echar\u003c/span\u003e\t \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-c1\u003ecompression\u003c/span\u003e;\t\u003cspan class=pl-c\u003e/* compression method for column */\u003c/span\u003e","displayNoNewLineWarning":false,"position":3,"left":730,"right":730},{"stylingDirective":null,"type":"DELETION","blobLineNumber":731,"text":"-\tint\t\t\tinhcount;\t\t/* number of times column is inherited */","html":"-\t\u003cspan class=\"pl-smi x x-first\"\u003eint\u003c/span\u003e\u003cspan class=\"x x-last\"\u003e\t\u003c/span\u003e\t\t\u003cspan class=\"pl-c1\"\u003einhcount\u003c/span\u003e;\t\t\u003cspan class=\"pl-c\"\u003e/* number of times column is inherited */\u003c/span\u003e","displayNoNewLineWarning":false,"position":4,"left":731,"right":730},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":731,"text":"+\tint16\t\tinhcount;\t\t/* number of times column is inherited */","html":"+\t\u003cspan class=\"pl-smi x x-first x-last\"\u003eint16\u003c/span\u003e\t\t\u003cspan class=\"pl-c1\"\u003einhcount\u003c/span\u003e;\t\t\u003cspan class=\"pl-c\"\u003e/* number of times column is inherited */\u003c/span\u003e","displayNoNewLineWarning":false,"position":5,"left":731,"right":731},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":732,"text":" \tbool\t\tis_local;\t\t/* column has local (non-inherited) def'n */","html":" \t\u003cspan class=pl-smi\u003ebool\u003c/span\u003e\t\t\u003cspan class=pl-c1\u003eis_local\u003c/span\u003e;\t\t\u003cspan class=pl-c\u003e/* column has local (non-inherited) def\u0026#39;n */\u003c/span\u003e","displayNoNewLineWarning":false,"position":6,"left":732,"right":732},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":733,"text":" \tbool\t\tis_not_null;\t/* NOT NULL constraint specified? */","html":" \t\u003cspan class=pl-smi\u003ebool\u003c/span\u003e\t\t\u003cspan class=pl-c1\u003eis_not_null\u003c/span\u003e;\t\u003cspan class=pl-c\u003e/* NOT NULL constraint specified? */\u003c/span\u003e","displayNoNewLineWarning":false,"position":7,"left":733,"right":733},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":734,"text":" \tbool\t\tis_from_type;\t/* column definition came from table type */","html":" \t\u003cspan class=pl-smi\u003ebool\u003c/span\u003e\t\t\u003cspan class=pl-c1\u003eis_from_type\u003c/span\u003e;\t\u003cspan class=pl-c\u003e/* column definition came from table type */\u003c/span\u003e","displayNoNewLineWarning":false,"position":8,"left":734,"right":734},{"stylingDirective":null,"type":"HUNK","blobLineNumber":2753,"text":"@@ -2754,8 +2754,6 @@ typedef struct Constraint","html":"@@ -2754,8 +2754,6 @@ typedef struct Constraint","displayNoNewLineWarning":false,"position":9,"left":2753,"right":2753},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2754,"text":" \tchar\t *cooked_expr;\t/* CHECK or DEFAULT expression, as","html":" \t\u003cspan class=pl-smi\u003echar\u003c/span\u003e\t \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-c1\u003ecooked_expr\u003c/span\u003e;\t\u003cspan class=pl-c\u003e/* CHECK or DEFAULT expression, as\u003c/span\u003e","displayNoNewLineWarning":false,"position":10,"left":2754,"right":2754},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2755,"text":" \t\t\t\t\t\t\t\t * nodeToString representation */","html":" \u003cspan class=pl-c\u003e\t\t\t\t\t\t\t\t * nodeToString representation */\u003c/span\u003e","displayNoNewLineWarning":false,"position":11,"left":2755,"right":2755},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2756,"text":" \tchar\t\tgenerated_when; /* ALWAYS or BY DEFAULT */","html":" \t\u003cspan class=pl-smi\u003echar\u003c/span\u003e\t\t\u003cspan class=pl-c1\u003egenerated_when\u003c/span\u003e; \u003cspan class=pl-c\u003e/* ALWAYS or BY DEFAULT */\u003c/span\u003e","displayNoNewLineWarning":false,"position":12,"left":2756,"right":2756},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2757,"text":"-\tint\t\t\tinhcount;\t\t/* initial inheritance count to apply, for","html":"-\t\u003cspan class=pl-smi\u003eint\u003c/span\u003e\t\t\t\u003cspan class=pl-c1\u003einhcount\u003c/span\u003e;\t\t\u003cspan class=pl-c\u003e/* initial inheritance count to apply, for\u003c/span\u003e","displayNoNewLineWarning":false,"position":13,"left":2757,"right":2756},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2758,"text":"-\t\t\t\t\t\t\t\t * \"raw\" NOT NULL constraints */","html":"-\u003cspan class=pl-c\u003e\t\t\t\t\t\t\t\t * \u0026quot;raw\u0026quot; NOT NULL constraints */\u003c/span\u003e","displayNoNewLineWarning":false,"position":14,"left":2758,"right":2756},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2757,"text":" \tbool\t\tnulls_not_distinct; /* null treatment for UNIQUE constraints */","html":" \t\u003cspan class=pl-smi\u003ebool\u003c/span\u003e\t\t\u003cspan class=pl-c1\u003enulls_not_distinct\u003c/span\u003e; \u003cspan class=pl-c\u003e/* null treatment for UNIQUE constraints */\u003c/span\u003e","displayNoNewLineWarning":false,"position":15,"left":2759,"right":2757},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2758,"text":" \tList\t *keys;\t\t\t/* String nodes naming referenced key","html":" \t\u003cspan class=pl-smi\u003eList\u003c/span\u003e\t \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-c1\u003ekeys\u003c/span\u003e;\t\t\t\u003cspan class=pl-c\u003e/* String nodes naming referenced key\u003c/span\u003e","displayNoNewLineWarning":false,"position":16,"left":2760,"right":2758},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2759,"text":" \t\t\t\t\t\t\t\t * column(s); for UNIQUE/PK/NOT NULL */","html":" \u003cspan class=pl-c\u003e\t\t\t\t\t\t\t\t * column(s); for UNIQUE/PK/NOT NULL */\u003c/span\u003e","displayNoNewLineWarning":false,"position":17,"left":2761,"right":2759}],"diffNumber":7,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":4249,"linesChanged":4,"newTreeEntry":{"lineCount":4249,"path":"src/include/nodes/parsenodes.h","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"src/include/nodes/parsenodes.h","mode":100644},"linesAdded":1,"linesDeleted":3,"path":"src/include/nodes/parsenodes.h","pathDigest":"314bfdaa9449d8e6590fdd5043ec842cf3892371871bf84579fdb77313b32104","status":"MODIFIED","truncatedReason":null,"oldOid":"1909835c28a144bf957254eea1f4a4dabafbbaee","newOid":"fd64ed60b62697984bb69a09a3ae19fbe2905eb6","copilotChatReference":null,"deletedSha":"1909835c28a144bf957254eea1f4a4dabafbbaee","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null}],"splitViewPreference":"unified","ignoreWhitespace":false,"repoOwnerGlobalRelayId":"MDEyOk9yZ2FuaXphdGlvbjE3NzU0Mw==","commentsPreference":"visible","diffLineSpacingPreference":"relaxed","useMonospaceFont":false,"pasteUrlLinkAsPlainText":false,"userNotices":[],"path":"/postgres/postgres/commit/fd64ed60b62697984bb69a09a3ae19fbe2905eb6","fileTreeExpanded":true,"headerInfo":{"additions":32,"deletions":32,"filesChanged":8,"filesChangedString":"8"},"moreDiffsToLoad":false,"asyncDiffLoadInfo":{"startIndex":8,"truncated":false,"byteCount":7965,"lineShownCount":213},"commentInfo":{"canComment":false,"locked":false,"canLock":false,"repoArchived":false},"csrf_tokens":{"/users/diffview?diff=split":{"post":"hJgyhUVbE3g49I971__U59KYpeIGBnZbw0GP4bdB86N96c213ZLjDmgq7Uhvwb1KAQjQCUYlQMQjn2CmQ-l6Iw"},"/users/diffview?diff=unified":{"post":"KyZhfZa4sXEwRXzQ3rd8YD47KB7sY2qHggentZSK_3DSV55NDnFBB2CbHuNmiRXN7atd9axAXBhi2UjyYCJ28A"},"/notifications/thread":{"post":"jZTdrAa8xf2Ov_JWkKvKa9_QpZS138i1Ug8pieera9zC5i20mCtTfiM9Tv3QxUih6Y4bFLDKE5bmgqx-wHPdJw"}}},"title":"Unbreak overflow test for attinhcount/coninhcount · postgres/postgres@fd64ed6","appPayload":{"helpUrl":"https://docs.github.com","findInDiffWorkerPath":"/assets-cdn/worker/find-in-diff-worker-2bfe39677d14.js","enabled_features":{"diff_ux_refresh_beta":false,"diff_inline_comments":true,"diff_ux_refresh_ssr_five":false,"diff_ux_refresh_ssr_ten":false,"react_diff_line_type_character_correction":true}}}

Commit fd64ed6

Browse files
alvherrejianhe-fun
andcommitted
Unbreak overflow test for attinhcount/coninhcount
Commit 90189ee narrowed pg_attribute.attinhcount and pg_constraint.coninhcount from 32 to 16 bits, but kept other related structs with 32-bit wide fields: ColumnDef and CookedConstraint contain an int 'inhcount' field which is itself checked for overflow on increments, but there's no check that the values aren't above INT16_MAX before assigning to the catalog columns. This means that a creative user can get a inconsistent table definition and override some protections. Fix it by changing those other structs to also use int16. Also, modernize style by using pg_add_s16_overflow for overflow testing instead of checking for negative values. We also have Constraint.inhcount, which is here removed completely. This was added by commit b0e96f3 and not removed by its revert at 6f8bb7c. It is not needed by the upcoming not-null constraints patch. This is mostly academic, so we agreed not to backpatch to avoid ABI problems. Bump catversion because of the changes to parse nodes. Co-authored-by: Álvaro Herrera <alvherre@alvh.no-ip.org> Co-authored-by: 何建 (jian he) <jian.universality@gmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/202410081611.up4iyofb5ie7@alvherre.pgsql
1 parent 1909835 commit fd64ed6

File tree

8 files changed

+32
-32
lines changed

8 files changed

+32
-32
lines changed

src/backend/catalog/heap.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ static ObjectAddress AddNewRelationType(const char *typeName,
102102
Oid new_array_type);
103103
static void RelationRemoveInheritance(Oid relid);
104104
static Oid StoreRelCheck(Relation rel, const char *ccname, Node *expr,
105-
bool is_validated, bool is_local, int inhcount,
105+
bool is_validated, bool is_local, int16 inhcount,
106106
bool is_no_inherit, bool is_internal);
107107
static void StoreConstraints(Relation rel, List *cooked_constraints,
108108
bool is_internal);
@@ -2072,7 +2072,7 @@ SetAttrMissing(Oid relid, char *attname, char *value)
20722072
*/
20732073
static Oid
20742074
StoreRelCheck(Relation rel, const char *ccname, Node *expr,
2075-
bool is_validated, bool is_local, int inhcount,
2075+
bool is_validated, bool is_local, int16 inhcount,
20762076
bool is_no_inherit, bool is_internal)
20772077
{
20782078
char *ccbin;
@@ -2624,10 +2624,8 @@ MergeWithExistingConstraint(Relation rel, const char *ccname, Node *expr,
26242624
{
26252625
if (is_local)
26262626
con->conislocal = true;
2627-
else
2628-
con->coninhcount++;
2629-
2630-
if (con->coninhcount < 0)
2627+
else if (pg_add_s16_overflow(con->coninhcount, 1,
2628+
&con->coninhcount))
26312629
ereport(ERROR,
26322630
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
26332631
errmsg("too many inheritance parents"));

src/backend/catalog/index.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1900,7 +1900,7 @@ index_constraint_create(Relation heapRelation,
19001900
bool islocal;
19011901
bool noinherit;
19021902
bool is_without_overlaps;
1903-
int inhcount;
1903+
int16 inhcount;
19041904

19051905
deferrable = (constr_flags & INDEX_CONSTR_CREATE_DEFERRABLE) != 0;
19061906
initdeferred = (constr_flags & INDEX_CONSTR_CREATE_INIT_DEFERRED) != 0;

src/backend/catalog/pg_constraint.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "catalog/pg_operator.h"
2828
#include "catalog/pg_type.h"
2929
#include "commands/defrem.h"
30+
#include "common/int.h"
3031
#include "utils/array.h"
3132
#include "utils/builtins.h"
3233
#include "utils/fmgroids.h"
@@ -74,7 +75,7 @@ CreateConstraintEntry(const char *constraintName,
7475
Node *conExpr,
7576
const char *conBin,
7677
bool conIsLocal,
77-
int conInhCount,
78+
int16 conInhCount,
7879
bool conNoInherit,
7980
bool conPeriod,
8081
bool is_internal)
@@ -849,11 +850,12 @@ ConstraintSetParentConstraint(Oid childConstrId,
849850
childConstrId);
850851

851852
constrForm->conislocal = false;
852-
constrForm->coninhcount++;
853-
if (constrForm->coninhcount < 0)
853+
if (pg_add_s16_overflow(constrForm->coninhcount, 1,
854+
&constrForm->coninhcount))
854855
ereport(ERROR,
855856
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
856857
errmsg("too many inheritance parents"));
858+
857859
constrForm->conparentid = parentConstrId;
858860

859861
CatalogTupleUpdate(constrRel, &tuple->t_self, newtup);

src/backend/commands/tablecmds.c

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
#include "commands/typecmds.h"
6767
#include "commands/user.h"
6868
#include "commands/vacuum.h"
69+
#include "common/int.h"
6970
#include "executor/executor.h"
7071
#include "foreign/fdwapi.h"
7172
#include "foreign/foreign.h"
@@ -3044,8 +3045,8 @@ MergeCheckConstraint(List *constraints, const char *name, Node *expr)
30443045
if (equal(expr, ccon->expr))
30453046
{
30463047
/* OK to merge constraint with existing */
3047-
ccon->inhcount++;
3048-
if (ccon->inhcount < 0)
3048+
if (pg_add_s16_overflow(ccon->inhcount, 1,
3049+
&ccon->inhcount))
30493050
ereport(ERROR,
30503051
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
30513052
errmsg("too many inheritance parents"));
@@ -3347,8 +3348,8 @@ MergeInheritedAttribute(List *inh_columns,
33473348
* Default and other constraints are handled by the caller.
33483349
*/
33493350

3350-
prevdef->inhcount++;
3351-
if (prevdef->inhcount < 0)
3351+
if (pg_add_s16_overflow(prevdef->inhcount, 1,
3352+
&prevdef->inhcount))
33523353
ereport(ERROR,
33533354
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
33543355
errmsg("too many inheritance parents"));
@@ -7089,8 +7090,8 @@ ATExecAddColumn(List **wqueue, AlteredTableInfo *tab, Relation rel,
70897090
get_collation_name(childatt->attcollation))));
70907091

70917092
/* Bump the existing child att's inhcount */
7092-
childatt->attinhcount++;
7093-
if (childatt->attinhcount < 0)
7093+
if (pg_add_s16_overflow(childatt->attinhcount, 1,
7094+
&childatt->attinhcount))
70947095
ereport(ERROR,
70957096
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
70967097
errmsg("too many inheritance parents"));
@@ -10170,7 +10171,7 @@ addFkRecurseReferenced(List **wqueue, Constraint *fkconstraint, Relation rel,
1017010171
Oid constrOid;
1017110172
char *conname;
1017210173
bool conislocal;
10173-
int coninhcount;
10174+
int16 coninhcount;
1017410175
bool connoinherit;
1017510176
Oid deleteTriggerOid,
1017610177
updateTriggerOid;
@@ -10549,9 +10550,9 @@ addFkRecurseReferencing(List **wqueue, Constraint *fkconstraint, Relation rel,
1054910550
NULL,
1055010551
NULL,
1055110552
NULL,
10552-
false,
10553-
1,
10554-
false,
10553+
false, /* conIsLocal */
10554+
1, /* conInhCount */
10555+
false, /* conNoInherit */
1055510556
with_period, /* conPeriod */
1055610557
false);
1055710558

@@ -11076,8 +11077,8 @@ CloneFkReferencing(List **wqueue, Relation parentRel, Relation partRel)
1107611077
NULL,
1107711078
NULL,
1107811079
NULL,
11079-
false, /* islocal */
11080-
1, /* inhcount */
11080+
false, /* conIsLocal */
11081+
1, /* conInhCount */
1108111082
false, /* conNoInherit */
1108211083
with_period, /* conPeriod */
1108311084
true);
@@ -15944,8 +15945,8 @@ MergeAttributesIntoExisting(Relation child_rel, Relation parent_rel, bool ispart
1594415945
* OK, bump the child column's inheritance count. (If we fail
1594515946
* later on, this change will just roll back.)
1594615947
*/
15947-
child_att->attinhcount++;
15948-
if (child_att->attinhcount < 0)
15948+
if (pg_add_s16_overflow(child_att->attinhcount, 1,
15949+
&child_att->attinhcount))
1594915950
ereport(ERROR,
1595015951
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
1595115952
errmsg("too many inheritance parents"));
@@ -16075,8 +16076,9 @@ MergeConstraintsIntoExisting(Relation child_rel, Relation parent_rel)
1607516076
*/
1607616077
child_copy = heap_copytuple(child_tuple);
1607716078
child_con = (Form_pg_constraint) GETSTRUCT(child_copy);
16078-
child_con->coninhcount++;
16079-
if (child_con->coninhcount < 0)
16079+
16080+
if (pg_add_s16_overflow(child_con->coninhcount, 1,
16081+
&child_con->coninhcount))
1608016082
ereport(ERROR,
1608116083
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
1608216084
errmsg("too many inheritance parents"));

src/include/catalog/catversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@
5757
*/
5858

5959
/* yyyymmddN */
60-
#define CATALOG_VERSION_NO 202410111
60+
#define CATALOG_VERSION_NO 202410112
6161

6262
#endif

src/include/catalog/heap.h

Lines changed: 1 addition & 1 deletion
E979
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ typedef struct CookedConstraint
4141
Node *expr; /* transformed default or check expr */
4242
bool skip_validation; /* skip validation? (only for CHECK) */
4343
bool is_local; /* constraint has local (non-inherited) def */
44-
int inhcount; /* number of times constraint is inherited */
44+
int16 inhcount; /* number of times constraint is inherited */
4545
bool is_no_inherit; /* constraint has local def and cannot be
4646
* inherited */
4747
} CookedConstraint;

src/include/catalog/pg_constraint.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ extern Oid CreateConstraintEntry(const char *constraintName,
245245
Node *conExpr,
246246
const char *conBin,
247247
bool conIsLocal,
248-
int conInhCount,
248+
int16 conInhCount,
249249
bool conNoInherit,
250250
bool conPeriod,
251251
bool is_internal);

src/include/nodes/parsenodes.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ typedef struct ColumnDef
728728
char *colname; /* name of column */
729729
TypeName *typeName; /* type of column */
730730
char *compression; /* compression method for column */
731-
int inhcount; /* number of times column is inherited */
731+
int16 inhcount; /* number of times column is inherited */
732732
bool is_local; /* column has local (non-inherited) def'n */
733733
bool is_not_null; /* NOT NULL constraint specified? */
734734
bool is_from_type; /* column definition came from table type */
@@ -2754,8 +2754,6 @@ typedef struct Constraint
27542754
char *cooked_expr; /* CHECK or DEFAULT expression, as
27552755
* nodeToString representation */
27562756
char generated_when; /* ALWAYS or BY DEFAULT */
2757-
int inhcount; /* initial inheritance count to apply, for
2758-
* "raw" NOT NULL constraints */
27592757
bool nulls_not_distinct; /* null treatment for UNIQUE constraints */
27602758
List *keys; /* String nodes naming referenced key
27612759
* column(s); for UNIQUE/PK/NOT NULL */

0 commit comments

Comments
 (0)
0