-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ExecProcessReturning is unexpectedly called twice for psql request ca…
…using overflow error (#488) In community postgresql, ExecProcessReturning is called once after the main process of ExecInsert. But due to some merging errors related to Babelfish and T-SQL, this function is wrongly called twice for psql requests. At the first call, the xmax is not initialized causing unexpected error raising. The first intention of these pieces of codes is to call it in the first place only for T-SQL(CR-52326143). And then got wrongly cherry-picked in CR-57250041. Finally, the condition check gets removed in CR-65026879. We should keep the first intention of the codes, which also makes it consistent with the behaviour in ExecUpdate. Task: BABEL-5343 Signed-off-by: Bo Li <[email protected]>
- Loading branch information
Showing
4 changed files
with
31 additions
and
2 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
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,21 @@ | ||
CREATE TABLE toverflow(id SERIAL, col1 VARCHAR); | ||
INSERT INTO toverflow VALUES (default, 'hope') RETURNING xmax::text::int; | ||
xmax | ||
------ | ||
0 | ||
(1 row) | ||
|
||
INSERT INTO toverflow VALUES (default, 'jack') RETURNING xmax; | ||
xmax | ||
------ | ||
0 | ||
(1 row) | ||
|
||
SELECT * FROM toverflow ORDER BY id; | ||
id | col1 | ||
----+------ | ||
1 | hope | ||
2 | jack | ||
(2 rows) | ||
|
||
DROP TABLE toverflow; |
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
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,5 @@ | ||
CREATE TABLE toverflow(id SERIAL, col1 VARCHAR); | ||
INSERT INTO toverflow VALUES (default, 'hope') RETURNING xmax::text::int; | ||
INSERT INTO toverflow VALUES (default, 'jack') RETURNING xmax; | ||
SELECT * FROM toverflow ORDER BY id; | ||
DROP TABLE toverflow; |