Skip to content

Commit 31cbe64

Browse files
author
anju15bharti
committed
Fix failures and Add testcases
1 parent 5380950 commit 31cbe64

8 files changed

Lines changed: 462 additions & 7 deletions

File tree

test/JDBC/expected/BABEL-login-db-long-identifiers-vu-verify.out

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,8 @@ long_bracket_login_test_user_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxy
255255
-- terminate-tsql-conn user=long_bracket_login_test_user_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstu password=1234 database=long_bracket_database_test_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw
256256

257257
-- tsql
258+
use master
259+
GO
258260
DROP DATABASE [long_bracket_database_test_abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw];
259261
GO
260262

test/JDBC/expected/TestErrorsWithLongIdentifiers.out

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -565,13 +565,9 @@ GO
565565
~~ERROR (Message: The identifier that starts with 'babel6434_ううううううううううううううううううううううううううううううううううううううう' is too long. Maximum length is 128.)~~
566566

567567

568-
-- Temp table with multibyte name (116 chars - should pass, to be fixed with BABEL-6433 )
568+
-- Temp table with multibyte name (116 chars - should pass)
569569
CREATE TABLE #babel6434_さささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささ (a int);
570570
GO
571-
~~ERROR (Code: 33557097)~~
572-
573-
~~ERROR (Message: relation "#babel6434_さささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささ" does not exist)~~
574-
575571
DROP TABLE IF EXISTS #babel6434_さささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささささ;
576572
GO
577573

test/JDBC/expected/db_collation/temp_table_long_name_enr.out

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,3 +817,126 @@ text
817817

818818
DROP TABLE #select_into_long_temp_table_name_exceeding_namedatalen_limit_xx
819819
GO
820+
821+
-- =============================================================================
822+
-- Test 32: Cached plan - long index name on temp table via stored procedure
823+
-- Verifies that the full original name is stored correctly across executions
824+
-- =============================================================================
825+
CREATE PROCEDURE sp_long_idx_cached_plan AS
826+
BEGIN
827+
CREATE TABLE #cached_plan_tmp (a INT, b INT)
828+
CREATE INDEX #very_long_index_name_cached_plan_test_exceeding_namedatalen_lim ON #cached_plan_tmp(a)
829+
SELECT relname FROM babelfish_get_enr_list() WHERE relname LIKE '#very_long_index_name_cached%'
830+
DROP TABLE #cached_plan_tmp
831+
END
832+
GO
833+
834+
-- First execution
835+
EXEC sp_long_idx_cached_plan
836+
GO
837+
~~START~~
838+
text
839+
#very_long_index_name_cached_plan_test_exceeding_namedatalen_lim
840+
~~END~~
841+
842+
843+
-- Second execution (cached plan)
844+
EXEC sp_long_idx_cached_plan
845+
GO
846+
~~START~~
847+
text
848+
#very_long_index_name_cached_plan_test_exceeding_namedatalen_lim
849+
~~END~~
850+
851+
852+
-- Third execution (definitely cached plan)
853+
EXEC sp_long_idx_cached_plan
854+
GO
855+
~~START~~
856+
text
857+
#very_long_index_name_cached_plan_test_exceeding_namedatalen_lim
858+
~~END~~
859+
860+
861+
DROP PROCEDURE sp_long_idx_cached_plan
862+
GO
863+
864+
-- =============================================================================
865+
-- Test 33: sp_prepare/sp_execute - guarantees cached plan reuse for long index
866+
-- =============================================================================
867+
DECLARE @handle INT
868+
EXEC sp_prepare @handle OUTPUT, NULL, N'CREATE TABLE #sp_prep_tmp (a INT); CREATE INDEX #very_long_index_name_sp_prepare_test_exceeding_namedatalen_limit ON #sp_prep_tmp(a); SELECT relname FROM babelfish_get_enr_list() WHERE relname LIKE ''#very_long_index_name_sp_prepare%''; DROP TABLE #sp_prep_tmp'
869+
EXEC sp_execute @handle
870+
EXEC sp_execute @handle
871+
EXEC sp_unprepare @handle
872+
GO
873+
~~START~~
874+
text
875+
#very_long_index_name_sp_prepare_test_exceeding_namedatalen_limit
876+
~~END~~
877+
878+
~~START~~
879+
text
880+
#very_long_index_name_sp_prepare_test_exceeding_namedatalen_limit
881+
~~END~~
882+
883+
884+
-- =============================================================================
885+
-- Test 34: Same long index name on different long-name temp tables
886+
-- =============================================================================
887+
CREATE TABLE #diff_tbl_one_with_very_long_name_exceeding_namedatalen_limit_xxxxx (a INT, b INT)
888+
GO
889+
890+
CREATE TABLE #diff_tbl_two_with_very_long_name_exceeding_namedatalen_limit_xxxxx (x INT, y INT)
891+
GO
892+
893+
CREATE INDEX #same_long_index_name_on_different_temp_tables_exceeding_limit_x ON #diff_tbl_one_with_very_long_name_exceeding_namedatalen_limit_xxxxx(a)
894+
GO
895+
896+
CREATE INDEX #same_long_index_name_on_different_temp_tables_exceeding_limit_x ON #diff_tbl_two_with_very_long_name_exceeding_namedatalen_limit_xxxxx(x)
897+
GO
898+
899+
SELECT relname FROM babelfish_get_enr_list() WHERE relname LIKE '#same_long_index%' ORDER BY relname
900+
GO
901+
~~START~~
902+
text
903+
#same_long_index_name_on_different_temp_tables_exceeding_limit_x
904+
#same_long_index_name_on_different_temp_tables_exceeding_limit_x
905+
~~END~~
906+
907+
908+
DROP TABLE #diff_tbl_one_with_very_long_name_exceeding_namedatalen_limit_xxxxx
909+
GO
910+
911+
DROP TABLE #diff_tbl_two_with_very_long_name_exceeding_namedatalen_limit_xxxxx
912+
GO
913+
914+
-- =============================================================================
915+
-- Test 35: Same short index name on different long-name temp tables
916+
-- =============================================================================
917+
CREATE TABLE #short_idx_tbl_one_with_very_long_name_exceeding_namedatalen_limit (a INT)
918+
GO
919+
920+
CREATE TABLE #short_idx_tbl_two_with_very_long_name_exceeding_namedatalen_limit (x INT)
921+
GO
922+
923+
CREATE INDEX idx_short ON #short_idx_tbl_one_with_very_long_name_exceeding_namedatalen_limit(a)
924+
GO
925+
926+
CREATE INDEX idx_short ON #short_idx_tbl_two_with_very_long_name_exceeding_namedatalen_limit(x)
927+
GO
928+
929+
SELECT relname FROM babelfish_get_enr_list() WHERE relname LIKE '#short_idx_tbl%' ORDER BY relname
930+
GO
931+
~~START~~
932+
text
933+
#short_idx_tbl_one_with_very_long_name_exceeding_namedatalen_limit
934+
#short_idx_tbl_two_with_very_long_name_exceeding_namedatalen_limit
935+
~~END~~
936+
937+
938+
DROP TABLE #short_idx_tbl_one_with_very_long_name_exceeding_namedatalen_limit
939+
GO
940+
941+
DROP TABLE #short_idx_tbl_two_with_very_long_name_exceeding_namedatalen_limit
942+
GO

