forked from mariadb-corporation/mariadb-connector-j
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
fix for max_allowed_packet check. also remove some obsolete stuff . a…
…lso, remove batch rewrites for prepared statements, it does not work as it is written
- Loading branch information
Showing
7 changed files
with
59 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59f3d68There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your code go in the good way,
I will base on that + at first glance :
I will take some time to make that right.
But " batch rewrites for prepared statements, it does not work as it is written" : the problems have been corrected in the master version. have you seen anything in this version ?
59f3d68There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i've seen ok the batch rewritten is done, and understand your statement ...
it's working, but not as it must be... i'll see to that
59f3d68There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not reset the seqNo, because the connection is unusable after the error. SQLNonTransientException is thrown, underlying stream is closed. Which means I make the error fatal.
There are cases where it can be avoided, but there are cases where it cannot be avoided, unless of course you materialize the entire query in memory, as bytes.
If max_allowed_packet is lets say 50MB, and we are writing into blob column, with setInputStream, and the stream is 100MB large. We would only know that we exceed 50MB when half of the query is written, and sent via TCP to the server. in that case, the only thing we could do either closing connection ourselves, or continue writing , in which case that server closes the connection
header size is not taken into account. However you might want to speak to serve folks, as I found that server would close connection if exactly max_allowed_packet are written. I think this contradicts the the documentation, server should close connection if max_allowed_packet + 1 bytes are written.
Why check for prepared statement param size? Everything including parameters is written into this PacketOutputStream, you will notice when max_allowed_packet is exceeded.
Overall, I believe the "beatify exception" request was of a minor priority, so it probably does not justify any big changes in code:)