diff options
author | Michael Widenius <monty@askmonty.org> | 2011-02-28 13:16:17 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2011-02-28 13:16:17 +0200 |
commit | 869f5d0e81d5cbecaec3605f292fbb363b9ccbf6 (patch) | |
tree | 9e2bc4700a2db961d967e53f00c941f3ee501173 /sql/sql_insert.cc | |
parent | cfa0c6ff1d8f7268f895d79daf94e7d29197327d (diff) | |
parent | ff3da0f963b28d128005da8ca5d0c93a72d34b27 (diff) | |
download | mariadb-git-869f5d0e81d5cbecaec3605f292fbb363b9ccbf6.tar.gz |
Merge with alias as String
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 72ca7310ee1..81f658b6a77 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -2072,6 +2072,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 */ @@ -2104,14 +2105,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. */ @@ -3500,7 +3502,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); } |