Bugs item #2890914, was opened at 2009-11-02 21:08
Message generated for change (Tracker Item Submitted) made by david852
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2890914&group_id=56967

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: SQL/JDBC
Group: MonetDB4 "stable"
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: david85 (david852)
Assigned to: Fabian (mr-meltdown)
Summary: StartOfHeaderParser.java#getNextAsString() Err: IndexOutOfB

Initial Comment:
Hello,

I encountered an error when executing my queries at this method.

Using: "Aug2009-SP1" driver / monetdb-1.13-jdbc.jar
      and   jdk 1.6.0_14/jre
      and   Eclipse Version: 3.4.2
OS: Windows Vista 64 Bit w. newest updates

My Query Structure:
"INSERT INTO tableName VALUES(...), VALUES(...), VALUES(...), ..."

I used the simple statement.execute command to execute that query, however I 
encountered an
IndexOutOfBoundsException.

I traced it down to the following line:
return(soh.subSequence(0, cnt).toString());
where cnt = 2 and soh.Remaining() = 2;

I downloaded "Aug2009-SP1" source code / MonetDB-java-1.32.2.zip and modified 
the method
as follows:

The original code is:
                pos++;
                if (!soh.hasRemaining()) throw
                        new MCLParseException("unexpected end of string", 
soh.position() - 1);
                int cnt = 0;
                soh.mark();
                while (soh.hasRemaining() && soh.get() != ' ') {
                        cnt++;
                }

                soh.reset();
                return(soh.subSequence(0, cnt).toString());
My version is:
                pos++;
                if (!soh.hasRemaining()) throw
                        new MCLParseException("unexpected end of string", 
soh.position() - 1);
                int cnt = 0;

                String subSequence = "";
               
                while (soh.hasRemaining()) {
                        char read = soh.get();
                       
                        if(read  == ' ')
                                break;
                       
                        subSequence += read;
                       
                        cnt++;
                }
               
                return subSequence;

And the error was gone.
I thought I should report this although I don't know whether it's relevant or 
even my own fault that
I got that error. I also found an entry regarding this error, but I don't know 
whether it has been removed
or reported yet.

Best Regards,

David

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2890914&group_id=56967

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to