You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Kurt Huwig (JIRA)" <ji...@apache.org> on 2007/04/16 09:28:15 UTC

[jira] Created: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
-------------------------------------------------------------------------

                 Key: DERBY-2549
                 URL: https://issues.apache.org/jira/browse/DERBY-2549
             Project: Derby
          Issue Type: Bug
          Components: Store
    Affects Versions: 10.2.2.0
         Environment: Linux 2.6.x, JRE 1.5.0_b7
            Reporter: Kurt Huwig


I am doing this in my code:

CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")

("journal" is actually a String-variable, but I replaced it here for easier understanding)

Sometime - not always - I am getting this exception:

java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
        at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
        at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
        at org.apache.derby.client.am.Statement.execute(Unknown Source)
[...]
Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
 SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
        at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
        at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
        at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
        at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
        at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
        at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
        at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
        at org.apache.derby.client.am.Statement.executeX(Unknown Source)
        ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Kurt Huwig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491961 ] 

Kurt Huwig commented on DERBY-2549:
-----------------------------------

My patch does not compress the full database. I will limit the case when there are 111 compressable elements to 100, so that they fit into the result array. But after that, the remaining 11 elements are still not compressed. If I run INPLACE_COMPRESS again, my debugging output shows me that it compressed just these 11 elements. A third or more runs will yield no further changes to the database.

Therefore I guess that the limitation to 100 is somehow arbitrary and does not apply to my specifiy database.

Comparing to DERBY-606, the size of my database is 159MB vs several GB and it contains only 301.451 elements vs 60 million.

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Attachments: 2549-histogram.png, derby-2549-v1.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Mayuresh Nirhali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mayuresh Nirhali reassigned DERBY-2549:
---------------------------------------

    Assignee: Mayuresh Nirhali

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Assigned To: Mayuresh Nirhali
>         Attachments: 2549-histogram.png, A2549Test.java, derby-2549-v1.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Kurt Huwig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12489800 ] 

Kurt Huwig commented on DERBY-2549:
-----------------------------------

Output from the app is

Tablename                 Type   ALLOC   FREE PSIZE   SAVE File      Size KB 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ATTACHMENTFILTER          TABLE      1      0  4096      0 c3c0.dat        8
  SQL070409002320120      INDEX      1      0  4096      0 c3d1.dat        8
AUTOBLACKLIST             TABLE      1      0  4096      0 c3e0.dat        8
  SQL070409002320240      INDEX      1      0  4096      0 c3f1.dat        8
CACHE                     TABLE    670      0  4096      0 c400.dat     2684
  SQL070409002320280      INDEX    596      0  4096      0 c411.dat     2388
DISINFECTIONOPTIN         TABLE      1      0  4096      0 c420.dat        8
  SQL070409002320310      INDEX      1      0  4096      0 c431.dat        8
DISPOSABLEOPTIN           TABLE      1      0  4096      0 c440.dat        8
  SQL070409002320350      INDEX      1      0  4096      0 c451.dat        8
DISPOSABLERECIPIENTS      TABLE      1      0  4096      0 c460.dat        8
  SQL070409002320380      INDEX      1      0  4096      0 c471.dat        8
DOMAINADMIN               TABLE      1      0  4096      0 c480.dat        8
  SQL070409002320410      INDEX      1      0  4096      0 c491.dat        8
ENVELOPEPOLICY            TABLE      2      0  4096      0 c4a0.dat       12
  SQL070409002320450      INDEX      1      0  4096      0 c4b1.dat        8
FETCHACCOUNT              TABLE      1      0  4096      0 c4c0.dat        8
  SQL070409002320520      INDEX      1      0  4096      0 c4d1.dat        8
FTPUSER                   TABLE      1      0  4096      0 c4e0.dat        8
  SQL070409002320570      INDEX      1      0  4096      0 c4f1.dat        8
JOURNAL                   TABLE   4710    377 32768 12353536 c500.dat   162816
  SQL070409002320610      INDEX   4619   1125  4096 4608000 c511.dat    22980
  JOURNAL_RECEIVEDDATE_DESC INDEX   5795      0  4096      0 c521.dat    23204
LOCALDOMAINS              TABLE      1      0  4096      0 c530.dat        8
  SQL070409002320700      INDEX      1      0  4096      0 c541.dat        8
MONITORPROXIES            TABLE      1      0  4096      0 c550.dat        8
  SQL070409002320730      INDEX      1      0  4096      0 c561.dat        8
RCPTREWRITE               TABLE      1      0  4096      0 c570.dat        8
  SQL070409002320780      INDEX      1      0  4096      0 c581.dat        8
