[jira] [Commented] (DERBY-7113) Index has value of column which no longer exists in the table

2021-04-19 Thread Richard N. Hillegas (Jira)


[ 
https://issues.apache.org/jira/browse/DERBY-7113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17325107#comment-17325107
 ] 

Richard N. Hillegas commented on DERBY-7113:


The DRDA error message isn't very helpful. There might be some interesting 
diagnostic information in the server-side derby.log file--provided that the 
diagnostic logging level has been set high enough. That information might help 
you identify the corrupt index.

At this point, I have no confidence in the integrity of your database. The 
problem may be as simple as not disabling file system write-caching. That would 
be an interesting question to ask the database administrator.

> Index has value of column which no longer exists in the table
> -
>
> Key: DERBY-7113
> URL: https://issues.apache.org/jira/browse/DERBY-7113
> Project: Derby
>  Issue Type: Bug
>  Components: Network Server
>Affects Versions: 10.8.3.0
> Environment: Linux with Java 8 - 8.0.6.25
>Reporter: Geraldine
>Priority: Critical
>
> From time to time an Index keeps a value, which has been deleted from the 
> underlying table.
> This results in an error is the row with the value is selected.
>  _SELECT ID from Some.TABLE WHERE IndexedColumn= 'Remembered Value';_
> _ID_
> __
> _1680880176_
> _ERROR 0A000: The DRDA command parseSQLDIAGSTT is not currently implemented.  
> The connection has been terminated._
>  If only the Indexed Column is selected, then the Query returns 0 rows and 
> produces no error - because just the index is searched.
> The Query Plan shows the index being used.
> Dropping and Recreating the index fixes the issue. However, I can reproduce 
> this by reloading a database backup.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (DERBY-7113) Index has value of column which no longer exists in the table

2021-04-19 Thread Geraldine (Jira)


[ 
https://issues.apache.org/jira/browse/DERBY-7113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17324898#comment-17324898
 ] 

Geraldine commented on DERBY-7113:
--

thanks for the responses...

to answer the Qs:
 # Yes, the backup was taken when the index was corrpted.
 # Running SYSCS_UTIL.SYSCS_CHECK_TABLE system returns 1 for this and all other 
tables in the database. This is even when the corruption is in place. Also, 
updating the statistics for the index did not resolve the issue. The only way 
to fix the issue was to drop and recreate it.
 # Regarding the advice in the link, I cannot say 100% that all this advice is 
followed as I am not the admin of the system but I will share this.

I'm thinking in this case, the database knows that an issue exists... i.e. the 
index returned something but when the actual data was searched, nothing was 
found. I can see from the code that it throws an exception in this case. But 
could it be handled better? Maybe with a message saying which index was being 
used ?

 

 

> Index has value of column which no longer exists in the table
> -
>
> Key: DERBY-7113
> URL: https://issues.apache.org/jira/browse/DERBY-7113
> Project: Derby
>  Issue Type: Bug
>  Components: Network Server
>Affects Versions: 10.8.3.0
> Environment: Linux with Java 8 - 8.0.6.25
>Reporter: Geraldine
>Priority: Critical
>
> From time to time an Index keeps a value, which has been deleted from the 
> underlying table.
> This results in an error is the row with the value is selected.
>  _SELECT ID from Some.TABLE WHERE IndexedColumn= 'Remembered Value';_
> _ID_
> __
> _1680880176_
> _ERROR 0A000: The DRDA command parseSQLDIAGSTT is not currently implemented.  
> The connection has been terminated._
>  If only the Indexed Column is selected, then the Query returns 0 rows and 
> produces no error - because just the index is searched.
> The Query Plan shows the index being used.
> Dropping and Recreating the index fixes the issue. However, I can reproduce 
> this by reloading a database backup.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (DERBY-7114) class org.apache.derby.iapi.store.raw.PageKey cannot be cast to class org.apache.derby.iapi.store.raw.ContainerKey

2021-04-19 Thread Sam Hutchins (Jira)


[ 
https://issues.apache.org/jira/browse/DERBY-7114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17324775#comment-17324775
 ] 

Sam Hutchins commented on DERBY-7114:
-

We updated our products to Java 11 a little while ago, but I have managed to 
dig out an example from before that change. This is from an older version of 
the same product, still with Derby 10.14.2.0 and Java 1.8_161:

 
{code:java}
 Caused by: java.sql.SQLException: Java exception: 
