forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0b5c161
committed
amcheck: Don't load the right sibling page into BtreeCheckState
5ae2087 implemented a cross-page unique constraint check by loadingthe right sibling to the BtreeCheckState.target variable. This is wrong,because bt_target_page_check() shouldn't change the target page. Also,BtreeCheckState.target shouldn't be changed alone withoutBtreeCheckState.targetblock.However, the above didn't cause any visible bugs for the following reasons.1. We do a cross-page unique constraint check only for leaf index pages.2. The only way target page get accessed after a cross-page unique constraint check is loading of the lowkey.3. The only place lowkey is used is bt_child_highkey_check(), and that applies only to non-leafs.The reasons above don't diminish the fact that changing BtreeCheckState.targetfor a cross-page unique constraint check is wrong. This commit changes thischeck to temporarily store the right sibling to the local variable.Reported-by: Peter GeogheganDiscussion:https://postgr.es/m/CAH2-Wzk%2B2116uOXdOViA27SHcr31WKPgmjsxXLBs_aTxAeThzg%40mail.gmail.comAuthor: Pavel Borisov1 parent532d94f commit0b5c161
1 file changed
+9
-5
lines changedLines changed: 9 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1892 | 1892 |
| |
1893 | 1893 |
| |
1894 | 1894 |
| |
| 1895 | + | |
| 1896 | + | |
1895 | 1897 |
| |
1896 |
| - | |
1897 |
| - | |
1898 |
| - | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
1899 | 1901 |
| |
1900 | 1902 |
| |
1901 | 1903 |
| |
1902 | 1904 |
| |
1903 | 1905 |
| |
1904 |
| - | |
| 1906 | + | |
1905 | 1907 |
| |
1906 |
| - | |
| 1908 | + | |
1907 | 1909 |
| |
1908 | 1910 |
| |
| 1911 | + | |
| 1912 | + | |
1909 | 1913 |
| |
1910 | 1914 |
| |
1911 | 1915 |
| |
|
0 commit comments
Comments
(0)