test/JDBC/expected/non_default_server_collation/chinese_prc_ci_as/temp_table_long_name_enr.out

Lines changed: 124 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ SELECT relname FROM babelfish_get_enr_list() WHERE relname LIKE 'インデック
738738
GO
739739
~~START~~
740740
text
741-
??????????????????????????NAMEDATALEN??????
741+
インデックス名前が非常に長いテスト用のインデックスでNAMEDATALEN制限を超える
742742
~~END~~
743743

744744

@@ -817,3 +817,126 @@ text
817817

818818
DROP TABLE #select_into_long_temp_table_name_exceeding_namedatalen_limit_xx
819819
GO
820+
821+
-- =============================================================================
822+
-- Test 32: Cached plan - long index name on temp table via stored procedure
823+
-- Verifies that the full original name is stored correctly across executions
824+
-- =============================================================================
825+
CREATE PROCEDURE sp_long_idx_cached_plan AS
826+
BEGIN
827+
CREATE TABLE #cached_plan_tmp (a INT, b INT)
828+
CREATE INDEX #very_long_index_name_cached_plan_test_exceeding_namedatalen_lim ON #cached_plan_tmp(a)
829+
SELECT relname FROM babelfish_get_enr_list() WHERE relname LIKE '#very_long_index_name_cached%'
830+
DROP TABLE #cached_plan_tmp
831+
END
832+
GO
833+
834+
-- First execution
835+
EXEC sp_long_idx_cached_plan
836+
GO
837+
~~START~~
838+
text
839+
#very_long_index_name_cached_plan_test_exceeding_namedatalen_lim
840+
~~END~~
841+
842+
843+
-- Second execution (cached plan)
844+
EXEC sp_long_idx_cached_plan
845+
GO
846+
~~START~~
847+
text
848+
#very_long_index_name_cached_plan_test_exceeding_namedatalen_lim
849+
~~END~~
850+
851+
852+
-- Third execution (definitely cached plan)
853+
EXEC sp_long_idx_cached_plan
854+
GO
855+
~~START~~
856+
text
857+
#very_long_index_name_cached_plan_test_exceeding_namedatalen_lim
858+
~~END~~
859+
860+
861+
DROP PROCEDURE sp_long_idx_cached_plan
862+
GO
863+
864+
-- =============================================================================
865+
-- Test 33: sp_prepare/sp_execute - guarantees cached plan reuse for long index
866+
-- =============================================================================
867+
DECLARE @handle INT
868+
EXEC sp_prepare @handle OUTPUT, NULL, N'CREATE TABLE #sp_prep_tmp (a INT); CREATE INDEX #very_long_index_name_sp_prepare_test_exceeding_namedatalen_limit ON #sp_prep_tmp(a); SELECT relname FROM babelfish_get_enr_list() WHERE relname LIKE ''#very_long_index_name_sp_prepare%''; DROP TABLE #sp_prep_tmp'
869+
EXEC sp_execute @handle
870+
EXEC sp_execute @handle
871+
EXEC sp_unprepare @handle
872+
GO
873+
~~START~~
874+
text
875+
#very_long_index_name_sp_prepare_test_exceeding_namedatalen_limit
876+
~~END~~
877+
878+
~~START~~
879+
text
880+
#very_long_index_name_sp_prepare_test_exceeding_namedatalen_limit
881+
~~END~~
882+
883+
884+
-- =============================================================================
885+
-- Test 34: Same long index name on different long-name temp tables
886+
-- =============================================================================
887+
CREATE TABLE #diff_tbl_one_with_very_long_name_exceeding_namedatalen_limit_xxxxx (a INT, b INT)
888+
GO
889+
890+
CREATE TABLE #diff_tbl_two_with_very_long_name_exceeding_namedatalen_limit_xxxxx (x INT, y INT)
891+
GO
892+
893+
CREATE INDEX #same_long_index_name_on_different_temp_tables_exceeding_limit_x ON #diff_tbl_one_with_very_long_name_exceeding_namedatalen_limit_xxxxx(a)
894+
GO
895+
896+
CREATE INDEX #same_long_index_name_on_different_temp_tables_exceeding_limit_x ON #diff_tbl_two_with_very_long_name_exceeding_namedatalen_limit_xxxxx(x)
897+
GO
898+
899+
SELECT relname FROM babelfish_get_enr_list() WHERE relname LIKE '#same_long_index%' ORDER BY relname
900+
GO
901+
~~START~~
902+
text
903+
#same_long_index_name_on_different_temp_tables_exceeding_limit_x
904+
#same_long_index_name_on_different_temp_tables_exceeding_limit_x
905+
~~END~~
906+
907+
908+
DROP TABLE #diff_tbl_one_with_very_long_name_exceeding_namedatalen_limit_xxxxx
909+
GO
910+
911+
DROP TABLE #diff_tbl_two_with_very_long_name_exceeding_namedatalen_limit_xxxxx
912+
GO
913+
914+
-- =============================================================================
915+
-- Test 35: Same short index name on different long-name temp tables
916+
-- =============================================================================
917+
CREATE TABLE #short_idx_tbl_one_with_very_long_name_exceeding_namedatalen_limit (a INT)
918+
GO
919+
920+
CREATE TABLE #short_idx_tbl_two_with_very_long_name_exceeding_namedatalen_limit (x INT)
921+
GO
922+
923+
CREATE INDEX idx_short ON #short_idx_tbl_one_with_very_long_name_exceeding_namedatalen_limit(a)
924+
GO
925+
926+
CREATE INDEX idx_short ON #short_idx_tbl_two_with_very_long_name_exceeding_namedatalen_limit(x)
927+
GO
928+
929+
SELECT relname FROM babelfish_get_enr_list() WHERE relname LIKE '#short_idx_tbl%' ORDER BY relname
930+
GO
931+
~~START~~
932+
text
933+
#short_idx_tbl_one_with_very_long_name_exceeding_namedatalen_limit
934+
#short_idx_tbl_two_with_very_long_name_exceeding_namedatalen_limit
935+
~~END~~
936+
937+
938+
DROP TABLE #short_idx_tbl_one_with_very_long_name_exceeding_namedatalen_limit
939+
GO
940+
941+
DROP TABLE #short_idx_tbl_two_with_very_long_name_exceeding_namedatalen_limit
942+
GO

0 commit comments

Comments
 (0)