forked from babelfish-for-postgresql/babelfish_extensions
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix behavioural differences due to return type and handle constant st…
…ring literal inputs differently for COALESCE function (babelfish-for-postgresql#2533) This change adds a new function select_common_type_for_coalesce_function to choose the return datatype which will be called from tsql_select_common_type_hook whenever the caller function is T-SQL COALESCE. Issues Resolved [BABEL-726] Engine PR : babelfish-for-postgresql/postgresql_modified_for_babelfish#345 Signed-off-by: Sai Rohan Basa [email protected]
- Loading branch information
1 parent
81c59da
commit b80c264
Showing
24 changed files
with
1,199 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
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
8 changes: 8 additions & 0 deletions
8
test/JDBC/expected/babel_726-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,8 @@ | ||
DROP FUNCTION babel_726_f1 | ||
GO | ||
|
||
DROP VIEW babel_726_v1 | ||
GO | ||
|
||
DROP PROCEDURE babel_726_p1 | ||
GO |
38 changes: 38 additions & 0 deletions
38
test/JDBC/expected/babel_726-before-14_12-or-15_7-or-16_3-vu-prepare.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,38 @@ | ||
CREATE FUNCTION babel_726_f1(@a smallint, @b bit) | ||
RETURNS BIT AS | ||
BEGIN | ||
DECLARE @ans BIT | ||
SELECT @ans = COALESCE(@b, @a) | ||
RETURN @ans | ||
END | ||
GO | ||
|
||
CREATE VIEW babel_726_v1 AS SELECT COALESCE(CAST(1 as BIT), CAST(5 as SMALLINT)) | ||
GO | ||
|
||
CREATE PROCEDURE babel_726_p1 AS SELECT COALESCE(CAST(1 as BIT), CAST(5 as SMALLINT)) | ||
GO | ||
|
||
SELECT babel_726_f1(6,0) | ||
GO | ||
~~START~~ | ||
bit | ||
0 | ||
~~END~~ | ||
|
||
|
||
SELECT * FROM babel_726_v1 | ||
GO | ||
~~START~~ | ||
bit | ||
1 | ||
~~END~~ | ||
|
||
|
||
EXEC babel_726_p1 | ||
GO | ||
~~START~~ | ||
bit | ||
1 | ||
~~END~~ | ||
|
23 changes: 23 additions & 0 deletions
23
test/JDBC/expected/babel_726-before-14_12-or-15_7-or-16_3-vu-verify.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,23 @@ | ||
SELECT babel_726_f1(6,0) | ||
GO | ||
~~START~~ | ||
bit | ||
0 | ||
~~END~~ | ||
|
||
|
||
SELECT * FROM babel_726_v1 | ||
GO | ||
~~START~~ | ||
bit | ||
1 | ||
~~END~~ | ||
|
||
|
||
EXEC babel_726_p1 | ||
GO | ||
~~START~~ | ||
smallint | ||
1 | ||
~~END~~ | ||
|
Oops, something went wrong.