RECIPIENTBACKEND          TABLE      1      0  4096      0 c590.dat        8
  SQL070409002320820      INDEX      1      0  4096      0 c5a1.dat        8
RECIPIENTKEYS             TABLE      1      0  4096      0 c5b0.dat        8
  SQL070409002320860      INDEX      1      0  4096      0 c5c1.dat        8
RECIPIENTSTATISTIC        TABLE     14      0  4096      0 c5d0.dat       60
  SQL070409002320890      INDEX     12      0  4096      0 c5e1.dat       52
REPLAYADMIN               TABLE      1      0  4096      0 c5f0.dat        8
  SQL070409002320930      INDEX      1      0  4096      0 c601.dat        8
REPLAYLOG                 TABLE      1      0 32768      0 c610.dat       64
  SQL070409002320970      INDEX      1      0  4096      0 c621.dat        8
  REPLAYLOG_RECEIVEDDATE_DESC INDEX      1      0  4096      0 c631.dat        8
STATISTICOPTIN            TABLE      1      0  4096      0 c640.dat        8
  SQL070409002321100      INDEX      1      0  4096      0 c651.dat        8
  SYSALIASES_INDEX1       INDEX      1      0  4096      0 c191.dat        8
  SYSALIASES_INDEX2       INDEX      1      0  4096      0 c1a1.dat        8
  SYSALIASES_INDEX3       INDEX      1      0  4096      0 c1b1.dat        8
SYSALIASES                TABLE      5      0  4096      0 c180.dat       24
  SYSCHECKS_INDEX1        INDEX      1      0  4096      0 c1f1.dat        8
SYSCHECKS                 TABLE      1      0  4096      0 c1e0.dat        8
  SYSCOLPERMS_INDEX1      INDEX      1      0  4096      0 c351.dat        8
  SYSCOLPERMS_INDEX2      INDEX      1      0  4096      0 c361.dat        8
  SYSCOLPERMS_INDEX3      INDEX      1      0  4096      0 c371.dat        8
SYSCOLPERMS               TABLE      1      0  4096      0 c340.dat        8
  SYSCOLUMNS_INDEX1       INDEX      7      0  4096      0 ca1.dat        32
  SYSCOLUMNS_INDEX2       INDEX      5      0  4096      0 cb1.dat        24
SYSCOLUMNS                TABLE      8      0  4096      0 c90.dat        36
  SYSCONGLOMERATES_INDEX1 INDEX      3      0  4096      0 c31.dat        16
  SYSCONGLOMERATES_INDEX2 INDEX      4      0  4096      0 c41.dat        20
  SYSCONGLOMERATES_INDEX3 INDEX      3      0  4096      0 c51.dat        16
SYSCONGLOMERATES          TABLE      7      0  4096      0 c20.dat        32
  SYSCONSTRAINTS_INDEX1   INDEX      1      0  4096      0 c101.dat        8
  SYSCONSTRAINTS_INDEX2   INDEX      1      0  4096      0 c111.dat        8
  SYSCONSTRAINTS_INDEX3   INDEX      1      0  4096      0 c121.dat        8
SYSCONSTRAINTS            TABLE      1      0  4096      0 cf0.dat         8
  SYSDEPENDS_INDEX1       INDEX      1      0  4096      0 c161.dat        8
  SYSDEPENDS_INDEX2       INDEX      1      0  4096      0 c171.dat        8
SYSDEPENDS                TABLE      1      0  4096      0 c150.dat        8
SYSDUMMY1                 TABLE      1      0  4096      0 c2f0.dat        8
  SYSFILES_INDEX1         INDEX      1      0  4096      0 c271.dat        8
  SYSFILES_INDEX2         INDEX      1      0  4096      0 c281.dat        8
SYSFILES                  TABLE      1      0  4096      0 c260.dat        8
  SYSFOREIGNKEYS_INDEX1   INDEX      1      0  4096      0 c211.dat        8
  SYSFOREIGNKEYS_INDEX2   INDEX      1      0  4096      0 c221.dat        8
SYSFOREIGNKEYS            TABLE      1      0  4096      0 c200.dat        8
  SYSKEYS_INDEX1          INDEX      1      0  4096      0 c141.dat        8
SYSKEYS                   TABLE      1      0  4096      0 c130.dat        8
  SYSROUTINEPERMS_INDEX1  INDEX      1      0  4096      0 c391.dat        8
  SYSROUTINEPERMS_INDEX2  INDEX      1      0  4096      0 c3a1.dat        8
  SYSROUTINEPERMS_INDEX3  INDEX      1      0  4096      0 c3b1.dat        8
