Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-361

StringParameter class doesn't but should support (?) empty string

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 1.5.3
    • 1.5.4
    • Other
    • None

    Description

      With latest version 1.5.3 I came across this stacktrace

      java.lang.StringIndexOutOfBoundsException: String index out of range: 0
       
      	at java.lang.String.charAt(String.java:658)
      	at org.mariadb.jdbc.internal.packet.dao.parameters.StringParameter.escapeUtf8(StringParameter.java:197)
      	at org.mariadb.jdbc.internal.packet.dao.parameters.StringParameter.writeTo(StringParameter.java:81)
      

      The root cause seems to be that StringParameter doesn't handel empty strings, which I think it should.

      Here is e simple test case:

      final StringParameter stringParameter = new StringParameter("", false);
      stringParameter.writeTo(new PacketOutputStream(new ByteArrayOutputStream(), false, 0));
      

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            Dan Dan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.