Skip to content

Commit

Permalink
LPD-20641 Add test coverage for CAST_CLOB_TEXT.
Browse files Browse the repository at this point in the history
  • Loading branch information
marianoalvarosaiz authored and brianchandotcom committed Mar 28, 2024
1 parent b471486 commit ac93f76
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,13 @@ protected String getBooleanTransformedSQL() {
}

protected String getCastClobTextOriginalSQL() {
return "select CAST_CLOB_TEXT(foo) from Foo";
return "select CAST_CLOB_TEXT(foo || (CAST_CLOB_TEXT(foo) || (bar || " +
"foo))), CAST_CLOB_TEXT(foo || (bar || foo)) from Foo";
}

protected String getCastClobTextTransformedSQL() {
return "select foo from Foo";
return "select foo || (foo || (bar || foo)), foo || (bar || foo) " +
"from Foo";
}

protected String getCastLongOriginalSQL() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ protected String getBooleanTransformedSQL() {

@Override
protected String getCastClobTextTransformedSQL() {
return "select CAST(foo AS VARCHAR(2000)) from Foo";
return StringBundler.concat(
"select CAST(foo || (CAST(foo AS VARCHAR(2000)) || (bar || foo)) ",
"AS VARCHAR(2000)), CAST(foo || (bar || foo) AS VARCHAR(2000)) ",
"from Foo");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ public void testReplaceModWithExtraWhitespace() {

@Override
protected String getCastClobTextTransformedSQL() {
return "select CONVERT(foo, SQL_VARCHAR) from Foo";
return StringBundler.concat(
"select CONVERT(foo || (CONVERT(foo, SQL_VARCHAR) || (bar || ",
"foo)), SQL_VARCHAR), CONVERT(foo || (bar || foo), SQL_VARCHAR) ",
"from Foo");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ protected String getBooleanTransformedSQL() {

@Override
protected String getCastClobTextTransformedSQL() {
return "select DBMS_LOB.SUBSTR(foo, 4000, 1) from Foo";
return StringBundler.concat(
"select DBMS_LOB.SUBSTR(foo || (DBMS_LOB.SUBSTR(foo, 4000, 1) || ",
"(bar || foo)), 4000, 1), DBMS_LOB.SUBSTR(foo || (bar || foo), ",
"4000, 1) from Foo");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ protected String getBitwiseCheckTransformedSQL() {

@Override
protected String getCastClobTextTransformedSQL() {
return "select CAST(foo AS TEXT) from Foo";
return "select CAST(foo || (CAST(foo AS TEXT) || (bar || foo)) AS " +
"TEXT), CAST(foo || (bar || foo) AS TEXT) from Foo";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ protected String getBooleanTransformedSQL() {

@Override
protected String getCastClobTextTransformedSQL() {
return "select CAST(foo AS NVARCHAR(MAX)) from Foo";
return StringBundler.concat(
"select CAST(foo || (CAST(foo AS NVARCHAR(MAX)) || (bar || foo)) ",
"AS NVARCHAR(MAX)), CAST(foo || (bar || foo) AS NVARCHAR(MAX)) ",
"from Foo");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ protected String getBooleanTransformedSQL() {

@Override
protected String getCastClobTextTransformedSQL() {
return "select CAST(foo AS NVARCHAR(5461)) from Foo";
return StringBundler.concat(
"select CAST(foo || (CAST(foo AS NVARCHAR(5461)) || (bar || foo)) ",
"AS NVARCHAR(5461)), CAST(foo || (bar || foo) AS NVARCHAR(5461)) ",
"from Foo");
}

@Override
Expand Down

0 comments on commit ac93f76

Please sign in to comment.