SYSROUTINEPERMS           TABLE      1      0  4096      0 c380.dat        8
  SYSSCHEMAS_INDEX1       INDEX      1      0  4096      0 cd1.dat         8
  SYSSCHEMAS_INDEX2       INDEX      1      0  4096      0 ce1.dat         8
SYSSCHEMAS                TABLE      1      0  4096      0 cc0.dat         8
  SYSSTATEMENTS_INDEX1    INDEX      1      0  4096      0 c241.dat        8
  SYSSTATEMENTS_INDEX2    INDEX      3      0  4096      0 c251.dat       16
SYSSTATEMENTS             TABLE     25     23  4096  94208 c230.dat      196
  SYSSTATISTICS_INDEX1    INDEX      1      0  4096      0 c2e1.dat        8
SYSSTATISTICS             TABLE      1      0  4096      0 c2d0.dat        8
  SYSTABLEPERMS_INDEX1    INDEX      1      0  4096      0 c311.dat        8
  SYSTABLEPERMS_INDEX2    INDEX      1      0  4096      0 c321.dat        8
  SYSTABLEPERMS_INDEX3    INDEX      1      0  4096      0 c331.dat        8
SYSTABLEPERMS             TABLE      1      0  4096      0 c300.dat        8
  SYSTABLES_INDEX1        INDEX      1      0  4096      0 c71.dat         8
  SYSTABLES_INDEX2        INDEX      1      0  4096      0 c81.dat         8
SYSTABLES                 TABLE      2      0  4096      0 c60.dat        12
  SYSTRIGGERS_INDEX1      INDEX      1      0  4096      0 c2a1.dat        8
  SYSTRIGGERS_INDEX2      INDEX      1      0  4096      0 c2b1.dat        8
  SYSTRIGGERS_INDEX3      INDEX      1      0  4096      0 c2c1.dat        8
SYSTRIGGERS               TABLE      1      0  4096      0 c290.dat        8
  SYSVIEWS_INDEX1         INDEX      1      0  4096      0 c1d1.dat        8
SYSVIEWS                  TABLE      1      0  4096      0 c1c0.dat        8
UCEOPTIN                  TABLE      1      0  4096      0 c660.dat        8
  SQL070409002321140      INDEX      1      0  4096      0 c671.dat        8
USERS                     TABLE      1      0  4096      0 c680.dat        8
  SQL070409002321170      INDEX      1      0  4096      0 c691.dat        8
VALIDRECIPIENTS           TABLE    192      4  4096  16384 c6a0.dat      788
  SQL070409002321210      INDEX    263      0  4096      0 c6b1.dat     1056
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Total                            17030   1529   n/a 17072128 KB n/a     217200

The table is basically a log file. It is created by only adding new records and when 350.000 records are reached, the first (oldest) 50.000 entries are deleted. This is done by determining the 50.000th element and then deleting entries with "WHERE xxx < yyy" where xxx is an order column and yyy is the value of this column of the 50.000th element.

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Attachments: DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Kurt Huwig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492319 ] 

Kurt Huwig commented on DERBY-2549:
-----------------------------------

Byan, the array check I introduced keeps Derby from crashing. IMHO, a check like this should be kept in order to prevent further crashes. Most preferable I would like to have a check that issues a warning when more rows are found than fit into the array. This way, we would keep the crash from happening ever again while still it is reportable when it occurs. An array bounds check is cheap so it will not decrease the defragmentation significantly.

Still having properly sized arrays is the best solution and the necessary array size should not be significantly larger than the now used 100 and I guess its even smaller than that for most tables. Calculation the maximum number of rows could be done at the beginning, so it won't affect running time.

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Assigned To: Mayuresh Nirhali
>         Attachments: 2549-histogram.png, A2549Test.java, derby-2549-v1.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Kurt Huwig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491955 ] 

Kurt Huwig commented on DERBY-2549:
-----------------------------------

I tweaked the code a bit to use arrays of size 1000 instead of 100 and put debugging code in it that prints the used space of the array if it is larger than 100. There was only one occurence of a usage of more than 100 elements which was 111. I will attach a histogram of the frequencies of the different array usages.

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Attachments: derby-2549-v1.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Kurt Huwig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492307 ] 

Kurt Huwig commented on DERBY-2549:
-----------------------------------

This explanations sounds reasonable. I tried to find some documentation on how to determine the row and page sizes. According to the Derby tuning docs

docs/html/tuning/ctunperf10065.html

the default page size is 4k, not 8k.

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Attachments: 2549-histogram.png, A2549Test.java, derby-2549-v1.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491681 ] 