'org.apache.derby.iapi.store.raw.PageKey cannot be cast to 
org.apache.derby.iapi.store.raw.ContainerKey: java.lang.ClassCastException'.
at 
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java)
at 
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java)
at org.apache.derby.impl.jdbc.Util.seeNextException(Util.java)
at org.apache.derby.impl.jdbc.Util.javaException(Util.java)
at 
org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java)
at 
org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java)
at 
org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java)
at 
org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java)
at 
org.apache.derby.impl.jdbc.EmbedResultSet.closeOnTransactionError(EmbedResultSet.java)
at 
org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(EmbedResultSet.java)
at org.apache.derby.impl.jdbc.EmbedResultSet.next(EmbedResultSet.java)
at 
uk.co.screamingfrog.seospider.db.LinksTableOperations.getLinks(LinksTableOperations.java:257)
... 15 more
Caused by: ERROR XJ001: Java exception: 
'org.apache.derby.iapi.store.raw.PageKey cannot be cast to 
org.apache.derby.iapi.store.raw.ContainerKey: java.lang.ClassCastException'.
at 
org.apache.derby.iapi.error.StandardException.newException(StandardException.java)
at 
org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory.java)
... 27 more
Caused by: java.lang.ClassCastException: 
org.apache.derby.iapi.store.raw.PageKey cannot be cast to 
org.apache.derby.iapi.store.raw.ContainerKey
at 
org.apache.derby.impl.store.raw.data.FileContainer.setIdentity(FileContainer.java)
at 
org.apache.derby.impl.services.cache.ConcurrentCache.find(ConcurrentCache.java)
at 
org.apache.derby.impl.store.raw.data.FileContainer.getUserPage(FileContainer.java)
at 
org.apache.derby.impl.store.raw.data.FileContainer.getPage(FileContainer.java)
at 
org.apache.derby.impl.store.raw.data.BaseContainerHandle.getPage(BaseContainerHandle.java)
at 
org.apache.derby.impl.store.access.btree.ControlRow.get(ControlRow.java)
at 
org.apache.derby.impl.store.access.btree.ControlRow.get(ControlRow.java)
at 
org.apache.derby.impl.store.access.btree.BranchControlRow.getChildPageAtSlot(BranchControlRow.java)
at 
org.apache.derby.impl.store.access.btree.BranchControlRow.search(BranchControlRow.java)
at 
org.apache.derby.impl.store.access.btree.BranchControlRow.search(BranchControlRow.java)
at 
org.apache.derby.impl.store.access.btree.BTreeScan.positionAtStartForForwardScan(BTreeScan.java)
at 
org.apache.derby.impl.store.access.btree.BTreeForwardScan.positionAtStartPosition(BTreeForwardScan.java)
at 
org.apache.derby.impl.store.access.btree.BTreeForwardScan.fetchRows(BTreeForwardScan.java)
at 
org.apache.derby.impl.store.access.btree.BTreeScan.fetchNext(BTreeScan.java)
at 
org.apache.derby.impl.sql.execute.TableScanResultSet.loopControl(TableScanResultSet.java)
at 
org.apache.derby.impl.sql.execute.TableScanResultSet.getNextRowCore(TableScanResultSet.java)
at 
org.apache.derby.impl.sql.execute.IndexRowToBaseRowResultSet.getNextRowCore(IndexRowToBaseRowResultSet.java)
at 
org.apache.derby.impl.sql.execute.NestedLoopJoinResultSet.getNextRowCore(NestedLoopJoinResultSet.java)
at 
org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.getNextRow(BasicNoPutResultSetImpl.java)
... 18 more{code}

> class org.apache.derby.iapi.store.raw.PageKey cannot be cast to class 
> org.apache.derby.iapi.store.raw.ContainerKey
> --
>
> Key: DERBY-7114
> URL: https://issues.apache.org/jira/browse/DERBY-7114
> Project: Derby
>  Issue Type: Bug
>Affects Versions: 10.14.2.0
> Environment: Java 8/11, Windows/macOS
>Reporter: Sam Hutchins
>Priority: Major
>
> Hi,
>  
> We're using the embedded driver, and we sometimes see this exception in the 
> wild:
>  
> {code:java}
> java.