diff options
author | unknown <knielsen@knielsen-hq.org> | 2011-04-01 15:07:10 +0200 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2011-04-01 15:07:10 +0200 |
commit | c677fea7d01ef1fab3357496b309a3e3b3c00dfe (patch) | |
tree | b6000be3447e5a41440cffee8b8d927d37a1dcde /sql/sql_insert.cc | |
parent | 09bd2894973fbdbacec9bfc31a3635165b120200 (diff) | |
parent | 9aa44bb4b3e0fc69306626b961c7d9309e6ab114 (diff) | |
download | mariadb-git-c677fea7d01ef1fab3357496b309a3e3b3c00dfe.tar.gz |
Merge MariaDB 5.2.5 release into MariaDB-5.2-rpl.
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r-- | sql/sql_insert.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 48105cf9f3c..2b5e54e6d0d 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -2077,6 +2077,7 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd) TABLE *copy; TABLE_SHARE *share; uchar *bitmap; + char *copy_tmp; DBUG_ENTER("Delayed_insert::get_local_table"); /* First request insert thread to get a lock */ @@ -2109,14 +2110,15 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd) the other record buffers and alignment are unnecessary. */ thd_proc_info(client_thd, "allocating local table"); - copy= (TABLE*) client_thd->alloc(sizeof(*copy)+ - (share->fields+1)*sizeof(Field**)+ - share->reclength + - share->column_bitmap_size*3); - if (!copy) + copy_tmp= (char*) client_thd->alloc(sizeof(*copy)+ + (share->fields+1)*sizeof(Field**)+ + share->reclength + + share->column_bitmap_size*3); + if (!copy_tmp) goto error; /* Copy the TABLE object. */ + copy= new (copy_tmp) TABLE; *copy= *table; /* We don't need to change the file handler here */ /* Assign the pointers for the field pointers array and the record. */ @@ -3505,7 +3507,7 @@ int select_create::write_to_binlog(bool is_trans, int errcode) Avoid to use thd->binlog_query() twice, otherwise it will print the unsafe warning twice. */ - Query_log_event ev(thd, query.c_ptr_safe(), query.length(), is_trans, + Query_log_event ev(thd, query.ptr(), query.length(), is_trans, FALSE, errcode); return mysql_bin_log.write(&ev); } |