Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.0
-
None
-
None
-
Windows XP
Description
If you add a column to an existing primary key, database updates fails with NullPointerException:
java.lang.NullPointerException
at org.apache.ddlutils.alteration.AddPrimaryKeyChange.apply(AddPrimaryKeyChange.java)
at org.apache.ddlutils.platform.SqlBuilder.processChange(SqlBuilder.java)
at org.apache.ddlutils.platform.mssql.MSSqlBuilder.processTableStructureChanges(MSSqlBuilder.java)
at org.apache.ddlutils.platform.SqlBuilder.processTableStructureChanges(SqlBuilder.java)
at org.apache.ddlutils.platform.SqlBuilder.processTableStructureChanges(SqlBuilder.java)
at org.apache.ddlutils.platform.SqlBuilder.processChanges(SqlBuilder.java)
at org.apache.ddlutils.platform.mssql.MSSqlBuilder.processChanges(MSSqlBuilder.java)
at org.apache.ddlutils.platform.SqlBuilder.alterDatabase(SqlBuilder.java)
Orignial table definition:
<table name="DISPLAYNAMES">
<column name="CLASSNAME" primaryKey="true" required="true" type="VARCHAR" size="200"
autoIncrement="false"/>
<column name="FIRMWAREID" primaryKey="true" required="true" type="INTEGER" size="10"
autoIncrement="false"/>
<column name="LANGUAGE" primaryKey="true" required="true" type="CHAR" size="5"
autoIncrement="false"/>
<column name="DISPLAYNAME" primaryKey="false" required="true" type="VARCHAR" size="200"
autoIncrement="false"/>
</table>
New table definition with additional primary key column INSTANCENR:
<table name="DISPLAYNAMES">
<column name="CLASSNAME" primaryKey="true" required="true" type="VARCHAR" size="200"
autoIncrement="false"/>
<column name="FIRMWAREID" primaryKey="true" required="true" type="INTEGER" size="10"
autoIncrement="false"/>
<column name="LANGUAGE" primaryKey="true" required="true" type="CHAR" size="5"
autoIncrement="false"/>
<column name="INSTANCENR" primaryKey="true" required="true" type="INTEGER" size="10"
autoIncrement="false" default="-1"/>
<column name="DISPLAYNAME" primaryKey="false" required="true" type="VARCHAR" size="1000"
autoIncrement="false"/>
</table>
It's a problem similar to bug DDLUTILS-159 (already resolved for Oracle, SAP DB and MySQL)
Attachments
Issue Links
- relates to
-
DDLUTILS-159 primary key column change causes exception
- Resolved