Bryan Pendleton commented on DERBY-2549:
----------------------------------------

If your theory about the hard-coded limit of 100 rows to be compressed on a single page is true, perhaps you could construct a completely clean test case by just starting with a fresh empty database, creating the table with the appropriate DDL, then populating it with a bunch of  test data that you make up, deleting that test data, and trying to compress the table.

That is, do you actually need your real database for a test case? Can you make a test case by making a new database which has a table which has more than 100 rows on the page eligible for compression?

That would be ideal, because then you could contribute the test case without concern for data sensitivity.


> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Attachments: derby-2549-v1.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Kurt Huwig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12489899 ] 

Kurt Huwig commented on DERBY-2549:
-----------------------------------

I just tried the replacement with batches of 2000 rows like this:

        int errorRow = 0;
l1:        while(true) {
    final ResultSet rs = stm.executeQuery("SELECT * FROM journal FOR UPDATE");
        for (int row = 1; rs.next(); row++) {
            if (row < errorRow) {
                continue;
            }
            update(rs, "ip");
            update(rs, "sender");
            update(rs, "recipient");
            update(rs, "mailsender");
            update(rs, "mailfrom");
            update(rs, "mailto");
            update(rs, "cc");
            update(rs, "bcc");
            update(rs, "replyto");
            update(rs, "subject");
            update(rs, "attachments");
            update(rs, "status");
            update(rs, "reason");
            rs.updateInt("totallength", 0);
            rs.updateDouble("spamscore", 0);
            rs.updateRow();
            if (row == errorRow + 2000) {
                errorRow = row;
                rs.close();
                continue l1;
            }
            
            if (row % 500 == 0) {
                System.out.println(row);
            }
        }
        break;
        }

but this only brought me up to 9500+. Then I tried it with closing the Statement and Connection and recreating them after 2000 updates. This worked fine.

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Attachments: DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Kurt Huwig (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kurt Huwig updated DERBY-2549:
------------------------------

    Attachment: A2549Test2.java

I created a testcase as Michael described, but it DOES NOT reproduce the problem, i.e. there is nothing compressed. But maybe it is a good start for somebody else.

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Assigned To: Mayuresh Nirhali
>         Attachments: 2549-histogram.png, A2549Test.java, A2549Test2.java, derby-2549-v1.diff, derby2549_mikem.diff, derby2549_mikemv2.diff, derby2549_v2.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Mike Matrigali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Matrigali updated DERBY-2549:
----------------------------------

    Attachment: derby2549_mikem.diff

I think there is yet a third option.  The intent of this loop is to operate like the standard group fetch for normal scans.  So  it should just work to fetch N rows and have the loop check for N, and just return from the middle of the loop and leave the scan to get the rest of the rows on the next scan.  It shouldn't be necessary to size the group exactly and should not be necessary to just give up on a page if it has more rows.

I have attached a quick patch i did, but have not run full tests.  It did seem to pass the attached bug case and passed the existing online compress test.  Would appreciate if you could run this patch with your debugging to verify that we get all 111 rows rather than skipping the remaining 11.

A real checkin should include a new test case, probably based on the recent case that  reproduces the problem.  Though I noted that license has not been granted on that attachment.  

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Assigned To: Mayuresh Nirhali
>         Attachments: 2549-histogram.png, A2549Test.java, derby-2549-v1.diff, derby2549_mikem.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Mayuresh Nirhali (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12495573 ] 

Mayuresh Nirhali commented on DERBY-2549:
-----------------------------------------

derbyall and Suites_All did NOT show any new failures for the patch v3.

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Assigned To: Mayuresh Nirhali
>         Attachments: 2549-histogram.png, A2549Test.java, A2549Test2.java, derby-2549-v1.diff, derby2549_mikem.diff, derby2549_mikemv2.diff, derby2549_v2.diff, derby2549_v3.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Kurt Huwig (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kurt Huwig updated DERBY-2549:
------------------------------

    Attachment: derby-2549-v1.diff

I created a small patch that fixes the problem for me. Although I do not understand the code fully, it seems to me that the reason for the failure is that it finds more then 100 empty rows to be cleaned up but the result array only has space for 100 entries.

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Attachments: derby-2549-v1.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Mayuresh Nirhali (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491873 ] 

Mayuresh Nirhali commented on DERBY-2549:
-----------------------------------------

You might want to look at Derby-606. The testcases that were added could be useful for this scenario.


> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Attachments: derby-2549-v1.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492312 ] 

Bryan Pendleton commented on DERBY-2549:
----------------------------------------

It seems to me like there might be two alternate solutions:
1) Kurt's technique of compressing only the first 100 rows on
the page in a single run, requiring, potentialy, multiple runs to
compress all the rows
2) Adjusting the array size dynamically, so that it doesn't have
a hard limit of 100, but rather can be sized appropriately for
however many rows are on the page.

