View Issue Details

IDProjectCategoryView StatusLast Update
0006593SymmetricDSBugpublic2024-11-13 20:31
Reporterelong Assigned Toelong  
Prioritynormal 
Status closedResolutionfixed 
Product Version3.8.0 
Target Version3.15.10Fixed in Version3.15.10 
Summary0006593: DDL change cannot alter column to nullable on H2
DescriptionOn H2, a column whose nullable constraint is "not null" will not change to "null" from a DDL change. It will run an alter for the column, but expects that nullable is the default. H2 expects an explicit "null" option to be added to the alter statement.

This does NOT change the constraint:
ALTER TABLE "NULLTEST" ALTER COLUMN "NUM" INTEGER;

This DOES change constraint:
ALTER TABLE "NULLTEST" ALTER COLUMN "NUM" INTEGER NULL;
Steps To Reproduce- create table nulltest (id integer primary key, num integer not null);
- import a DDL change:
<database xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="dbexport" encoding="UTF-8">
    <table name="nulltest">
        <column name="id" primaryKey="true" primaryKeySeq="1" required="true" type="INTEGER" size="10">
            <platform-column name="mysql" type="INT" size="10"/>
        </column>
        <column name="num" type="INTEGER" size="10" required="false">
            <platform-column name="mysql" type="INT" size="10"/>
        </column>
    </table>
</database>
- It will write SQL of:
ALTER TABLE "NULLTEST" ALTER COLUMN "NUM" INTEGER;
- The nullability won't change, it needs to have "NULL" on the end of the alter
Tagsddl/schema, dialect: h2

Activities

There are no notes attached to this issue.

Related Changesets

SymmetricDS: 3.15 9eb8fb01

2024-10-09 12:49:34

admin

Details Diff
0006593: DDL change cannot alter column to nullable on H2 Affected Issues
0006593
mod - symmetric-db/src/main/java/org/jumpmind/db/platform/DatabaseInfo.java Diff File
mod - symmetric-db/src/main/java/org/jumpmind/db/platform/ase/AseDdlBuilder.java Diff File
mod - symmetric-db/src/main/java/org/jumpmind/db/platform/h2/H2DdlBuilder.java Diff File
mod - symmetric-db/src/main/java/org/jumpmind/db/platform/mysql/MySqlDdlBuilder.java Diff File
mod - symmetric-jdbc/src/test/java/org/jumpmind/db/AbstractDdlTypesTest.java Diff File
mod - symmetric-jdbc/src/test/java/org/jumpmind/db/DatabasePlatformTest.java Diff File
add - symmetric-jdbc/src/test/java/org/jumpmind/db/platform/ase/AseDdlTypesTest.java Diff File
mod - symmetric-jdbc/src/test/java/org/jumpmind/db/platform/h2/H2DdlTypesTest.java Diff File
add - symmetric-jdbc/src/test/java/org/jumpmind/db/platform/mysql/MySqlDdlTypesTest.java Diff File
mod - symmetric-jdbc/src/test/java/org/jumpmind/db/platform/postgresql/PostgreSqlDdlTypesTest.java Diff File

Issue History

Date Modified Username Field Change
2024-09-19 19:13 elong New Issue
2024-09-19 19:13 elong Status new => assigned
2024-09-19 19:13 elong Assigned To => elong
2024-09-19 19:13 elong Tag Attached: ddl/schema
2024-09-19 19:13 elong Tag Attached: dialect: h2
2024-10-01 18:37 admin Target Version 3.15.9 => 3.15.10
2024-10-09 12:54 elong Status assigned => resolved
2024-10-09 12:54 elong Resolution open => fixed
2024-10-09 12:54 elong Fixed in Version => 3.15.10
2024-10-09 13:00 admin Changeset attached => SymmetricDS 3.15 9eb8fb01
2024-11-13 20:31 pbelov Status resolved => closed