-
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.
Fix Convert() to return correct date format with char and nchar (#2448)
Earlier when we were converting from DATE/TIME types to CHAR or NCHAR type using CONVERT function the output style was not getting into account as we have not handled the case for CHAR and NCHAR type in TsqlFunctionConvert function correctly. This commit add changes to handle the case for CHAR and NCHAR correctly. Task: BABEL-4641 Signed-off-by: Rohit Bhagat <[email protected]>
- Loading branch information
1 parent
ed88bd1
commit fdb469e
Showing
48 changed files
with
3,114 additions
and
123 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
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
4 changes: 4 additions & 0 deletions
4
test/JDBC/expected/BABEL-3147-before-16_3-or-15_7-or-14_12-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,4 @@ | ||
DROP TABLE BABEL_3147_before_16_3_or_15_7_vu_prepare_t_1 | ||
DROP TABLE BABEL_3147_before_16_3_or_15_7_vu_prepare_t_2 | ||
DROP TABLE BABEL_3147_before_16_3_or_15_7_vu_prepare_t_3 | ||
GO |
33 changes: 33 additions & 0 deletions
33
test/JDBC/expected/BABEL-3147-before-16_3-or-15_7-or-14_12-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,33 @@ | ||
CREATE TABLE BABEL_3147_before_16_3_or_15_7_vu_prepare_t_1 ( | ||
c [int] NULL, | ||
c_comp AS ISNULL(CONVERT(CHAR(1), 'A'), 'B') | ||
) | ||
GO | ||
|
||
CREATE TABLE BABEL_3147_before_16_3_or_15_7_vu_prepare_t_2 ( | ||
a numeric(6, 4), | ||
b numeric(6, 3) | ||
) | ||
GO | ||
|
||
INSERT INTO BABEL_3147_before_16_3_or_15_7_vu_prepare_t_2 VALUES (10.1234, 10.123); | ||
INSERT INTO BABEL_3147_before_16_3_or_15_7_vu_prepare_t_2 VALUES (NULL, 101.123); | ||
GO | ||
~~ROW COUNT: 1~~ | ||
|
||
~~ROW COUNT: 1~~ | ||
|
||
|
||
CREATE TABLE BABEL_3147_before_16_3_or_15_7_vu_prepare_t_3 ( | ||
a decimal(6, 4), | ||
b decimal(6, 3) | ||
) | ||
GO | ||
|
||
INSERT INTO BABEL_3147_before_16_3_or_15_7_vu_prepare_t_3 VALUES (10.1234, 10.123); | ||
INSERT INTO BABEL_3147_before_16_3_or_15_7_vu_prepare_t_3 VALUES (NULL, 101.123); | ||
GO | ||
~~ROW COUNT: 1~~ | ||
|
||
~~ROW COUNT: 1~~ | ||
|
32 changes: 32 additions & 0 deletions
32
test/JDBC/expected/BABEL-3147-before-16_3-or-15_7-or-14_12-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,32 @@ | ||
INSERT INTO BABEL_3147_before_16_3_or_15_7_vu_prepare_t_1 VALUES(1) | ||
GO | ||
~~ROW COUNT: 1~~ | ||
|
||
|
||
SELECT c_comp FROM BABEL_3147_before_16_3_or_15_7_vu_prepare_t_1 | ||
GO | ||
~~START~~ | ||
char | ||
A | ||
~~END~~ | ||
|
||
|
||
-- Test ISNULL with numeric columns | ||
SELECT ISNULL(a, b) FROM BABEL_3147_before_16_3_or_15_7_vu_prepare_t_2 | ||
GO | ||
~~START~~ | ||
numeric | ||
10.1234 | ||
101.1230 | ||
~~END~~ | ||
|
||
|
||
-- Test ISNULL with decimal columns | ||
SELECT ISNULL(a, b) FROM BABEL_3147_before_16_3_or_15_7_vu_prepare_t_3 | ||
GO | ||
~~START~~ | ||
numeric | ||
10.1234 | ||
101.1230 | ||
~~END~~ | ||
|
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,9 @@ | ||
-- error should not have been thrown, should be fixed under BABEL-1710 | ||
DROP TABLE BABEL_3147_vu_prepare_t_1 | ||
DROP TABLE BABEL_3147_vu_prepare_t_2 | ||
DROP TABLE BABEL_3147_vu_prepare_t_3 | ||
GO | ||
~~ERROR (Code: 3701)~~ | ||
|
||
~~ERROR (Message: table "babel_3147_vu_prepare_t_1" does not exist)~~ | ||
|
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
175 changes: 175 additions & 0 deletions
175
test/JDBC/expected/BABEL-4641-before-16_3-or-15_7-or-14_12-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,175 @@ | ||
-- CHAR | ||
DROP VIEW babel_4461_before_16_3_or_15_7_char_vu_prepare_view1 | ||
GO | ||
|
||
DROP VIEW babel_4461_before_16_3_or_15_7_char_vu_prepare_view11 | ||
GO | ||
|
||
DROP VIEW babel_4461_before_16_3_or_15_7_char_vu_prepare_view12 | ||
GO | ||
|
||
DROP VIEW babel_4461_before_16_3_or_15_7_char_vu_prepare_view2 | ||
GO | ||
|
||
DROP VIEW babel_4461_before_16_3_or_15_7_char_vu_prepare_view22 | ||
GO | ||
|
||
DROP VIEW babel_4461_before_16_3_or_15_7_char_vu_prepare_view3 | ||
GO | ||
|
||
DROP VIEW babel_4461_before_16_3_or_15_7_char_vu_prepare_view31 | ||
GO | ||
|
||
DROP VIEW babel_4461_before_16_3_or_15_7_char_vu_prepare_view32 | ||
GO | ||
|
||
DROP PROCEDURE babel_4461_before_16_3_or_15_7_char_vu_prepare_proc1 | ||
GO | ||
|
||
DROP PROCEDURE babel_4461_before_16_3_or_15_7_char_vu_prepare_proc11 | ||
GO | ||
|
||
DROP PROCEDURE babel_4461_before_16_3_or_15_7_char_vu_prepare_proc12 | ||
GO | ||
|
||
DROP PROCEDURE babel_4461_before_16_3_or_15_7_char_vu_prepare_proc2 | ||
GO | ||
|
||
DROP PROCEDURE babel_4461_before_16_3_or_15_7_char_vu_prepare_proc22 | ||
GO | ||
|
||
DROP PROCEDURE babel_4461_before_16_3_or_15_7_char_vu_prepare_proc3 | ||
GO | ||
|
||
DROP PROCEDURE babel_4461_before_16_3_or_15_7_char_vu_prepare_proc31 | ||
GO | ||
|
||
DROP PROCEDURE babel_4461_before_16_3_or_15_7_char_vu_prepare_proc32 | ||
GO | ||
|
||
DROP FUNCTION babel_4461_before_16_3_or_15_7_char_vu_prepare_func1 | ||
GO | ||
|
||
DROP FUNCTION babel_4461_before_16_3_or_15_7_char_vu_prepare_func11 | ||
GO | ||
|
||
DROP FUNCTION babel_4461_before_16_3_or_15_7_char_vu_prepare_func12 | ||
GO | ||
|
||
DROP FUNCTION babel_4461_before_16_3_or_15_7_char_vu_prepare_func2 | ||
GO | ||
|
||
DROP FUNCTION babel_4461_before_16_3_or_15_7_char_vu_prepare_func22 | ||
GO | ||
|
||
DROP FUNCTION babel_4461_before_16_3_or_15_7_char_vu_prepare_func3 | ||
GO | ||
|
||
DROP FUNCTION babel_4461_before_16_3_or_15_7_char_vu_prepare_func31 | ||
GO | ||
|
||
DROP FUNCTION babel_4461_before_16_3_or_15_7_char_vu_prepare_func32 | ||
GO | ||
|
||
DROP VIEW babel_4461_before_16_3_or_15_7_char_vu_prepare_view4 | ||
GO | ||
|
||
DROP VIEW babel_4461_before_16_3_or_15_7_char_vu_prepare_view5 | ||
GO | ||
|
||
DROP VIEW babel_4461_before_16_3_or_15_7_char_vu_prepare_view6 | ||
GO | ||
|
||
DROP VIEW babel_4461_before_16_3_or_15_7_char_vu_prepare_view7 | ||
GO | ||
|
||
DROP VIEW babel_4461_before_16_3_or_15_7_char_vu_prepare_view8 | ||
GO | ||
|
||
-- NCHAR | ||
DROP VIEW babel_4461_before_16_3_or_15_7_nchar_vu_prepare_view1 | ||
GO | ||
|
||
DROP VIEW babel_4461_before_16_3_or_15_7_nchar_vu_prepare_view11 | ||
GO | ||
|
||
DROP VIEW babel_4461_before_16_3_or_15_7_nchar_vu_prepare_view12 | ||
GO | ||
|
||
DROP VIEW babel_4461_before_16_3_or_15_7_nchar_vu_prepare_view2 | ||
GO | ||
|
||
DROP VIEW babel_4461_before_16_3_or_15_7_nchar_vu_prepare_view22 | ||
GO | ||
|
||
DROP VIEW babel_4461_before_16_3_or_15_7_nchar_vu_prepare_view3 | ||
GO | ||
|
||
DROP VIEW babel_4461_before_16_3_or_15_7_nchar_vu_prepare_view31 | ||
GO | ||
|
||
DROP VIEW babel_4461_before_16_3_or_15_7_nchar_vu_prepare_view32 | ||
GO | ||
|
||
DROP PROCEDURE babel_4461_before_16_3_or_15_7_nchar_vu_prepare_proc1 | ||
GO | ||
|
||
DROP PROCEDURE babel_4461_before_16_3_or_15_7_nchar_vu_prepare_proc11 | ||
GO | ||
|
||
DROP PROCEDURE babel_4461_before_16_3_or_15_7_nchar_vu_prepare_proc12 | ||
GO | ||
|
||
DROP PROCEDURE babel_4461_before_16_3_or_15_7_nchar_vu_prepare_proc2 | ||
GO | ||
|
||
DROP PROCEDURE babel_4461_before_16_3_or_15_7_nchar_vu_prepare_proc22 | ||
GO | ||
|
||
DROP PROCEDURE babel_4461_before_16_3_or_15_7_nchar_vu_prepare_proc3 | ||
GO | ||
|
||
DROP PROCEDURE babel_4461_before_16_3_or_15_7_nchar_vu_prepare_proc31 | ||
GO | ||
|
||
DROP PROCEDURE babel_4461_before_16_3_or_15_7_nchar_vu_prepare_proc32 | ||
GO | ||
|
||
DROP FUNCTION babel_4461_before_16_3_or_15_7_nchar_vu_prepare_func1 | ||
GO | ||
|
||
DROP FUNCTION babel_4461_before_16_3_or_15_7_nchar_vu_prepare_func11 | ||
GO | ||
|
||
DROP FUNCTION babel_4461_before_16_3_or_15_7_nchar_vu_prepare_func12 | ||
GO | ||
|
||
DROP FUNCTION babel_4461_before_16_3_or_15_7_nchar_vu_prepare_func2 | ||
GO | ||
|
||
DROP FUNCTION babel_4461_before_16_3_or_15_7_nchar_vu_prepare_func22 | ||
GO | ||
|
||
DROP FUNCTION babel_4461_before_16_3_or_15_7_nchar_vu_prepare_func3 | ||
GO | ||
|
||
DROP FUNCTION babel_4461_before_16_3_or_15_7_nchar_vu_prepare_func31 | ||
GO | ||
|
||
DROP FUNCTION babel_4461_before_16_3_or_15_7_nchar_vu_prepare_func32 | ||
GO | ||
|
||
DROP VIEW babel_4461_before_16_3_or_15_7_nchar_vu_prepare_view4 | ||
GO | ||
|
||
DROP VIEW babel_4461_before_16_3_or_15_7_nchar_vu_prepare_view5 | ||
GO | ||
|
||
DROP VIEW babel_4461_before_16_3_or_15_7_nchar_vu_prepare_view6 | ||
GO | ||
|
||
DROP VIEW babel_4461_before_16_3_or_15_7_nchar_vu_prepare_view7 | ||
GO | ||
|
||
DROP VIEW babel_4461_before_16_3_or_15_7_nchar_vu_prepare_view8 | ||
GO |
Oops, something went wrong.