diff options
author | Tatjana Azundris Nuernberg <tatjana.nuernberg@oracle.com> | 2011-10-19 03:42:09 +0100 |
---|---|---|
committer | Tatjana Azundris Nuernberg <tatjana.nuernberg@oracle.com> | 2011-10-19 03:42:09 +0100 |
commit | ec56c16c4b0bab67d7fdc77f7fc7532b83273499 (patch) | |
tree | 9488f4d1905fb8807377eca546652631ca21f4a2 /sql | |
parent | add59cfbaf7865ff8be3038197320e4eabd5767f (diff) | |
parent | 7d882c19ecad83af921dd7bd9d77f088da594ac0 (diff) | |
download | mariadb-git-ec56c16c4b0bab67d7fdc77f7fc7532b83273499.tar.gz |
Bug12589870 post merge fixes - manual merge
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sp_head.cc | 2 | ||||
-rw-r--r-- | sql/sql_cache.cc | 5 | ||||
-rw-r--r-- | sql/sql_parse.cc | 6 |
3 files changed, 8 insertions, 5 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 36eb50886f3..eb29590b700 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -1053,7 +1053,7 @@ subst_spvars(THD *thd, sp_instr *instr, LEX_STRING *query_str) { memcpy(pbuf, qbuf.ptr(), qbuf.length()); pbuf[qbuf.length()]= 0; - *(size_t *)(pbuf+qbuf.length()+1)= thd->db_length; + memcpy(pbuf+qbuf.length()+1, (char *) &thd->db_length, sizeof(size_t)); } else DBUG_RETURN(TRUE); diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index e8bc6160cfd..56ce6607c85 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -1515,8 +1515,9 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) sure the new current database has a name with the same length as the previous one. */ - size_t *db_len= (size_t *) (sql + query_length + 1); - if (thd->db_length != *db_len) + size_t db_len; + memcpy((char *) &db_len, (sql + query_length + 1), sizeof(size_t)); + if (thd->db_length != db_len) { /* We should probably reallocate the buffer in this case, diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 06113e87cb8..3b5b5df788e 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -536,6 +536,8 @@ static void handle_bootstrap_impl(THD *thd) query= (char *) thd->memdup_w_gap(buff, length + 1, thd->db_length + 1 + QUERY_CACHE_FLAGS_SIZE); + size_t db_len= 0; + memcpy(query + length + 1, (char *) &db_len, sizeof(size_t)); thd->set_query_and_id(query, length, thd->charset(), next_query_id()); DBUG_PRINT("query",("%-.4096s",thd->query())); #if defined(ENABLED_PROFILING) @@ -1658,8 +1660,8 @@ bool alloc_query(THD *thd, const char *packet, uint packet_length) also store this length, in case current database is changed during execution. We might need to reallocate the 'query' buffer */ - size_t *len = (size_t *) (query + packet_length + 1); - *len= thd->db_length; + char *len_pos = (query + packet_length + 1); + memcpy(len_pos, (char *) &thd->db_length, sizeof(size_t)); thd->set_query(query, packet_length); |