From 82c861af53fe24b94110bec94e39b5081fb85dba Mon Sep 17 00:00:00 2001 From: Nirmit Shah Date: Mon, 20 Jan 2025 17:59:43 +0000 Subject: [PATCH] Revert "Revert "Revert "Revert "Fix Upgrade Test"""" This reverts commit 24d87db31393e88dff3beea23e2df7103d90b5e9. --- .../chinese_prc_ci_as/babel_function.out | 2 +- ...to_varchar_char_before_17_3-vu-cleanup.out | 15 + ...to_varchar_char_before_17_3-vu-prepare.out | 162 +++++++++++ ..._to_varchar_char_before_17_3-vu-verify.out | 265 ++++++++++++++++++ ...to_varchar_char_before_17_3-vu-cleanup.sql | 15 + ...to_varchar_char_before_17_3-vu-prepare.sql | 158 +++++++++++ ..._to_varchar_char_before_17_3-vu-verify.sql | 113 ++++++++ test/JDBC/upgrade/13_4/schedule | 2 +- test/JDBC/upgrade/13_5/schedule | 2 +- test/JDBC/upgrade/13_6/schedule | 2 +- test/JDBC/upgrade/13_7/schedule | 2 +- test/JDBC/upgrade/13_8/schedule | 2 +- test/JDBC/upgrade/13_9/schedule | 2 +- test/JDBC/upgrade/14_10/schedule | 2 +- test/JDBC/upgrade/14_11/schedule | 2 +- test/JDBC/upgrade/14_12/schedule | 2 +- test/JDBC/upgrade/14_13/schedule | 2 +- test/JDBC/upgrade/14_15/schedule | 2 +- test/JDBC/upgrade/14_16/schedule | 2 +- test/JDBC/upgrade/14_3/schedule | 2 +- test/JDBC/upgrade/14_5/schedule | 2 +- test/JDBC/upgrade/14_6/schedule | 2 +- test/JDBC/upgrade/14_7/schedule | 2 +- test/JDBC/upgrade/14_8/schedule | 2 +- test/JDBC/upgrade/14_9/schedule | 2 +- test/JDBC/upgrade/15_1/schedule | 2 +- test/JDBC/upgrade/15_10/schedule | 2 +- test/JDBC/upgrade/15_11/schedule | 2 +- test/JDBC/upgrade/15_2/schedule | 2 +- test/JDBC/upgrade/15_3/schedule | 2 +- test/JDBC/upgrade/15_4/schedule | 2 +- test/JDBC/upgrade/15_5/schedule | 2 +- test/JDBC/upgrade/15_6/schedule | 2 +- test/JDBC/upgrade/15_7/schedule | 2 +- test/JDBC/upgrade/15_8/schedule | 2 +- test/JDBC/upgrade/16_1/schedule | 2 +- test/JDBC/upgrade/16_2/schedule | 2 +- test/JDBC/upgrade/16_3/schedule | 2 +- test/JDBC/upgrade/16_4/schedule | 2 +- test/JDBC/upgrade/16_6/schedule | 2 +- test/JDBC/upgrade/16_7/schedule | 2 +- test/JDBC/upgrade/17_2/schedule | 2 +- 42 files changed, 764 insertions(+), 36 deletions(-) create mode 100644 test/JDBC/expected/test_conv_float_to_varchar_char_before_17_3-vu-cleanup.out create mode 100644 test/JDBC/expected/test_conv_float_to_varchar_char_before_17_3-vu-prepare.out create mode 100644 test/JDBC/expected/test_conv_float_to_varchar_char_before_17_3-vu-verify.out create mode 100644 test/JDBC/input/functions/test_conv_float_to_varchar_char_before_17_3-vu-cleanup.sql create mode 100644 test/JDBC/input/functions/test_conv_float_to_varchar_char_before_17_3-vu-prepare.sql create mode 100644 test/JDBC/input/functions/test_conv_float_to_varchar_char_before_17_3-vu-verify.sql diff --git a/test/JDBC/expected/non_default_server_collation/chinese_prc_ci_as/babel_function.out b/test/JDBC/expected/non_default_server_collation/chinese_prc_ci_as/babel_function.out index 285db065e57..cd3b7fd394c 100644 --- a/test/JDBC/expected/non_default_server_collation/chinese_prc_ci_as/babel_function.out +++ b/test/JDBC/expected/non_default_server_collation/chinese_prc_ci_as/babel_function.out @@ -297,7 +297,7 @@ select TRY_CONVERT(varchar(30), CAST('11234561231231.234' AS float), 0); GO ~~START~~ varchar - +1.12346e+13 ~~END~~ select TRY_CONVERT(varchar(30), CAST('11234561231231.234'AS float), 1); diff --git a/test/JDBC/expected/test_conv_float_to_varchar_char_before_17_3-vu-cleanup.out b/test/JDBC/expected/test_conv_float_to_varchar_char_before_17_3-vu-cleanup.out new file mode 100644 index 00000000000..f2d2ad5624b --- /dev/null +++ b/test/JDBC/expected/test_conv_float_to_varchar_char_before_17_3-vu-cleanup.out @@ -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 diff --git a/test/JDBC/expected/test_conv_float_to_varchar_char_before_17_3-vu-prepare.out b/test/JDBC/expected/test_conv_float_to_varchar_char_before_17_3-vu-prepare.out new file mode 100644 index 00000000000..4ce504a473c --- /dev/null +++ b/test/JDBC/expected/test_conv_float_to_varchar_char_before_17_3-vu-prepare.out @@ -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 diff --git a/test/JDBC/expected/test_conv_float_to_varchar_char_before_17_3-vu-verify.out b/test/JDBC/expected/test_conv_float_to_varchar_char_before_17_3-vu-verify.out new file mode 100644 index 00000000000..e7f5b004b3d --- /dev/null +++ b/test/JDBC/expected/test_conv_float_to_varchar_char_before_17_3-vu-verify.out @@ -0,0 +1,265 @@ + + + + + + +-- TEST FOR CHAR +DECLARE @TestCases TABLE ( + FloatValue FLOAT, + ScenarioDescription VARCHAR(200) +); +INSERT INTO @TestCases +SELECT FloatValue, Description FROM float_char_t1; +-- 1. Test Direct CAST/CONVERT +INSERT INTO TestResults (TestCategory, TestName, TestScenario, ExpectedResult, ActualResult) +SELECT + 'Direct Conversion', + 'CAST vs CONVERT', + tc.ScenarioDescription, + CAST(tc.FloatValue AS CHAR(30)), + CONVERT(CHAR(30), tc.FloatValue) +FROM @TestCases tc; +-- Display Results by Category +SELECT + TestCategory, + TestName, + TestScenario, + ExpectedResult, + ActualResult, + TestStatus +FROM TestResults +ORDER BY TestCategory, TestID; +-- Test Stored Procedure Execution +DECLARE @FloatValue FLOAT; +DECLARE cur CURSOR FOR SELECT FloatValue FROM @TestCases; +OPEN cur; +FETCH NEXT FROM cur INTO @FloatValue; +WHILE @@FETCH_STATUS = 0 +BEGIN + EXEC float_char_p1 @FloatValue; + FETCH NEXT FROM cur INTO @FloatValue; +END +CLOSE cur; +DEALLOCATE cur; +GO +~~ROW COUNT: 8~~ + +~~ROW COUNT: 8~~ + +~~START~~ +varchar#!#varchar#!#varchar#!#varchar#!#varchar#!#varchar +Direct Conversion#!#CAST vs CONVERT#!#Standard positive decimal#!# 123.456#!# 123.456 #!# +Direct Conversion#!#CAST vs CONVERT#!#Negative decimal#!# -123.456#!#-123.456 #!# +Direct Conversion#!#CAST vs CONVERT#!#Zero value#!# 0#!# 0 #!# +Direct Conversion#!#CAST vs CONVERT#!#Scientific notation - large#!# 10000000000#!#1e+10 #!# +Direct Conversion#!#CAST vs CONVERT#!#Scientific notation - small#!# 0#!# 0.000000 #!# +Direct Conversion#!#CAST vs CONVERT#!#Large decimal#!# 9999999999.99#!#1e+10 #!# +Direct Conversion#!#CAST vs CONVERT#!#Very small decimal#!# 0#!# 0.000000 #!# +Direct Conversion#!#CAST vs CONVERT#!#NULL Value#!##!##!# +~~END~~ + +~~START~~ +char#!#char + 123.456#!# 123.456 +~~END~~ + +~~START~~ +char#!#char + -123.456#!#-123.456 +~~END~~ + +~~START~~ +char#!#char + 0#!# 0 +~~END~~ + +~~START~~ +char#!#char + 10000000000#!#1e+10 +~~END~~ + +~~START~~ +char#!#char + 0#!# 0.000000 +~~END~~ + +~~START~~ +char#!#char + 9999999999.99#!#1e+10 +~~END~~ + +~~START~~ +char#!#char + 0#!# 0.000000 +~~END~~ + +~~START~~ +char#!#char +#!# +~~END~~ + + +-- 2. Test Views +SELECT * FROM float_char_v1; +SELECT * FROM float_char_v2; +GO +~~START~~ +char +-123.456 +~~END~~ + +~~START~~ +char +-123.456 +~~END~~ + + +-- 3. Test Functions +SELECT float_char_f1('123.4567') +SELECT float_char_f2('123.4567') +GO +~~START~~ +varchar + 123.4567 +~~END~~ + +~~START~~ +varchar + 123.457 +~~END~~ + + + + + + + + + +-- TEST FOR VARCHAR +DECLARE @TestCases TABLE ( + FloatValue FLOAT, + ScenarioDescription VARCHAR(200) +); +INSERT INTO @TestCases +SELECT FloatValue, Description FROM float_varchar_t1; +-- 1. Test Direct CAST/CONVERT +INSERT INTO TestResults_1 (TestCategory, TestName, TestScenario, ExpectedResult, ActualResult) +SELECT + 'Direct Conversion', + 'CAST vs CONVERT', + tc.ScenarioDescription, + CAST(tc.FloatValue AS VARCHAR(30)), + CONVERT(VARCHAR(30), tc.FloatValue) +FROM @TestCases tc; +-- Display Results by Category +SELECT + TestCategory, + TestName, + TestScenario, + ExpectedResult, + ActualResult, + TestStatus +FROM TestResults_1 +ORDER BY TestCategory, TestID; +-- Test Stored Procedure Execution +DECLARE @FloatValue FLOAT; +DECLARE cur CURSOR FOR SELECT FloatValue FROM @TestCases; +OPEN cur; +FETCH NEXT FROM cur INTO @FloatValue; +WHILE @@FETCH_STATUS = 0 +BEGIN + EXEC float_varchar_p1 @FloatValue; + FETCH NEXT FROM cur INTO @FloatValue; +END +CLOSE cur; +DEALLOCATE cur; +GO +~~ROW COUNT: 8~~ + +~~ROW COUNT: 8~~ + +~~START~~ +varchar#!#varchar#!#varchar#!#varchar#!#varchar#!#varchar +Direct Conversion#!#CAST vs CONVERT#!#Standard positive decimal#!#123.456#!# 123.456 #!# +Direct Conversion#!#CAST vs CONVERT#!#Negative decimal#!#-123.456#!#-123.456 #!# +Direct Conversion#!#CAST vs CONVERT#!#Zero value#!#0#!# 0 #!# +Direct Conversion#!#CAST vs CONVERT#!#Scientific notation - large#!#10000000000#!#1e+10 #!# +Direct Conversion#!#CAST vs CONVERT#!#Scientific notation - small#!#0#!# 0.000000 #!# +Direct Conversion#!#CAST vs CONVERT#!#Large decimal#!#9999999999.99#!#1e+10 #!# +Direct Conversion#!#CAST vs CONVERT#!#Very small decimal#!#0#!# 0.000000 #!# +Direct Conversion#!#CAST vs CONVERT#!#NULL Value#!##!##!# +~~END~~ + +~~START~~ +varchar#!#varchar +123.456#!# 123.456 +~~END~~ + +~~START~~ +varchar#!#varchar +-123.456#!#-123.456 +~~END~~ + +~~START~~ +varchar#!#varchar +0#!# 0 +~~END~~ + +~~START~~ +varchar#!#varchar +10000000000#!#1e+10 +~~END~~ + +~~START~~ +varchar#!#varchar +0#!# 0.000000 +~~END~~ + +~~START~~ +varchar#!#varchar +9999999999.99#!#1e+10 +~~END~~ + +~~START~~ +varchar#!#varchar +0#!# 0.000000 +~~END~~ + +~~START~~ +varchar#!#varchar +#!# +~~END~~ + + + +-- 2. Test Views +SELECT * FROM float_varchar_v1; +SELECT * FROM float_varchar_v2; +GO +~~START~~ +varchar +-123.456 +~~END~~ + +~~START~~ +char +-123.456 +~~END~~ + + +-- 3. Test Functions +SELECT float_varchar_f1('123.4567') +SELECT float_varchar_f2('123.4567') +GO +~~START~~ +varchar +123.4567 +~~END~~ + +~~START~~ +varchar + 123.457 +~~END~~ + diff --git a/test/JDBC/input/functions/test_conv_float_to_varchar_char_before_17_3-vu-cleanup.sql b/test/JDBC/input/functions/test_conv_float_to_varchar_char_before_17_3-vu-cleanup.sql new file mode 100644 index 00000000000..28b9531e9b4 --- /dev/null +++ b/test/JDBC/input/functions/test_conv_float_to_varchar_char_before_17_3-vu-cleanup.sql @@ -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 \ No newline at end of file diff --git a/test/JDBC/input/functions/test_conv_float_to_varchar_char_before_17_3-vu-prepare.sql b/test/JDBC/input/functions/test_conv_float_to_varchar_char_before_17_3-vu-prepare.sql new file mode 100644 index 00000000000..2dfb56d3b39 --- /dev/null +++ b/test/JDBC/input/functions/test_conv_float_to_varchar_char_before_17_3-vu-prepare.sql @@ -0,0 +1,158 @@ +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 + + +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 + + +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 diff --git a/test/JDBC/input/functions/test_conv_float_to_varchar_char_before_17_3-vu-verify.sql b/test/JDBC/input/functions/test_conv_float_to_varchar_char_before_17_3-vu-verify.sql new file mode 100644 index 00000000000..d389790dcc6 --- /dev/null +++ b/test/JDBC/input/functions/test_conv_float_to_varchar_char_before_17_3-vu-verify.sql @@ -0,0 +1,113 @@ +-- TEST FOR CHAR +DECLARE @TestCases TABLE ( + FloatValue FLOAT, + ScenarioDescription VARCHAR(200) +); + +INSERT INTO @TestCases +SELECT FloatValue, Description FROM float_char_t1; + +-- 1. Test Direct CAST/CONVERT +INSERT INTO TestResults (TestCategory, TestName, TestScenario, ExpectedResult, ActualResult) +SELECT + 'Direct Conversion', + 'CAST vs CONVERT', + tc.ScenarioDescription, + CAST(tc.FloatValue AS CHAR(30)), + CONVERT(CHAR(30), tc.FloatValue) +FROM @TestCases tc; + +-- Display Results by Category +SELECT + TestCategory, + TestName, + TestScenario, + ExpectedResult, + ActualResult, + TestStatus +FROM TestResults +ORDER BY TestCategory, TestID; + +-- Test Stored Procedure Execution +DECLARE @FloatValue FLOAT; +DECLARE cur CURSOR FOR SELECT FloatValue FROM @TestCases; +OPEN cur; + +FETCH NEXT FROM cur INTO @FloatValue; +WHILE @@FETCH_STATUS = 0 +BEGIN + EXEC float_char_p1 @FloatValue; + FETCH NEXT FROM cur INTO @FloatValue; +END + +CLOSE cur; +DEALLOCATE cur; +GO + +-- 2. Test Views +SELECT * FROM float_char_v1; +SELECT * FROM float_char_v2; +GO + +-- 3. Test Functions +SELECT float_char_f1('123.4567') +SELECT float_char_f2('123.4567') +GO + +-- TEST FOR VARCHAR + +DECLARE @TestCases TABLE ( + FloatValue FLOAT, + ScenarioDescription VARCHAR(200) +); + +INSERT INTO @TestCases +SELECT FloatValue, Description FROM float_varchar_t1; + +-- 1. Test Direct CAST/CONVERT +INSERT INTO TestResults_1 (TestCategory, TestName, TestScenario, ExpectedResult, ActualResult) +SELECT + 'Direct Conversion', + 'CAST vs CONVERT', + tc.ScenarioDescription, + CAST(tc.FloatValue AS VARCHAR(30)), + CONVERT(VARCHAR(30), tc.FloatValue) +FROM @TestCases tc; + +-- Display Results by Category +SELECT + TestCategory, + TestName, + TestScenario, + ExpectedResult, + ActualResult, + TestStatus +FROM TestResults_1 +ORDER BY TestCategory, TestID; + +-- Test Stored Procedure Execution +DECLARE @FloatValue FLOAT; +DECLARE cur CURSOR FOR SELECT FloatValue FROM @TestCases; +OPEN cur; + +FETCH NEXT FROM cur INTO @FloatValue; +WHILE @@FETCH_STATUS = 0 +BEGIN + EXEC float_varchar_p1 @FloatValue; + FETCH NEXT FROM cur INTO @FloatValue; +END + +CLOSE cur; +DEALLOCATE cur; +GO + + +-- 2. Test Views +SELECT * FROM float_varchar_v1; +SELECT * FROM float_varchar_v2; +GO + +-- 3. Test Functions +SELECT float_varchar_f1('123.4567') +SELECT float_varchar_f2('123.4567') +GO \ No newline at end of file diff --git a/test/JDBC/upgrade/13_4/schedule b/test/JDBC/upgrade/13_4/schedule index 99185941403..317b2ec23f0 100644 --- a/test/JDBC/upgrade/13_4/schedule +++ b/test/JDBC/upgrade/13_4/schedule @@ -261,4 +261,4 @@ test_conv_string_to_time-before-13_6 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/13_5/schedule b/test/JDBC/upgrade/13_5/schedule index fcf95032065..2c81336eed4 100644 --- a/test/JDBC/upgrade/13_5/schedule +++ b/test/JDBC/upgrade/13_5/schedule @@ -314,4 +314,4 @@ test_conv_string_to_time-before-13_6 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/13_6/schedule b/test/JDBC/upgrade/13_6/schedule index 1f376efa87a..d6c4b612328 100644 --- a/test/JDBC/upgrade/13_6/schedule +++ b/test/JDBC/upgrade/13_6/schedule @@ -371,4 +371,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/13_7/schedule b/test/JDBC/upgrade/13_7/schedule index 2257d71e41d..88bd994bd68 100644 --- a/test/JDBC/upgrade/13_7/schedule +++ b/test/JDBC/upgrade/13_7/schedule @@ -364,4 +364,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/13_8/schedule b/test/JDBC/upgrade/13_8/schedule index 2257d71e41d..88bd994bd68 100644 --- a/test/JDBC/upgrade/13_8/schedule +++ b/test/JDBC/upgrade/13_8/schedule @@ -364,4 +364,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/13_9/schedule b/test/JDBC/upgrade/13_9/schedule index d36245514f1..79b145074e4 100644 --- a/test/JDBC/upgrade/13_9/schedule +++ b/test/JDBC/upgrade/13_9/schedule @@ -369,4 +369,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/14_10/schedule b/test/JDBC/upgrade/14_10/schedule index f6375f00d6e..bea9386eae8 100644 --- a/test/JDBC/upgrade/14_10/schedule +++ b/test/JDBC/upgrade/14_10/schedule @@ -482,4 +482,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/14_11/schedule b/test/JDBC/upgrade/14_11/schedule index ec9ebb1ec43..f192776b45e 100644 --- a/test/JDBC/upgrade/14_11/schedule +++ b/test/JDBC/upgrade/14_11/schedule @@ -480,4 +480,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/14_12/schedule b/test/JDBC/upgrade/14_12/schedule index f7970bb01e6..b6f4ebff343 100644 --- a/test/JDBC/upgrade/14_12/schedule +++ b/test/JDBC/upgrade/14_12/schedule @@ -481,4 +481,4 @@ smalldatetime_date_cmp-before-15_5-16_1 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/14_13/schedule b/test/JDBC/upgrade/14_13/schedule index 8db78ce6706..51acd8e8ddc 100644 --- a/test/JDBC/upgrade/14_13/schedule +++ b/test/JDBC/upgrade/14_13/schedule @@ -481,4 +481,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/14_15/schedule b/test/JDBC/upgrade/14_15/schedule index e63e03b8c3d..f71cce5a7ab 100644 --- a/test/JDBC/upgrade/14_15/schedule +++ b/test/JDBC/upgrade/14_15/schedule @@ -477,4 +477,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/14_16/schedule b/test/JDBC/upgrade/14_16/schedule index 3ce83914930..2e1b9b23c2d 100644 --- a/test/JDBC/upgrade/14_16/schedule +++ b/test/JDBC/upgrade/14_16/schedule @@ -477,4 +477,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/14_3/schedule b/test/JDBC/upgrade/14_3/schedule index 865b72055f9..95c7c73378f 100644 --- a/test/JDBC/upgrade/14_3/schedule +++ b/test/JDBC/upgrade/14_3/schedule @@ -400,4 +400,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/14_5/schedule b/test/JDBC/upgrade/14_5/schedule index dae14bf1ec8..4d0a030f6a8 100644 --- a/test/JDBC/upgrade/14_5/schedule +++ b/test/JDBC/upgrade/14_5/schedule @@ -412,4 +412,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/14_6/schedule b/test/JDBC/upgrade/14_6/schedule index 77922a19505..668b3bc5c64 100644 --- a/test/JDBC/upgrade/14_6/schedule +++ b/test/JDBC/upgrade/14_6/schedule @@ -450,4 +450,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/14_7/schedule b/test/JDBC/upgrade/14_7/schedule index 63d9ed53fe8..76f305ecf95 100644 --- a/test/JDBC/upgrade/14_7/schedule +++ b/test/JDBC/upgrade/14_7/schedule @@ -472,4 +472,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/14_8/schedule b/test/JDBC/upgrade/14_8/schedule index 3db4beba024..8492e55a28e 100644 --- a/test/JDBC/upgrade/14_8/schedule +++ b/test/JDBC/upgrade/14_8/schedule @@ -474,4 +474,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/14_9/schedule b/test/JDBC/upgrade/14_9/schedule index 1aa0ec3b04b..e89b52c6d22 100644 --- a/test/JDBC/upgrade/14_9/schedule +++ b/test/JDBC/upgrade/14_9/schedule @@ -477,4 +477,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/15_1/schedule b/test/JDBC/upgrade/15_1/schedule index 807928ee343..7331c96a1f4 100644 --- a/test/JDBC/upgrade/15_1/schedule +++ b/test/JDBC/upgrade/15_1/schedule @@ -450,4 +450,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/15_10/schedule b/test/JDBC/upgrade/15_10/schedule index 17d00b9da78..f7520e90a6a 100644 --- a/test/JDBC/upgrade/15_10/schedule +++ b/test/JDBC/upgrade/15_10/schedule @@ -567,4 +567,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/15_11/schedule b/test/JDBC/upgrade/15_11/schedule index 29456dc0218..cc0c19c0765 100644 --- a/test/JDBC/upgrade/15_11/schedule +++ b/test/JDBC/upgrade/15_11/schedule @@ -567,4 +567,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/15_2/schedule b/test/JDBC/upgrade/15_2/schedule index deef7cbe1db..8ab7270c030 100644 --- a/test/JDBC/upgrade/15_2/schedule +++ b/test/JDBC/upgrade/15_2/schedule @@ -486,4 +486,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/15_3/schedule b/test/JDBC/upgrade/15_3/schedule index 6129c877055..0328c1cbe80 100644 --- a/test/JDBC/upgrade/15_3/schedule +++ b/test/JDBC/upgrade/15_3/schedule @@ -506,4 +506,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/15_4/schedule b/test/JDBC/upgrade/15_4/schedule index 1610e837cc6..fd42af9476a 100644 --- a/test/JDBC/upgrade/15_4/schedule +++ b/test/JDBC/upgrade/15_4/schedule @@ -519,4 +519,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/15_5/schedule b/test/JDBC/upgrade/15_5/schedule index caa836902a1..da6bdb1e22b 100644 --- a/test/JDBC/upgrade/15_5/schedule +++ b/test/JDBC/upgrade/15_5/schedule @@ -552,4 +552,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char \ No newline at end of file +test_conv_float_to_varchar_char_before_17_3 \ No newline at end of file diff --git a/test/JDBC/upgrade/15_6/schedule b/test/JDBC/upgrade/15_6/schedule index 24d3305149d..a4d1e9a0643 100644 --- a/test/JDBC/upgrade/15_6/schedule +++ b/test/JDBC/upgrade/15_6/schedule @@ -568,4 +568,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/15_7/schedule b/test/JDBC/upgrade/15_7/schedule index 1ea680e4d40..519e6af87ef 100644 --- a/test/JDBC/upgrade/15_7/schedule +++ b/test/JDBC/upgrade/15_7/schedule @@ -576,4 +576,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/15_8/schedule b/test/JDBC/upgrade/15_8/schedule index 444e56a81fd..408c3074d2b 100644 --- a/test/JDBC/upgrade/15_8/schedule +++ b/test/JDBC/upgrade/15_8/schedule @@ -567,4 +567,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/16_1/schedule b/test/JDBC/upgrade/16_1/schedule index 37eec541abf..c3f017e2f3f 100644 --- a/test/JDBC/upgrade/16_1/schedule +++ b/test/JDBC/upgrade/16_1/schedule @@ -561,4 +561,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/16_2/schedule b/test/JDBC/upgrade/16_2/schedule index 1611e2449a5..7d530ddf511 100644 --- a/test/JDBC/upgrade/16_2/schedule +++ b/test/JDBC/upgrade/16_2/schedule @@ -577,4 +577,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/16_3/schedule b/test/JDBC/upgrade/16_3/schedule index f8cbe3e5fd5..13ede985671 100644 --- a/test/JDBC/upgrade/16_3/schedule +++ b/test/JDBC/upgrade/16_3/schedule @@ -581,4 +581,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/16_4/schedule b/test/JDBC/upgrade/16_4/schedule index b0541617c80..7ad9c88ecad 100644 --- a/test/JDBC/upgrade/16_4/schedule +++ b/test/JDBC/upgrade/16_4/schedule @@ -594,4 +594,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/16_6/schedule b/test/JDBC/upgrade/16_6/schedule index 869b8d27588..3dd601b8825 100644 --- a/test/JDBC/upgrade/16_6/schedule +++ b/test/JDBC/upgrade/16_6/schedule @@ -597,4 +597,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/16_7/schedule b/test/JDBC/upgrade/16_7/schedule index dea5841160c..b032220bb28 100644 --- a/test/JDBC/upgrade/16_7/schedule +++ b/test/JDBC/upgrade/16_7/schedule @@ -602,4 +602,4 @@ db_owner BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3 diff --git a/test/JDBC/upgrade/17_2/schedule b/test/JDBC/upgrade/17_2/schedule index 9872a243dbe..b943032078d 100644 --- a/test/JDBC/upgrade/17_2/schedule +++ b/test/JDBC/upgrade/17_2/schedule @@ -600,4 +600,4 @@ test_conv_string_to_time-before-17_3 BABEL-5031 test_conv_money_to_varchar fixeddecimal_modulo -test_conv_float_to_varchar_char +test_conv_float_to_varchar_char_before_17_3