forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd35631e
committed
Fix potential crash after constraint violation errors in partitioned tables.
During the reporting of constraint violations for partitioned tables,ExecPartitionCheckEmitError(), ExecConstraints(),ExecWithCheckOptions() set the slot descriptor of the input slot tothe root partition's tuple desc. That's generally problematic whenthe slot could be used by other routines, but can cause crashes afterthe introduction of slots with "fixed" tuple descriptors inad7dbee.The problem likely escaped detection so far for two reasons: First,currently the only known way that these routines are used with apartitioned table that is not "owned" by partitioning code is when"fast defaults" are used for the child partition. Second, as an erroris raised afterwards, an "external" slot that had its descriptorchanged, is very unlikely to continue being used.Even though the issue currently is only known to cause a crash for11 (as that has both fast defaults and "fixed" slot descriptors), itseems worth applying the fix to 10 too. Potentially changing randomslots is hazardous.Regression tests will be added in a separate commit, as it seems bestto add them for master and 12 too.Reported-By: Daniel WMAuthor: Andres FreundBug: #16293Discussion:https://postgr.es/m/16293-26f5777d10143a66@postgresql.orgBackpatch: 11, 10 only1 parent25bf317 commitd35631e
1 file changed
+8
-4
lines changedLines changed: 8 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1932 | 1932 |
| |
1933 | 1933 |
| |
1934 | 1934 |
| |
1935 |
| - | |
| 1935 | + | |
| 1936 | + | |
1936 | 1937 |
| |
1937 | 1938 |
| |
1938 | 1939 |
| |
| |||
2011 | 2012 |
| |
2012 | 2013 |
| |
2013 | 2014 |
| |
2014 |
| - | |
| 2015 | + | |
| 2016 | + | |
2015 | 2017 |
| |
2016 | 2018 |
| |
2017 | 2019 |
| |
| |||
2059 | 2061 |
| |
2060 | 2062 |
| |
2061 | 2063 |
| |
2062 |
| - | |
| 2064 | + | |
| 2065 | + | |
2063 | 2066 |
| |
2064 | 2067 |
| |
2065 | 2068 |
| |
| |||
2165 | 2168 |
| |
2166 | 2169 |
| |
2167 | 2170 |
| |
2168 |
| - | |
| 2171 | + | |
| 2172 | + | |
2169 | 2173 |
| |
2170 | 2174 |
| |
2171 | 2175 |
| |
|
0 commit comments
Comments
(0)