Commit 5b29f59a authored by monty@mysql.com's avatar monty@mysql.com

Fixed access to freed memory

parent 3493f54a
...@@ -881,8 +881,6 @@ srv_general_init(void) ...@@ -881,8 +881,6 @@ srv_general_init(void)
/*======================= InnoDB Server FIFO queue =======================*/ /*======================= InnoDB Server FIFO queue =======================*/
/* Maximum allowable purge history length. <=0 means 'infinite'. */
ulint srv_max_purge_lag = 0;
/************************************************************************* /*************************************************************************
Puts an OS thread to wait if there are too many concurrent threads Puts an OS thread to wait if there are too many concurrent threads
......
...@@ -358,8 +358,6 @@ sys_var_thd_bool sys_innodb_table_locks("innodb_table_locks", ...@@ -358,8 +358,6 @@ sys_var_thd_bool sys_innodb_table_locks("innodb_table_locks",
&SV::innodb_table_locks); &SV::innodb_table_locks);
sys_var_long_ptr sys_innodb_autoextend_increment("innodb_autoextend_increment", sys_var_long_ptr sys_innodb_autoextend_increment("innodb_autoextend_increment",
&srv_auto_extend_increment); &srv_auto_extend_increment);
sys_var_long_ptr sys_innodb_max_purge_lag("innodb_max_purge_lag",
&srv_max_purge_lag);
#endif #endif
/* Time/date/datetime formats */ /* Time/date/datetime formats */
......
...@@ -1037,9 +1037,9 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) ...@@ -1037,9 +1037,9 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
*/ */
for (tmptable= thd->temporary_tables; tmptable ; tmptable= tmptable->next) for (tmptable= thd->temporary_tables; tmptable ; tmptable= tmptable->next)
{ {
if (tmptable->key_length - TMP_TABLE_KEY_EXTRA == table->key_len() && if (tmptable->key_length - TMP_TABLE_KEY_EXTRA == table->key_length() &&
!memcmp(tmptable->table_cache_key, table->data(), !memcmp(tmptable->table_cache_key, table->data(),
table->key_len())) table->key_length()))
{ {
DBUG_PRINT("qcache", DBUG_PRINT("qcache",
("Temporary table detected: '%s.%s'", ("Temporary table detected: '%s.%s'",
...@@ -1050,7 +1050,7 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) ...@@ -1050,7 +1050,7 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
temporary tables => assign following variable to make check temporary tables => assign following variable to make check
faster. faster.
*/ */
thd->safe_to_cache_query=0; thd->lex->safe_to_cache_query=0;
BLOCK_UNLOCK_RD(query_block); BLOCK_UNLOCK_RD(query_block);
DBUG_RETURN(-1); DBUG_RETURN(-1);
} }
......
...@@ -1681,9 +1681,10 @@ bool select_create::send_eof() ...@@ -1681,9 +1681,10 @@ bool select_create::send_eof()
*/ */
if (!table->tmp_table) if (!table->tmp_table)
{ {
ulong version= table->version;
hash_delete(&open_cache,(byte*) table); hash_delete(&open_cache,(byte*) table);
/* Tell threads waiting for refresh that something has happened */ /* Tell threads waiting for refresh that something has happened */
if (table->version != refresh_version) if (version != refresh_version)
VOID(pthread_cond_broadcast(&COND_refresh)); VOID(pthread_cond_broadcast(&COND_refresh));
} }
lock=0; lock=0;
...@@ -1707,11 +1708,12 @@ void select_create::abort() ...@@ -1707,11 +1708,12 @@ void select_create::abort()
enum db_type table_type=table->db_type; enum db_type table_type=table->db_type;
if (!table->tmp_table) if (!table->tmp_table)
{ {
ulong version= table->version;
hash_delete(&open_cache,(byte*) table); hash_delete(&open_cache,(byte*) table);
if (!create_info->table_existed) if (!create_info->table_existed)
quick_rm_table(table_type, db, name); quick_rm_table(table_type, db, name);
/* Tell threads waiting for refresh that something has happened */ /* Tell threads waiting for refresh that something has happened */
if (table->version != refresh_version) if (version != refresh_version)
VOID(pthread_cond_broadcast(&COND_refresh)); VOID(pthread_cond_broadcast(&COND_refresh));
} }
else if (!create_info->table_existed) else if (!create_info->table_existed)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment