Skip to content

Commit 6986835

Browse files
palichoroba
authored andcommitted
mariadb_max_allowed_packet does not work with Embedded server
It has no effect with Embedded server because connection to Embedded server does not use packets. So do not allow mariadb_max_allowed_packet usage with Embedded server.
1 parent 726d84a commit 6986835

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

dbdimp.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3487,6 +3487,11 @@ mariadb_db_STORE_attrib(
34873487
#endif
34883488
else if (memEQs(key, kl, "mariadb_max_allowed_packet"))
34893489
{
3490+
if (imp_dbh->is_embedded)
3491+
{
3492+
mariadb_dr_do_error(dbh, CR_UNKNOWN_ERROR, "mariadb_max_allowed_packet is not supported for Embedded server", "HY000");
3493+
return 0;
3494+
}
34903495
#if (!defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 50709 && MYSQL_VERSION_ID != 60000) || (defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100206 && MYSQL_VERSION_ID != 100300)
34913496
/* MYSQL_OPT_MAX_ALLOWED_PACKET was added in mysql 5.7.9 */
34923497
/* MYSQL_OPT_MAX_ALLOWED_PACKET was added in MariaDB 10.2.6 and MariaDB 10.3.1 */
@@ -3691,6 +3696,11 @@ SV* mariadb_db_FETCH_attrib(SV *dbh, imp_dbh_t *imp_dbh, SV *keysv)
36913696
else if (memEQs(key, kl, "mariadb_max_allowed_packet"))
36923697
{
36933698
unsigned long packet_size;
3699+
if (imp_dbh->is_embedded)
3700+
{
3701+
mariadb_dr_do_error(dbh, CR_UNKNOWN_ERROR, "mariadb_max_allowed_packet is not supported for Embedded server", "HY000");
3702+
return Nullsv;
3703+
}
36943704
#if (!defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 50709 && MYSQL_VERSION_ID != 60000) || (defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100206 && MYSQL_VERSION_ID != 100300)
36953705
/* mysql_get_option() is not available in all versions */
36963706
/* if we do not have mysql_get_option() we cannot retrieve max_allowed_packet */

0 commit comments

Comments
 (0)