-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make NEWID() and NEWSEQUENTIALID() functions VOLATILE
Altering a table to add a column with DEFAULT NEWID() makes the values all the same value which is not the correct bheaviour. This is because NEWID and NEWSEQUENTIALID are both STABLE when then should be VOLATILE. Task: BABEL-4923 Signed-off-by: Kristian Lejao <[email protected]>
- Loading branch information
Showing
25 changed files
with
1,481 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
BBFPGCMN_MAJOR_VERSION=2 | ||
BBFPGCMN_MINOR_VERSION=6 | ||
BBFPGCMN_MINOR_VERSION=7 | ||
BBFPGCMN_MICRO_VERSION=0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
contrib/babelfishpg_common/sql/upgrades/babelfishpg_common--2.6.0--2.7.0.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
-- complain if script is sourced in psql, rather than via ALTER EXTENSION | ||
\echo Use "ALTER EXTENSION ""babelfishpg_common"" UPDATE TO '2.7.0'" to load this file. \quit | ||
|
||
SELECT set_config('search_path', 'sys, '||current_setting('search_path'), false); | ||
|
||
ALTER FUNCTION sys.newid() VOLATILE; | ||
ALTER FUNCTION sys.NEWSEQUENTIALID() VOLATILE; | ||
|
||
-- Reset search_path to not affect any subsequent scripts | ||
SELECT set_config('search_path', trim(leading 'sys, ' from current_setting('search_path')), false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
test/JDBC/expected/newid_before_14_12_or_15_7_or_16_3-vu-cleanup.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
DROP PROC babel_4923_newid_proc | ||
DROP PROC babel_4923_newid_proc_2 | ||
GO | ||
|
||
DROP TABLE babel_4923_newid_tab2 | ||
DROP TABLE babel_4923_newid_tab3 | ||
DROP TABLE babel_4923_newid_tab4 | ||
GO |
Oops, something went wrong.