babelfish_extensions icon indicating copy to clipboard operation
babelfish_extensions copied to clipboard

Wrong column type in sys.sql_modules

Open shalinilohia50 opened this issue 1 year ago • 1 comments

Description

Currently, definition column in the view sys.sql_modules stores upto 4000 characters. SSMS scripting uses sys.sql_modules view to show the definition of the procedure, and the procedure definition is truncated to 4000 characters if the actual procedure definition is more than 4K.

To avoid this incorrect definition, We can directly use sys.nvarchar and there is no need to specify the tymod of 4000 in case of sys.nvarchar for the definition column i.e., sys.nvarchar(4000).

Fixed the definition column for the views which should use nvarchar(max): sql_modules, system_sql_modules, all_sql_modules.

Issues Resolved

Task: BABEL-4870 Signed-off-by: Shalini Lohia [email protected]

Test Scenarios Covered

  • Use case based - Added test in DDL test framework. Also, testing using SSMS.

  • Boundary conditions -

  • Arbitrary inputs -

  • Negative test cases -

  • Minor version upgrade tests -

  • Major version upgrade tests -

  • Performance tests -

  • Tooling impact -

  • Client tests -

shalinilohia50 avatar May 16 '24 17:05 shalinilohia50

Pull Request Test Coverage Report for Build 9202292116

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 263 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.005%) to 73.179%

Files with Coverage Reduction New Missed Lines %
contrib/babelfishpg_tsql/src/hooks.c 7 83.51%
contrib/babelfishpg_tsql/src/catalog.c 110 86.63%
contrib/babelfishpg_tsql/src/pl_handler.c 146 91.48%
<!-- Total: 263
Totals Coverage Status
Change from base Build 9172587441: 0.005%
Covered Lines: 41706
Relevant Lines: 56992

💛 - Coveralls

coveralls avatar May 19 '24 06:05 coveralls

Have we tested object explorer with these changes?

Yes, I have tested with SSMS

shalinilohia50 avatar May 21 '24 04:05 shalinilohia50