Is there any reason to prefer one solution over the other?


> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Attachments: 2549-histogram.png, A2549Test.java, derby-2549-v1.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Kurt Huwig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491558 ] 

Kurt Huwig commented on DERBY-2549:
-----------------------------------

I've prepared a database and a sample application, that reproduces this problem: if you compress it, then the Exception occurs. If you insert one additional row, the compress will work fine. As I said before, the database contains logfiles from a mailserver, so I cannot post the file here in Jira.

Can someone send me his email address and some kind of confidential statement to kurt AT huwig DOT de, please?

Otherwise, is there a way to erase/overwrite the data contained in the files? I tried to overwrite them, but this cannot be done with the entries that are already deleted.

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Attachments: DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by Kathey Marsden <km...@sbcglobal.net>.
Kurt Huwig (JIRA) wrote:
> Does anybody know when there will be a new release?
>
>   
I noticed Myrna our release manager updated the release page with 
tentative dates this morning.
http://wiki.apache.org/db-derby/DerbyTenThreeRelease


Kathey



[jira] Commented: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Kurt Huwig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491700 ] 

Kurt Huwig commented on DERBY-2549:
-----------------------------------

Bryan,

I tried this, but even after several hours of running time, it was working fine. I am not 100% percent sure, but I think the same problem occured on two different databases. I will give it a try and let the code run for some more hours. Also I will try it with the 10.2.2.0 release. I had to switch to the 10.2 SVN trunk, as there are two bugs fixed that I ran into frequently. Does anybody know when there will be a new release?

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Attachments: derby-2549-v1.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Kurt Huwig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12489826 ] 

Kurt Huwig commented on DERBY-2549:
-----------------------------------

I digged somehow deeper into this issue: I dropped all other tables and dropped the index of the table; there is only the primary key left. I replaced all values by '' and still the problem appeared. Then I tried to replace all values with 'xxxx' of the same size; after 6857 successful row updates, this happened:

Exception in thread "main" org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED statementContext is not expected to equal statementContexts[0]
	at org.apache.derby.shared.common.sanity.SanityManager.ASSERT(SanityManager.java:120)
	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.popStatementContext(GenericLanguageConnectionContext.java:2095)
	at org.apache.derby.impl.jdbc.EmbedResultSet.updateRow(EmbedResultSet.java:3773)

table DDL is:

CREATE TABLE journal(
  ID VARCHAR(20) PRIMARY KEY default '' NOT NULL,
  IP VARCHAR(45) default '' NOT NULL,
  SENDER VARCHAR(32000) default '' NOT NULL,
  RECIPIENT VARCHAR(32000) default '' NOT NULL,
  MAILSENDER VARCHAR(32000) default '' NOT NULL,
  MAILFROM VARCHAR(32000) default '' NOT NULL,
  MAILTO VARCHAR(32000) default '' NOT NULL,
  CC VARCHAR(32000) default '' NOT NULL,
  BCC VARCHAR(32000) default '' NOT NULL,
  REPLYTO VARCHAR(32000) default '' NOT NULL,
  MAILDATE TIMESTAMP default '0001-01-01 00:00:00',
  RECEIVEDDATE TIMESTAMP default '0001-01-01 00:00:00' NOT NULL,
  SUBJECT VARCHAR(32000) default '' NOT NULL,
  TOTALLENGTH BIGINT default 0 NOT NULL,
  ATTACHMENTS VARCHAR(32000) default '' NOT NULL,
  SPAMSCORE DOUBLE NOT NULL,
  STATUS VARCHAR(11) default 'aborted' NOT NULL,
  REASON VARCHAR(32000) NOT NULL);
CREATE INDEX journal_receiveddate_desc ON journal(receiveddate DESC);

FYI, I compiled Derby from the current SVN 10.2 branch and added "line,vars,source" as debug options so that I can see where the issue happens. And it is a "sane" build.

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Attachments: DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Kurt Huwig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12489716 ] 

Kurt Huwig commented on DERBY-2549:
-----------------------------------

I am able to reproduce it with Sun Java build 1.6.0-b105. I changed the exception reporting code to show the real source:

