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

Jean-Yves LINET commented on DERBY-5530:
----------------------------------------

Well I spent several more hours on this problem trying to isolate the bug 
context. It was not obvious must I finally found how to reproduce it.
In fact the bug is quite easy to reproduce and it comes from the use of the 
TRUNCATE TABLE statement.
1- Create a table with a single column,
2- Add an index on this column,
3- Execute TRUNCATE statement on this table, 
4- Add at least two rows,
5- Execute the SYSCS_UPDATE_STATISTICS procedure.
If you have created the database with collation you have the 
NullPointerException, with no collation it is working fine.

One more information. If you call the SYSCS_COMPRESS_TABLE before the 
statistics you don't have the NPE with collation database.

I hope this information will be helpful to fix the bug.
If you need more information just ask.


                
> SQLChar.getCollationKey NPE in index-stat-thread
> ------------------------------------------------
>
>                 Key: DERBY-5530
>                 URL: https://issues.apache.org/jira/browse/DERBY-5530
>             Project: Derby
>          Issue Type: Bug
>    Affects Versions: 10.8.2.2
>         Environment: Windows 7 - NetBeans 6.9.1
>            Reporter: Jean-Yves LINET
>
> With this JDBC connection url is : 
> jdbc:derby:directory:db_name;territory=fr_FR;collation=TERRITORY_BASED:PRIMARY;create=true
> I get a NullPointerException in index-stat-thread
> Sun Dec 11 19:33:11 CET 2011 Thread[pool-3-thread-1,5,main] {istat} 
> "PROXIFLEX"."IDAXX_RES": update scheduled, reason=[no stats, 
> row-estimate=375] (queueSize=1)
> Sun Dec 11 19:33:11 CET 2011 Thread[index-stat-thread,5,main] 
> {istat,trace@26130360} worker thread started (xid=12049) 
> [q/p/s=1/0/1,err:k/u/c=0/0/0,rej:f/d/o=0/0/0]
> Sun Dec 11 19:33:11 CET 2011 Thread[index-stat-thread,5,main] 
> {istat,trace@26130360}     processing "PROXIFLEX"."IDAXX_RES" 
> Sun Dec 11 19:33:11 CET 2011 Thread[index-stat-thread,5,main] {istat} runtime 
> exception during normal operation
> java.lang.NullPointerException
>       at org.apache.derby.iapi.types.SQLChar.getCollationKey(Unknown Source)
>       at 
> org.apache.derby.iapi.types.WorkHorseForCollatorDatatypes.stringCompare(Unknown
>  Source)
>       at org.apache.derby.iapi.types.CollatorSQLVarchar.stringCompare(Unknown 
> Source)
>       at org.apache.derby.iapi.types.SQLChar.compare(Unknown Source)
>       at 
> org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl$KeyComparator.compareWithPrevKey(Unknown
>  Source)
>       at 
> org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.updateIndexStatsMinion(Unknown
>  Source)
>       at 
> org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.generateStatistics(Unknown
>  Source)
>       at 
> org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.processingLoop(Unknown
>  Source)
>       at 
> org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.run(Unknown 
> Source)
>       at java.lang.Thread.run(Thread.java:662)
> Sun Dec 11 19:33:11 CET 2011 Thread[index-stat-thread,5,main] 
> {istat,trace@26130360} worker thread exit 
> [q/p/s=0/0/1,err:k/u/c=0/0/0,rej:f/d/o=0/0/0]
> If I remove territory and collation parameters I don't have the exception.
> In case you want to disable automatic statistics, set derby property : 
> derby.storage.indexStats.auto to false.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to