Quantcast
Channel: MySQL Forums - Connector/J, JDBC and Java
Viewing all articles
Browse latest Browse all 884

How exactly MySQL support longblob (no replies)

$
0
0
JDBC connection. jdbc:mysql://mi-db:3306/dbmi?blobSendChunkSize=10000&useServerPrepStmts=true&emulateUnsupportedPstmts=false&maxAllowedPacket=200000

Yes I can increase max_allowed_packet property. No reason though since my data is bigger than 1GB anyway.

I have a simple table with 3 fields, where 1 field has LONGBLOB type.
And I have a question. How value of LONGBLOB is supposed to be inserted.
JPA or server prepared statement with binary stream binding for longblob value would fail because neither client side neither server side supports blob bigger than 1GB(protocol limit for max_allowed_packet is 1GB).
Binary stream is supposed to send long values in chunks. And it does. Except server accept chunks with this function
bool Item_param::set_longdata(const char *str, ulong length) {
DBUG_TRACE;

/*
If client character set is multibyte, end of long data packet
may hit at the middle of a multibyte character. Additionally,
if binary log is open we must write long data value to the
binary log in character set of client. This is why we can't
convert long data to connection character set as it comes
(here), and first have to concatenate all pieces together,
write query to the binary log and only then perform conversion.
*/
if (str_value.length() + length > current_thd->variables.max_allowed_packet) {
my_message(ER_UNKNOWN_ERROR,
"Parameter of prepared statement which is set through "
"mysql_send_long_data() is longer than "
"'max_allowed_packet' bytes",
MYF(0));
return true;
}

if (str_value.append(str, length, &my_charset_bin)) return true;
state = LONG_DATA_VALUE;
maybe_null = 0;

return false;
}

What effectively makes blob limited to a 1GB on server side.
Is a type longer than 1GB a futere release feature? I dont see any documentation mentioning that it is so.

Viewing all articles
Browse latest Browse all 884

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>