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

Make SQLException prettier when too large packet is sent to the server

    XMLWordPrintable

Details

    • Task
    • Status: Closed (View Workflow)
    • Trivial
    • Resolution: Fixed
    • 1.1.7
    • 1.1.8
    • None
    • None

    Description

      How to reproduce:
      Run the attached test case maxAllowedPackedExceptionIsPrettyTest() in the attached file MaxAllowedPacketTest.java

      Psedo code:

      1. Lower or set the server variable max_allowed_packet to a good value
      2. Create an SQL query bigger than max_allowed_packet
      3. Execute the SQL query and look at the Exception text.

      Actual:
      The test case will fail and this will be printed in the console:

      Could not send query: Software caused connection abort: socket write error

      Expected:
      When running my test with Mysql JDBC the test case will pass and this will be printed in the log:

      Packet for query is too large (1106929 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable.

      Analysis:
      The amount of effort to fix this is probably big. It would require that the JDBC connector to find out the session max_allowed_packet variable and count the bytes in the queries. I would prioritize this ticket low.

      However if CONJ-115 is fixed in a super nice way and using the max_allowed_packet to regulate how large LOAD DATA INFILE chunks to send to the server I suspect it would be easier to write a pretty Exception message.

      Attachments

        Activity

          People

            massimo.siani Massimo Siani (Inactive)
            lennartschedin Lennart Schedin
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.