Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4464 fix generated default column value using in PostgreSQL and Oracle for char/clob data types #5202

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public void testChangeLogGenerationForTableWithGeneratedColumn() throws Exceptio
String textToTest = "GENERATED ALWAYS AS (QTY * PRICE)";

Scope.getCurrentScope().getSingleton(ExecutorService.class).getExecutor("jdbc", getDatabase()).execute(new RawSqlStatement(
String.format("CREATE TABLE GENERATED_COLUMN_TEST(QTY INT, PRICE INT, TOTALVALUE INT %s);", textToTest)));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there :)
The assertion failed as it is not able to find our sql fragment. The generated SQL below is:

<column defaultValueComputed="GENERATED ALWAYS AS (&quot;QTY&quot;*&quot;PRICE&quot;)" name="TOTALVALUE" type="NUMBER(*, 0)"/>

So in my next commit I'm removing " from virtColumnDef variable... and seems it works. I wonder if this is the best solution @LonwoLonwo @MalloD12 , but at least it is working now :)

String.format("CREATE TABLE GENERATED_COLUMN_TEST(QTY INT, PRICE INT, TOTALVALUE INT %s)", textToTest)));

ByteArrayOutputStream baos = new ByteArrayOutputStream();
new CommandScope(GenerateChangelogCommandStep.COMMAND_NAME)
Expand Down