java.lang.ArrayIndexOutOfBoundsException: 100
	at org.apache.derby.impl.store.access.heap.HeapCompressScan.fetchRowsForCompress(HeapCompressScan.java:213)
	at org.apache.derby.impl.store.access.heap.HeapCompressScan.fetchNextGroup(HeapCompressScan.java:116)
	at org.apache.derby.iapi.db.OnlineCompress.defragmentRows(OnlineCompress.java:384)
	at org.apache.derby.iapi.db.OnlineCompress.compressTable(OnlineCompress.java:228)
	at org.apache.derby.catalog.SystemProcedures.SYSCS_INPLACE_COMPRESS_TABLE(SystemProcedures.java:927)
	at org.apache.derby.exe.ac601a400fx0112x04cex382ex00000045c1b80.g0(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(ReflectMethod.java:46)
	at org.apache.derby.impl.sql.execute.CallStatementResultSet.open(CallStatementResultSet.java:68)
	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:358)
	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Mike Matrigali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Matrigali resolved DERBY-2549.
-----------------------------------

    Resolution: Fixed

I have committed  the fix to the trunk with change 540657, and backported the change into the 10.2 line with 
change 540743

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Assigned To: Mayuresh Nirhali
>             Fix For: 10.2.3.0, 10.3.0.0
>
>         Attachments: 2549-histogram.png, A2549Test.java, A2549Test2.java, derby-2549-v1.diff, derby2549_mikem.diff, derby2549_mikemv2.diff, derby2549_testv1.diff, derby2549_testv1.diff, derby2549_v2.diff, derby2549_v3.diff, derby2549_v3.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Mayuresh Nirhali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mayuresh Nirhali updated DERBY-2549:
------------------------------------

    Attachment: derby2549_v2.diff

I have created a new patch, derby2549_v2.diff.

This change ensures that for the case when no of rows are more than row_array can hold, the same page will be fetched again in the next cycle to make sure the remaining rows are looked at.

Kurt, could you please try out this patch.
I will start the testruns now.

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Assigned To: Mayuresh Nirhali
>         Attachments: 2549-histogram.png, A2549Test.java, derby-2549-v1.diff, derby2549_mikem.diff, derby2549_v2.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Kurt Huwig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492447 ] 

Kurt Huwig commented on DERBY-2549:
-----------------------------------

Mike,

I had to run the compress 3 times until it stopped finding empty rows, which is one pass worse than my patch :-)

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Assigned To: Mayuresh Nirhali
>         Attachments: 2549-histogram.png, A2549Test.java, derby-2549-v1.diff, derby2549_mikem.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Mike Matrigali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Matrigali updated DERBY-2549:
----------------------------------


notes on the recent patch:
o it looks like your new lines expect 8 space tabs, derby code should either use not indent tabs or should use
    4 space tabs.  
o this level of code should not be doing -- on the page number, it should use the raw store interfaces to move 
    to next and previous pages.  There are a couple of reasons:
    1) even though the current raw store implementation dones have pages for each container laid out from 0 to N,
         future implementations may not.
     2) The get next and get previous interfaces take care of  postioning on the next USER head page -- by doing 
           -- or ++ you may get put on an overflow row page, a raw store internal bit map page, ...

o As you found in your debugging the problem with my previous patch was that the position of the scan was not
    properly maintained in the scan_position (that will teach me to copy/paste code from other parts of system).  
    I think a better fix would be to properly position the scan on the right  row, rather than letting the code get to 
     the postion at next page code path and then reposition backward to the previous page.   

    Scan positions are meant to be maintained by a couple of different means.  While you have a latch on the page
    it is fine to just maintain the slot number as nothing can change out from under you unless you do it.  If you 
    are going to give up the latch on heap scan then the usual way to maintain a scan is by getting the record 
     handl associated with the current slot number, then this can be used to repostion the scan the next trip back.
     I'll post another patch with a suggestion, let me know what you think.  Again I haven't had time to debug it.

     Also it would be good to get a test added to the test suite for this bug, do you plan on doing that?  I think  the
     easiest case would be:
     o create a table with 1 column, smallest datatype possible - say smallint, and largest page size.  It would be good if the
         test case had more than 200 rows that could be moved so it would test visiting the same page more than
         2 times.
     o add enough rows to get a reasonable number of pages - say 10.
     o delete rows leaving at least one row per page, probably easiest if you just delete every row execept each 100th row in the order you inserted them , or something like that. 


> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Assigned To: Mayuresh Nirhali
>         Attachments: 2549-histogram.png, A2549Test.java, derby-2549-v1.diff, derby2549_mikem.diff, derby2549_v2.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Kurt Huwig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12495045 ] 

Kurt Huwig commented on DERBY-2549:
-----------------------------------

Mayuresh,

the patch is working fine and it compresses the database within one pass.

