[ 
https://issues.apache.org/jira/browse/DERBY-4160?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Knut Anders Hatlen updated DERBY-4160:
--------------------------------------

    Issue & fix info:   (was: Patch Available)
       Fix Version/s: 10.11.0.0

I think it is OK to backport this fix back to 10.5 (I'm not planning to port it 
that far back, though). Backporting it further is not safe in its current shape 
because of DERBY-1107 (fixed in 10.5). Meta-data SPSs created with the fix for 
this issue need to be dropped and recreated before they can be used by versions 
without the fix, otherwise the older version will get confused when it finds a 
compiled SPS whose INITIALLY_COMPILABLE column is still false. DERBY-1107 made 
Derby drop and recreate meta-data SPSs on all version changes, not only when 
upgrading across branches, so this should not be a problem on 10.5 and later.

> getMetaData().getIndexInfo crashes with "ERROR X0Y68: Column 'PARAM1' already 
> exists."
> --------------------------------------------------------------------------------------
>
>                 Key: DERBY-4160
>                 URL: https://issues.apache.org/jira/browse/DERBY-4160
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.2.0
>         Environment: FreeBSD java 1.6.0, 64-Bit Server VM; DataNucleus JDO
>            Reporter: ArtemGr
>            Assignee: Knut Anders Hatlen
>              Labels: derby_triage10_5_2
>             Fix For: 10.11.0.0
>
>         Attachments: D4160.java, d4160-1a.diff
>
>
> The following code in DataNucleus:
> rs = conn.getMetaData().getIndexInfo(catalogName, schemaName, tableName, 
> false,
> true);
> triggers an Exception (http://gist.github.com/95679):
> Caused by: java.sql.SQLException: Column 'PARAM1' already exists.
>         at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
>         at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
>         at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
>         ... 105 more
> Caused by: ERROR X0Y68: Column 'PARAM1' already exists.
>         at 
> org.apache.derby.iapi.error.StandardException.newException(StandardException.java:303)
>         at 
> org.apache.derby.impl.sql.catalog.DataDictionaryImpl.duplicateDescriptorException(DataDictionaryImpl.java:1678)
>         at 
> org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addDescriptor(DataDictionaryImpl.java:1662)
>         at 
> org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSParams(DataDictionaryImpl.java:3682)
>         at 
> org.apache.derby.impl.sql.catalog.DataDictionaryImpl.updateSPS(DataDictionaryImpl.java:3830)
>         at 
> org.apache.derby.iapi.sql.dictionary.SPSDescriptor.updateSYSSTATEMENTS(SPSDescriptor.java:1112)
>         at 
> org.apache.derby.iapi.sql.dictionary.SPSDescriptor.getPreparedStatement(SPSDescriptor.java:736)
>         at 
> org.apache.derby.iapi.sql.dictionary.SPSDescriptor.getPreparedStatement(SPSDescriptor.java:642)
>         at 
> org.apache.derby.impl.sql.compile.ExecSPSNode.generate(ExecSPSNode.java:177)
>         at 
> org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:447)
>         at 
> org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:88)
>         at 
> org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:794)
>         at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:128)
>         ... 99 more



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to