mirror of
https://github.com/MariaDB/server.git
synced 2025-06-13 13:01:51 +03:00
Added support for max_allowed_packet in option files read by mysql_option()
Extended max_allowed_packet for clients to 1G Fixed bug in sending compressed rows >= 16M Fix bug in skiping too long packets from clients. Added checking of wrong command number sent by client.
This commit is contained in:
@ -60,7 +60,7 @@ static my_bool mysql_client_init=0;
|
||||
uint mysql_port=0;
|
||||
my_string mysql_unix_port=0;
|
||||
ulong net_buffer_length=8192;
|
||||
ulong max_allowed_packet=16*1024*1024L;
|
||||
ulong max_allowed_packet= 1024L*1024L*1024L;
|
||||
ulong net_read_timeout= NET_READ_TIMEOUT;
|
||||
ulong net_write_timeout= NET_WRITE_TIMEOUT;
|
||||
|
||||
@ -713,8 +713,8 @@ static const char *default_options[]=
|
||||
"character-sets-dir", "default-character-set", "interactive-timeout",
|
||||
"connect-timeout", "local-infile", "disable-local-infile",
|
||||
"replication-probe", "enable-reads-from-master", "repl-parse-query",
|
||||
"ssl-cipher",
|
||||
NullS
|
||||
"ssl-cipher", "max-allowed-packet",
|
||||
NullS
|
||||
};
|
||||
|
||||
static TYPELIB option_types={array_elements(default_options)-1,
|
||||
@ -868,6 +868,9 @@ static void mysql_read_default_options(struct st_mysql_options *options,
|
||||
case 25: /* repl-parse-query */
|
||||
options->rpl_parse= 1;
|
||||
break;
|
||||
case 27:
|
||||
options->max_allowed_packet= atoi(opt_arg);
|
||||
break;
|
||||
default:
|
||||
DBUG_PRINT("warning",("unknown option: %s",option[0]));
|
||||
}
|
||||
@ -1908,6 +1911,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
|
||||
mysql->server_version,mysql->server_capabilities,
|
||||
mysql->server_status, client_flag));
|
||||
|
||||
/* This needs to be changed as it's not useful with big packets */
|
||||
int3store(buff+2,max_allowed_packet);
|
||||
if (user && user[0])
|
||||
strmake(buff+5,user,32); /* Max user name */
|
||||
@ -1935,6 +1939,8 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
|
||||
goto error;
|
||||
if (client_flag & CLIENT_COMPRESS) /* We will use compression */
|
||||
net->compress=1;
|
||||
if (mysql->options.max_allowed_packet)
|
||||
net->max_packet_size= mysql->options.max_allowed_packet;
|
||||
if (db && mysql_select_db(mysql,db))
|
||||
goto error;
|
||||
if (mysql->options.init_command)
|
||||
@ -2302,7 +2308,7 @@ mysql_real_query(MYSQL *mysql, const char *query, ulong length)
|
||||
{
|
||||
DBUG_ENTER("mysql_real_query");
|
||||
DBUG_PRINT("enter",("handle: %lx",mysql));
|
||||
DBUG_PRINT("query",("Query = \"%s\"",query));
|
||||
DBUG_PRINT("query",("Query = '%-.4096s'",query));
|
||||
|
||||
if (mysql_send_query(mysql,query,length))
|
||||
DBUG_RETURN(-1);
|
||||
|
Reference in New Issue
Block a user