-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Revert "Revert "Revert "Fix Upgrade Test""""
This reverts commit 24d87db.
- Loading branch information
Nirmit Shah
committed
Jan 20, 2025
1 parent
f3e35c8
commit 82c861a
Showing
42 changed files
with
764 additions
and
36 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
15 changes: 15 additions & 0 deletions
15
test/JDBC/expected/test_conv_float_to_varchar_char_before_17_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,15 @@ | ||
DROP TABLE TestResults | ||
DROP VIEW float_char_v1; | ||
DROP VIEW float_char_v2; | ||
DROP FUNCTION float_char_f1; | ||
DROP FUNCTION float_char_f2; | ||
DROP PROCEDURE float_char_p1; | ||
DROP TABLE float_char_t1; | ||
DROP TABLE TestResults_1 | ||
DROP VIEW float_varchar_v1; | ||
DROP VIEW float_varchar_v2; | ||
DROP FUNCTION float_varchar_f1; | ||
DROP FUNCTION float_varchar_f2; | ||
DROP PROCEDURE float_varchar_p1; | ||
DROP TABLE float_varchar_t1; | ||
GO |
162 changes: 162 additions & 0 deletions
162
test/JDBC/expected/test_conv_float_to_varchar_char_before_17_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,162 @@ | ||
CREATE TABLE float_char_t1 ( | ||
ID INT IDENTITY(1,1), | ||
FloatValue FLOAT, | ||
Description VARCHAR(100) | ||
); | ||
GO | ||
-- Create dependent objects for testing | ||
-- 1. View that uses CAST | ||
CREATE VIEW float_char_v1 | ||
AS | ||
SELECT | ||
CAST(CAST('-123.456' AS FLOAT) AS CHAR(30)) AS CastValue | ||
GO | ||
|
||
-- 2. View that uses CONVERT | ||
CREATE VIEW float_char_v2 | ||
AS | ||
SELECT | ||
CONVERT(CHAR(30), CAST('-123.456' as FLOAT)) AS ConvertValue | ||
GO | ||
|
||
-- 3. Function using CAST | ||
CREATE FUNCTION float_char_f1 | ||
( | ||
@FloatInput FLOAT | ||
) | ||
RETURNS VARCHAR(30) | ||
AS | ||
BEGIN | ||
RETURN CAST(@FloatInput AS CHAR(30)) | ||
END; | ||
GO | ||
|
||
-- 4. Function using CONVERT | ||
CREATE FUNCTION float_char_f2 | ||
( | ||
@FloatInput FLOAT | ||
) | ||
RETURNS VARCHAR(30) | ||
AS | ||
BEGIN | ||
RETURN CONVERT(CHAR(30), @FloatInput) | ||
END; | ||
GO | ||
|
||
CREATE PROCEDURE float_char_p1 | ||
@FloatInput FLOAT | ||
AS | ||
BEGIN | ||
SELECT | ||
CAST(@FloatInput AS CHAR(30)) AS CastResult, | ||
CONVERT(CHAR(30), @FloatInput) AS ConvertResult | ||
END; | ||
GO | ||
|
||
-- Insert test data | ||
INSERT INTO float_char_t1 (FloatValue, Description) VALUES | ||
(123.456, 'Standard positive decimal'), | ||
(-123.456, 'Negative decimal'), | ||
(0.0, 'Zero value'), | ||
(1E10, 'Scientific notation - large'), | ||
(1E-10, 'Scientific notation - small'), | ||
(9999999999.99, 'Large decimal'), | ||
(0.000000001, 'Very small decimal'), | ||
(NULL, 'NULL Value') | ||
GO | ||
~~ROW COUNT: 8~~ | ||
|
||
|
||
|
||
CREATE TABLE TestResults ( | ||
TestID INT IDENTITY(1,1), | ||
TestCategory VARCHAR(50), | ||
TestName VARCHAR(100), | ||
TestScenario VARCHAR(200), | ||
ExpectedResult VARCHAR(50), | ||
ActualResult VARCHAR(50), | ||
TestStatus VARCHAR(20) | ||
); | ||
GO | ||
|
||
|
||
CREATE TABLE float_varchar_t1 ( | ||
ID INT IDENTITY(1,1), | ||
FloatValue FLOAT, | ||
Description VARCHAR(100) | ||
); | ||
GO | ||
-- Create dependent objects for testing | ||
-- 1. View that uses CAST | ||
CREATE VIEW float_varchar_v1 | ||
AS | ||
SELECT | ||
CAST(CAST('-123.456' AS FLOAT) AS VARCHAR(30)) AS CastValue | ||
GO | ||
|
||
-- 2. View that uses CONVERT | ||
CREATE VIEW float_varchar_v2 | ||
AS | ||
SELECT | ||
CONVERT(CHAR(30), CAST('-123.456' as FLOAT)) AS ConvertValue | ||
GO | ||
|
||
-- 3. Function using CAST | ||
CREATE FUNCTION float_varchar_f1 | ||
( | ||
@FloatInput FLOAT | ||
) | ||
RETURNS VARCHAR(30) | ||
AS | ||
BEGIN | ||
RETURN CAST(@FloatInput AS VARCHAR(30)) | ||
END; | ||
GO | ||
|
||
-- 4. Function using CONVERT | ||
CREATE FUNCTION float_varchar_f2 | ||
( | ||
@FloatInput FLOAT | ||
) | ||
RETURNS VARCHAR(30) | ||
AS | ||
BEGIN | ||
RETURN CONVERT(VARCHAR(30), @FloatInput) | ||
END; | ||
GO | ||
|
||
CREATE PROCEDURE float_varchar_p1 | ||
@FloatInput FLOAT | ||
AS | ||
BEGIN | ||
SELECT | ||
CAST(@FloatInput AS VARCHAR(30)) AS CastResult, | ||
CONVERT(VARCHAR(30), @FloatInput) AS ConvertResult | ||
END; | ||
GO | ||
|
||
-- Insert test data | ||
INSERT INTO float_varchar_t1 (FloatValue, Description) VALUES | ||
(123.456, 'Standard positive decimal'), | ||
(-123.456, 'Negative decimal'), | ||
(0.0, 'Zero value'), | ||
(1E10, 'Scientific notation - large'), | ||
(1E-10, 'Scientific notation - small'), | ||
(9999999999.99, 'Large decimal'), | ||
(0.000000001, 'Very small decimal'), | ||
(NULL, 'NULL Value') | ||
GO | ||
~~ROW COUNT: 8~~ | ||
|
||
|
||
|
||
CREATE TABLE TestResults_1 ( | ||
TestID INT IDENTITY(1,1), | ||
TestCategory VARCHAR(50), | ||
TestName VARCHAR(100), | ||
TestScenario VARCHAR(200), | ||
ExpectedResult VARCHAR(50), | ||
ActualResult VARCHAR(50), | ||
TestStatus VARCHAR(20) | ||
); | ||
GO |
Oops, something went wrong.