Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArrayOutBoundOfIndex in JDBC Driver #46

Open
fabiocmazzo opened this issue Apr 5, 2018 · 5 comments
Open

ArrayOutBoundOfIndex in JDBC Driver #46

fabiocmazzo opened this issue Apr 5, 2018 · 5 comments

Comments

@fabiocmazzo
Copy link

Hello,

   I'm writing a OGM Framwork for AgensGraph and  when i use Optional Match with deep in relationship i get this error:

java.lang.ArrayIndexOutOfBoundsException: 2 at org.postgresql.jdbc.PgArray.buildArrayList(PgArray.java:442) at org.postgresql.jdbc.PgArray.getBaseTypeName(PgArray.java:779) at org.postgresql.jdbc.PgArray.getBaseType(PgArray.java:775) at com.intellij.database.remote.jdbc.impl.JdbcRemoteObject.wrapIfNeeded(JdbcRemoteObject.java:32) at com.intellij.database.remote.jdbc.impl.RemoteResultSetImpl.createInfoIfNeeded(RemoteResultSetImpl.java:1350) at com.intellij.database.remote.jdbc.impl.RemoteResultSetImpl.getObject(RemoteResultSetImpl.java:1272) at com.intellij.database.remote.jdbc.impl.RemoteResultSetImpl.getCurrentRow(RemoteResultSetImpl.java:1249) at com.intellij.database.remote.jdbc.impl.RemoteResultSetImpl.getObjects(RemoteResultSetImpl.java:1229) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:346) at sun.rmi.transport.Transport$1.run(Transport.java:200) at sun.rmi.transport.Transport$1.run(Transport.java:197) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:196) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)
Cypher to reproduce the error:
MATCH (a) OPTIONAL MATCH (a)-[b*0..2]-() RETURN *

Thank You,

@bylee5
Copy link
Contributor

bylee5 commented Apr 9, 2018

I have run Cypher with the latest version to reproduce, but I do not get error.
Can you tell me which version You tested?

@zzl221000
Copy link

zzl221000 commented Nov 8, 2018

Hi @bylee5 ,
I ran into the same problem.
I debug the getArray method

private synchronized void buildArrayList() throws SQLException {
        if (this.arrayList == null) {
            this.arrayList = new PgArray.PgArrayList();
            char delim = this.connection.getTypeInfo().getArrayDelimiter(this.oid);
            if (this.fieldString != null) {
                char[] chars = this.fieldString.toCharArray();
                StringBuilder buffer = null;
                boolean insideString = false;
                boolean wasInsideString = false;
                List<PgArray.PgArrayList> dims = new ArrayList();
                PgArray.PgArrayList curArray = this.arrayList;
                int startOffset = 0;
                if (chars[0] == '[') {
                    while(chars[startOffset] != '=') {
                        ++startOffset;
                    }

PgArray.getArray use the buildArrayList(). the fieldString does not contain "=" , This statement will always execute ++startOffset

@bylee5
Copy link
Contributor

bylee5 commented Nov 9, 2018

@zzl221000
Do you use the ResultSet.getArray() method?

@zzl221000
Copy link

@bylee5
I use the ResultSet.getArray() method, but how do I get the data in the array?
Only fieldString has a value, usel getXXX will report ArrayOutBoundOfIndex.

default

@bylee5
Copy link
Contributor

bylee5 commented Jan 11, 2019

@zzl221000
ResultSet.getArray() causes a problem with the graph data type.
I think that I need to consider the array type of graph data.
I will improve the ResultSet.getArray().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants