db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Hillegas (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-2193) [import] ERROR 38000: StringIndexOutOfBoundsException was thrown while evaluating an expression.
Date Tue, 10 Apr 2007 21:24:32 GMT

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

Rick Hillegas updated DERBY-2193:
---------------------------------

    Attachment: derby-2193-01.diff
                derby-2193-script.jar

Attaching a test case which demonstrates the problem: derby-2193-script.jar. Unpack the jar
and run the ij script z.sql.

The problem is this: The import tool trims whitespace from string fields which aren't enclosed
in double quotes. IThis behavior of Import does not seem to be documented. We should document
this behavior as part of addressing this bug.

If there is nothing but white space in a field, then the Import tool trips over an array index
exception. The fix is to translate the trimmed field to null instead.

Attaching a patch, derby-2193-01.diff:

M      java/engine/org/apache/derby/impl/load/ImportReadData.java

   Returns null instead of tripping of an indexing exception now.

M      java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExportThruIJ.sql
M      java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExportThruIJ_app.properties
A      java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/derby-2193.txt
M      java/testing/org/apache/derbyTesting/functionTests/master/importExportThruIJ.out

    Regression test for this bug.



> [import] ERROR 38000: StringIndexOutOfBoundsException was thrown while evaluating an
expression.
> ------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2193
>                 URL: https://issues.apache.org/jira/browse/DERBY-2193
>             Project: Derby
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 10.2.1.6
>            Reporter: Aaron Digulla
>         Attachments: derby-2193-01.diff, derby-2193-script.jar
>
>
> During import of a file, I get this error:
> ERROR 38000: The exception 'java.sql.SQLException: Java exception: 'java.lang.StringIndexOutOfBoundsException:
String index out of range: -14'.' was thrown while evaluating an expression.
> 	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> 	at org.apache.derby.iapi.error.StandardException.unexpectedUserException(Unknown Source)
> 	at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CallStatementResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)
> 	...
> How am I supposed to find what's wrong in a big import? :-) It should at least mention
the file which I was importing, the row and the column when the error occurred.
> After printing the whole exceptions chain, I got these additional two:
> ERROR XJ001: Java exception: 'java.lang.StringIndexOutOfBoundsException: String index
out of range: -14'.
> 	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> 	at org.apache.derby.iapi.error.StandardException.plainWrapException(Unknown Source)
> 	at org.apache.derby.impl.load.LoadError.unexpectedError(Unknown Source)
> 	at org.apache.derby.impl.load.ImportAbstract.next(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.VTIResultSet.getNextRowCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.getNextRowCore(Unknown
Source)
> 	at org.apache.derby.impl.sql.execute.NormalizeResultSet.getNextRowCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.NoPutResultSetImpl.getNextRowFromRowSource(Unknown
Source)
> 	at org.apache.derby.impl.store.access.heap.HeapController.load(Unknown Source)
> 	at org.apache.derby.impl.store.access.heap.Heap.load(Unknown Source)
> 	at org.apache.derby.impl.store.access.RAMTransaction.loadConglomerate(Unknown Source)
> 	at org.apache.derby.impl.store.access.RAMTransaction.recreateAndLoadConglomerate(Unknown
Source)
> 	at org.apache.derby.impl.store.access.RAMTransaction.createAndLoadConglomerate(Unknown
Source)
> 	at org.apache.derby.impl.sql.execute.InsertResultSet.bulkInsertCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
> 	at org.apache.derby.impl.load.Import.performImport(Unknown Source)
> 	at org.apache.derby.impl.load.Import.importData(Unknown Source)
> 	at org.apache.derby.catalog.SystemProcedures.SYSCS_IMPORT_DATA(Unknown Source)
> 	at org.apache.derby.exe.ac07170079x010fx9622xb7bax00000011a6e80.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:585)
> 	at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CallStatementResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)
> 	...
> java.lang.StringIndexOutOfBoundsException: String index out of range: -14
> 	at java.lang.String.<init>(String.java:202)
> 	at org.apache.derby.impl.load.ImportReadData.readNextDelimitedRow(Unknown Source)
> 	at org.apache.derby.impl.load.ImportReadData.readNextRow(Unknown Source)
> 	at org.apache.derby.impl.load.ImportAbstract.next(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.VTIResultSet.getNextRowCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.getNextRowCore(Unknown
Source)
> 	at org.apache.derby.impl.sql.execute.NormalizeResultSet.getNextRowCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.NoPutResultSetImpl.getNextRowFromRowSource(Unknown
Source)
> 	at org.apache.derby.impl.store.access.heap.HeapController.load(Unknown Source)
> 	at org.apache.derby.impl.store.access.heap.Heap.load(Unknown Source)
> 	at org.apache.derby.impl.store.access.RAMTransaction.loadConglomerate(Unknown Source)
> 	at org.apache.derby.impl.store.access.RAMTransaction.recreateAndLoadConglomerate(Unknown
Source)
> 	at org.apache.derby.impl.store.access.RAMTransaction.createAndLoadConglomerate(Unknown
Source)
> 	at org.apache.derby.impl.sql.execute.InsertResultSet.bulkInsertCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
> 	at org.apache.derby.impl.load.Import.performImport(Unknown Source)
> 	at org.apache.derby.impl.load.Import.importData(Unknown Source)
> 	at org.apache.derby.catalog.SystemProcedures.SYSCS_IMPORT_DATA(Unknown Source)
> 	...

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


Mime
View raw message