This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 271446 - StringIndexOutOfBoundsException: String index out of range: -5
Summary: StringIndexOutOfBoundsException: String index out of range: -5
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: Dev
Hardware: All All
: P3 normal (vote)
Assignee: matthias42
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-08 04:02 UTC by bartolinet
Modified: 2017-09-26 01:55 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 230http://hg.netbeans.org/core-main/rev/f8f8250283be254


Attachments
stacktrace (6.47 KB, text/plain)
2017-09-08 04:02 UTC, bartolinet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bartolinet 2017-09-08 04:02:30 UTC
This bug was originally marked as duplicate of bug 270540, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE Dev (Build 201708300001)
VM: Java HotSpot(TM) Client VM, 25.101-b13, Java(TM) SE Runtime Environment, 1.8.0_101-b13
OS: Windows 10

User Comments:
bartolinet: Ap
Comment 1 bartolinet 2017-09-08 04:02:32 UTC
Created attachment 165104 [details]
stacktrace
Comment 2 matthias42 2017-09-08 17:16:18 UTC
Can you extract a list of functions/procedures? I suspect function definition is not correctly transmitted and the mysql JDBC driver than fails to parse this.

Please run:

SELECT name, type, comment FROM mysql.proc WHERE db <=> <DBNAME> ORDER BY name

And attach the output here.

Without knowing the source of the problem a diagnosis won't happen.
Comment 3 matthias42 2017-09-14 14:27:56 UTC
Without further info this can't be fixed. A commit addressing that problem was pushed as:

http://hg.netbeans.org/core-main/rev/f8f8250283be

With that change at least the analysed DB, Schema and Procedure are reported and might indicate core problem.

I'm closing this, so that further exception reports reopen this.
Comment 4 Quality Engineering 2017-09-26 01:55:50 UTC
Integrated into 'main-silver', will be available in build *201709260002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/f8f8250283be
User: Matthias Blaesing <matthias42@netbeans.org>
Log: #271446: Add more information to RuntimeExceptions DatabaseMetaData#getProcedureColumns

This is not a solution, but an attempt to retrieve more information to
track the bug from #271446 down. It looks as if the mysql driver does
not correctly handle the procedure info from the DBMS:

java.lang.StringIndexOutOfBoundsException: String index out of range: -5
   at java.lang.String.substring(String.java:1967)
   at com.mysql.jdbc.DatabaseMetaData$TypeDescriptor.<init>(DatabaseMetaData.java:214)
   at com.mysql.jdbc.DatabaseMetaData.getCallStmtParameterTypes(DatabaseMetaData.java:1704)
   at com.mysql.jdbc.DatabaseMetaData.getProcedureOrFunctionColumns(DatabaseMetaData.java:4305)
   at com.mysql.jdbc.DatabaseMetaData.getProcedureColumns(DatabaseMetaData.java:4146)
   at org.netbeans.modules.db.metadata.model.jdbc.JDBCProcedure.createProcedureInfo(JDBCProcedure.java:151)