Thanks for the good work!

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Assigned To: Mayuresh Nirhali
>         Attachments: 2549-histogram.png, A2549Test.java, derby-2549-v1.diff, derby2549_mikem.diff, derby2549_v2.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Mike Matrigali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Matrigali updated DERBY-2549:
----------------------------------


I am ready to commit your test and  patch, but the attachments you have submitted are not checked to grant 
license to the ASF.  

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Assigned To: Mayuresh Nirhali
>             Fix For: 10.2.3.0, 10.3.0.0
>
>         Attachments: 2549-histogram.png, A2549Test.java, A2549Test2.java, derby-2549-v1.diff, derby2549_mikem.diff, derby2549_mikemv2.diff, derby2549_testv1.diff, derby2549_v2.diff, derby2549_v3.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492301 ] 

Bryan Pendleton commented on DERBY-2549:
----------------------------------------

Great work Mayuresh! Your test program reproduces the problem for me, too.



> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Attachments: 2549-histogram.png, A2549Test.java, derby-2549-v1.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12489772 ] 

Kristian Waagan commented on DERBY-2549:
----------------------------------------

FYI, a user claimed to have a reproducible example for this on IRC. Unfortunately, he/she wasn't sure what to do with it, and left before I was able to answer.

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Kurt Huwig (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kurt Huwig updated DERBY-2549:
------------------------------

    Attachment: 2549-histogram.png

Histogram of the frequency of the "number of elements in the array". X is array usage, Y is frequency.

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Attachments: 2549-histogram.png, derby-2549-v1.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan updated DERBY-2549:
-----------------------------------

    Attachment: DerbyDiskSpaceDiag.java

A little app printing simple disk space diagnostics.
Not very well tested...

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Attachments: DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Mayuresh Nirhali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mayuresh Nirhali updated DERBY-2549:
------------------------------------

    Attachment: derby2549_v3.diff

Thanks Mike for your expert comments. I realized that '--' is inappropriate after posting the patch. I am sure it would have taken a bit more time for me to come up with that solution due to my limited understanding. I appreciate your time for the explanation and the patch.

I found two small nits in the latest patch. When, getRecordHandleAtSlot is called scan_position has already moved back to the previous slot. This will imply incorrect behavior when current_slot becomes -1. I have fixed this by storing the current_slot number in a new variable temp_current_slot and passing this to getRecordHandleAtSlot.

I am starting testruns for this latest patch now.

I plan to add a test for this based on the repro attached. I will try to cut down the time taken by the test by using small size data. I need some time for this as I am not very familiar with junit fixtures. I am hoping that the testcase addition will go as a separate patch. let me know your thoughts ??





> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Assigned To: Mayuresh Nirhali
>         Attachments: 2549-histogram.png, A2549Test.java, A2549Test2.java, derby-2549-v1.diff, derby2549_mikem.diff, derby2549_mikemv2.diff, derby2549_v2.diff, derby2549_v3.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Mayuresh Nirhali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mayuresh Nirhali updated DERBY-2549:
------------------------------------

       Derby Info: [Patch Available]
    Fix Version/s: 10.3.0.0
                   10.2.3.0

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Assigned To: Mayuresh Nirhali
>             Fix For: 10.2.3.0, 10.3.0.0
>
>         Attachments: 2549-histogram.png, A2549Test.java, A2549Test2.java, derby-2549-v1.diff, derby2549_mikem.diff, derby2549_mikemv2.diff, derby2549_testv1.diff, derby2549_v2.diff, derby2549_v3.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Mayuresh Nirhali (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12494970 ] 

Mayuresh Nirhali commented on DERBY-2549:
-----------------------------------------

Thanks Mike for clarifying the behavior.

On a second thought, Option 2 mentioned above would not be suitable because the size will also have to changed for few other arrays and huge size might lead to OOME. The existing approach as described in mike's comment sounds reasonable.

I debugged mike's quick patch and it seems that after reaching the limit (page is unlatched), scan_position is not repositioned correctly. In fact, in this special case, on attempt to fetch next group, no valid page is found. So, only 100 rows can be cleaned per Compress operation.

I will work on a follow up patch from tje patch mike attached. Thanks again mike.

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Assigned To: Mayuresh Nirhali
>         Attachments: 2549-histogram.png, A2549Test.java, derby-2549-v1.diff, derby2549_mikem.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Mayuresh Nirhali (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492316 ] 

Mayuresh Nirhali commented on DERBY-2549:
-----------------------------------------

Bryan, I am also inclined towards Option 2. I think that will be the right fix, just that I was caught up with something, hence could not produce a patch today.
I will create a patch for this early next week and will try to submit it for review.



> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Attachments: 2549-histogram.png, A2549Test.java, derby-2549-v1.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Mike Matrigali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Matrigali updated DERBY-2549:
----------------------------------

    Attachment: derby2549_mikemv2.diff

patch illustrating most recent comments on saving row position.  Not ready for commit - no tests/debugging done.

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Assigned To: Mayuresh Nirhali
>         Attachments: 2549-histogram.png, A2549Test.java, derby-2549-v1.diff, derby2549_mikem.diff, derby2549_mikemv2.diff, derby2549_v2.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Mayuresh Nirhali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mayuresh Nirhali updated DERBY-2549:
------------------------------------

    Attachment: derby2549_testv1.diff
                derby2549_v3.diff

attaching patches with Grant license flag set.

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Assigned To: Mayuresh Nirhali
>             Fix For: 10.2.3.0, 10.3.0.0
>
>         Attachments: 2549-histogram.png, A2549Test.java, A2549Test2.java, derby-2549-v1.diff, derby2549_mikem.diff, derby2549_mikemv2.diff, derby2549_testv1.diff, derby2549_testv1.diff, derby2549_v2.diff, derby2549_v3.diff, derby2549_v3.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Mike Matrigali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Matrigali updated DERBY-2549:
----------------------------------


If you click on the manage attachments link to the left of the attachments you will see a report  on each of the attachements.  Actually don't know if you can change the grant, so in the worst case you may have to submit your latest 2 again, this time checking the box to grant license when you submit them.

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Assigned To: Mayuresh Nirhali
>             Fix For: 10.2.3.0, 10.3.0.0
>
>         Attachments: 2549-histogram.png, A2549Test.java, A2549Test2.java, derby-2549-v1.diff, derby2549_mikem.diff, derby2549_mikemv2.diff, derby2549_testv1.diff, derby2549_v2.diff, derby2549_v3.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Mayuresh Nirhali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mayuresh Nirhali updated DERBY-2549:
------------------------------------

    Attachment: A2549Test.java

I was able to reproduce this error. Attaching a sample program here.

I think, the issue here is that, During Heap Scan (in Compress operation) the size of the array that can hold  the records is hard coded to 100. So when the recordCount for a page is more than 100, during compress operation, it will throw AIOBE. This is possible in 2 cases, either the record size is small so that in a page (with default size, 8192) more than 100 records are stored, or default page size is changed to a higher value that will accomodate more than 100 records.

To reproduce this bug, please run the attached program as below,

java -cp $CLASSPATH:. -Dderby.debug.true=SpaceTrace -Dderby.storage.pageSize=32768 A2549Test > log.txt



> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Attachments: 2549-histogram.png, A2549Test.java, derby-2549-v1.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2549) ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE

