summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-01-31 09:48:19 +0100
committerSergei Golubchik <sergii@pisem.net>2013-01-31 09:48:19 +0100
commitab83952f293ea46c00e421c81b81a394c9cae2b4 (patch)
tree6a3e995bd1330828a0e988d896bca218863fc74c /sql-common
parent055b62f404ee0a0463ee8ff98a0e24c083b95f1d (diff)
parent5267af5e9e5e601d4f4b1ef40730da1e36d38d9d (diff)
downloadmariadb-git-ab83952f293ea46c00e421c81b81a394c9cae2b4.tar.gz
10.0-base merge
Diffstat (limited to 'sql-common')
-rw-r--r--sql-common/client.c14
-rw-r--r--sql-common/client_plugin.c2
2 files changed, 9 insertions, 7 deletions
diff --git a/sql-common/client.c b/sql-common/client.c
index 404d9c8cb17..e03f5236fef 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -918,7 +918,8 @@ void free_old_query(MYSQL *mysql)
DBUG_ENTER("free_old_query");
if (mysql->fields)
free_root(&mysql->field_alloc,MYF(0));
- init_alloc_root(&mysql->field_alloc,8192,0); /* Assume rowlength < 8192 */
+ /* Assume rowlength < 8192 */
+ init_alloc_root(&mysql->field_alloc, 8192, 0, MYF(MY_THREAD_SPECIFIC));
mysql->fields= 0;
mysql->field_count= 0; /* For API */
mysql->warning_count= 0;
@@ -1199,7 +1200,7 @@ static int add_init_command(struct st_mysql_options *options, const char *cmd)
{
options->init_commands= (DYNAMIC_ARRAY*)my_malloc(sizeof(DYNAMIC_ARRAY),
MYF(MY_WME));
- init_dynamic_array(options->init_commands,sizeof(char*),5,5);
+ my_init_dynamic_array(options->init_commands,sizeof(char*),5, 5, MYF(0));
}
if (!(tmp= my_strdup(cmd,MYF(MY_WME))) ||
@@ -1609,7 +1610,8 @@ MYSQL_DATA *cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
set_mysql_error(mysql, CR_OUT_OF_MEMORY, unknown_sqlstate);
DBUG_RETURN(0);
}
- init_alloc_root(&result->alloc,8192,0); /* Assume rowlength < 8192 */
+ /* Assume rowlength < 8192 */
+ init_alloc_root(&result->alloc, 8192, 0, MYF(MY_THREAD_SPECIFIC));
result->alloc.min_malloc=sizeof(MYSQL_ROWS);
prev_ptr= &result->data;
result->rows=0;
@@ -3337,7 +3339,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
if (mysql->options.extension && mysql->options.extension->async_context)
net->vio->async_context= mysql->options.extension->async_context;
- if (my_net_init(net, net->vio))
+ if (my_net_init(net, net->vio, MYF(0)))
{
vio_delete(net->vio);
net->vio = 0;
@@ -4511,8 +4513,8 @@ static int old_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
DBUG_RETURN(CR_SERVER_HANDSHAKE_ERR);
/* save it in MYSQL */
- memmove(mysql->scramble, pkt, pkt_len);
- mysql->scramble[pkt_len] = 0;
+ memmove(mysql->scramble, pkt, pkt_len - 1);
+ mysql->scramble[pkt_len - 1] = 0;
}
if (mysql->passwd[0])
diff --git a/sql-common/client_plugin.c b/sql-common/client_plugin.c
index b8857cbe8bb..063fc5c6dc6 100644
--- a/sql-common/client_plugin.c
+++ b/sql-common/client_plugin.c
@@ -251,7 +251,7 @@ int mysql_client_plugin_init()
bzero(&mysql, sizeof(mysql)); /* dummy mysql for set_mysql_extended_error */
mysql_mutex_init(0, &LOCK_load_client_plugin, MY_MUTEX_INIT_SLOW);
- init_alloc_root(&mem_root, 128, 128);
+ init_alloc_root(&mem_root, 128, 128, MYF(0));
bzero(&plugin_list, sizeof(plugin_list));