Posted by "Mayuresh Nirhali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mayuresh Nirhali updated DERBY-2549:
------------------------------------

    Attachment: derby2549_testv1.diff

I have added another test to store/OnlineCompressTest.java.
The test is based on the repro I had attached. I have downsized the time required by the test to something much lower than the repro.

The patch only has test changes (test code + master files)

The 2 patches, derby2549_v3.diff and derby2549_testv1.diff are ready for review.

> ArrayIndexOutOfBoundsException in SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE
> -------------------------------------------------------------------------
>
>                 Key: DERBY-2549
>                 URL: https://issues.apache.org/jira/browse/DERBY-2549
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.2.0
>         Environment: Linux 2.6.x, JRE 1.5.0_b7
>            Reporter: Kurt Huwig
>         Assigned To: Mayuresh Nirhali
>         Attachments: 2549-histogram.png, A2549Test.java, A2549Test2.java, derby-2549-v1.diff, derby2549_mikem.diff, derby2549_mikemv2.diff, derby2549_testv1.diff, derby2549_v2.diff, derby2549_v3.diff, DerbyDiskSpaceDiag.java
>
>
> I am doing this in my code:
> CALL SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SPONTS','" + "journal".toUpperCase(Locale.US) + "',1,1,1)")
> ("journal" is actually a String-variable, but I replaced it here for easier understanding)
> Sometime - not always - I am getting this exception:
> java.sql.SQLException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression. SQLSTATE: XJ001:
> Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.execute(Unknown Source)
> [...]
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.lang.ArrayIndexOutOfBoundsException: 100' was thrown while evaluating an expression.
>  SQLSTATE: XJ001: Java exception: '100: java.lang.ArrayIndexOutOfBoundsException'.
>         at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
>         at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
>         at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeX(Unknown Source)
>         ... 12 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.