summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.in12
-rw-r--r--include/my_global.h8
-rw-r--r--mysql-test/include/have_query_cache.inc4
-rw-r--r--mysql-test/r/flush.result5
-rw-r--r--mysql-test/r/have_query_cache.require2
-rw-r--r--mysql-test/t/flush.test8
-rw-r--r--mysql-test/t/grant_cache.test2
-rw-r--r--mysql-test/t/query_cache.test2
-rw-r--r--sql/ha_myisammrg.cc2
-rw-r--r--sql/handler.cc2
-rw-r--r--sql/mysql_priv.h26
-rw-r--r--sql/mysqld.cc29
-rw-r--r--sql/net_serv.cc4
-rw-r--r--sql/sql_cache.cc3
-rw-r--r--sql/sql_class.cc10
-rw-r--r--sql/sql_db.cc2
-rw-r--r--sql/sql_delete.cc6
-rw-r--r--sql/sql_insert.cc10
-rw-r--r--sql/sql_parse.cc12
-rw-r--r--sql/sql_table.cc4
-rw-r--r--sql/sql_update.cc4
21 files changed, 114 insertions, 43 deletions
diff --git a/configure.in b/configure.in
index 3fe235693e9..8794f0fb884 100644
--- a/configure.in
+++ b/configure.in
@@ -1797,6 +1797,18 @@ AC_ARG_WITH(embedded-server,
[with_embedded_server=no]
)
+AC_ARG_WITH(query_cache,
+ [ --without-query-cache Don't build query cache in embedded server.],
+ [with_embedded_server=$withval],
+ [with_embedded_server=yes]
+)
+
+if test "$with_embedded_server" = "yes"
+then
+ CFLAGS="$CFLAGS -DHAVE_QUERY_CACHE"
+ CXXFLAGS="$CXXFLAGS -DHAVE_QUERY_CACHE"
+fi
+
AC_ARG_WITH(extra-tools,
[ --without-extra-tools Skip building utilites in the tools directory.],
[with_tools=$withval],
diff --git a/include/my_global.h b/include/my_global.h
index 01910eb1342..2c9f16aca59 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -1023,4 +1023,12 @@ typedef union {
#define C_MODE_END
#endif
+/*
+ Now if query is taken off then tests with query cache fails
+ SANJA TODO: remove this when problem with mysql-test will be solved
+*/
+#ifdef MYSQL_SERVER
+#define HAVE_QUERY_CACHE
+#endif
+
#endif /* _global_h */
diff --git a/mysql-test/include/have_query_cache.inc b/mysql-test/include/have_query_cache.inc
new file mode 100644
index 00000000000..e5e6052c9a7
--- /dev/null
+++ b/mysql-test/include/have_query_cache.inc
@@ -0,0 +1,4 @@
+-- require r/have_query_cache.require
+disable_query_log;
+show variables like "have_query_cache";
+enable_query_log;
diff --git a/mysql-test/r/flush.result b/mysql-test/r/flush.result
index a7f73a6840b..7080f2b6145 100644
--- a/mysql-test/r/flush.result
+++ b/mysql-test/r/flush.result
@@ -28,8 +28,3 @@ select * from t1;
n
345
drop table t1;
-flush query cache;
-reset query cache;
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 0
diff --git a/mysql-test/r/have_query_cache.require b/mysql-test/r/have_query_cache.require
new file mode 100644
index 00000000000..312d837fed3
--- /dev/null
+++ b/mysql-test/r/have_query_cache.require
@@ -0,0 +1,2 @@
+Variable_name Value
+have_query_cache YES
diff --git a/mysql-test/t/flush.test b/mysql-test/t/flush.test
index 38aa37caa4f..540aa4235cc 100644
--- a/mysql-test/t/flush.test
+++ b/mysql-test/t/flush.test
@@ -67,11 +67,3 @@ insert into t1 values (345);
select * from t1;
drop table t1;
-#
-# Test that QUERY CACHE commands doesn't core dump.
-# (Normally we don't have a cache active at this point)
-#
-
-flush query cache;
-reset query cache;
-show status like "Qcache_queries_in_cache";
diff --git a/mysql-test/t/grant_cache.test b/mysql-test/t/grant_cache.test
index a6c878cc31c..09ce1021fbf 100644
--- a/mysql-test/t/grant_cache.test
+++ b/mysql-test/t/grant_cache.test
@@ -1,3 +1,5 @@
+-- source include/have_query_cache.inc
+
#
# Test grants with query cache
#
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index b4d00639587..a3227a5db1d 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -1,3 +1,5 @@
+-- source include/have_query_cache.inc
+
#
# Tests with query cache
#
diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc
index 42f8b807898..4e09c87f341 100644
--- a/sql/ha_myisammrg.cc
+++ b/sql/ha_myisammrg.cc
@@ -46,7 +46,7 @@ int ha_myisammrg::open(const char *name, int mode, uint test_if_locked)
return (my_errno ? my_errno : -1);
}
DBUG_PRINT("info", ("ha_myisammrg::open myrg_extrafunc..."))
- myrg_extrafunc(file, &query_cache_invalidate_by_MyISAM_filename);
+ myrg_extrafunc(file, query_cache_invalidate_by_MyISAM_filename_ref);
if (!(test_if_locked == HA_OPEN_WAIT_IF_LOCKED ||
test_if_locked == HA_OPEN_ABORT_IF_LOCKED))
myrg_extra(file,HA_EXTRA_NO_WAIT_LOCK);
diff --git a/sql/handler.cc b/sql/handler.cc
index 33b42c6c6b0..a89e53a5846 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -309,8 +309,10 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans)
}
#endif
+#ifdef HAVE_QUERY_CACHE
if (transaction_commited)
query_cache.invalidate(thd->transaction.changed_tables);
+#endif /*HAVE_QUERY_CACHE*/
if (error && trans == &thd->transaction.all && mysql_bin_log.is_open())
sql_print_error("Error: Got error during commit; Binlog is not up to date!");
thd->tx_isolation=thd->session_tx_isolation;
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 924f85b0a89..12249d2292c 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -251,7 +251,33 @@ inline THD *_current_thd(void)
#include "item.h"
#include "sql_class.h"
#include "opt_range.h"
+
+#ifdef HAVE_QUERY_CACHE
#include "sql_cache.h"
+#define query_cache_store_query(A, B) query_cache.store_query(A, B)
+#define query_cache_destroy() query_cache.destroy()
+#define query_cache_result_size_limit(A) query_cache.result_size_limit(A)
+#define query_cache_resize(A) query_cache.resize(A)
+#define query_cache_invalidate3(A, B, C) query_cache.invalidate(A, B, C)
+#define query_cache_invalidate1(A) query_cache.invalidate(A)
+#define query_cache_send_result_to_client(A, B, C) \
+ query_cache.send_result_to_client(A, B, C)
+#define query_cache_invalidate_by_MyISAM_filename_ref \
+ &query_cache_invalidate_by_MyISAM_filename
+#else
+#define query_cache_store_query(A, B)
+#define query_cache_destroy()
+#define query_cache_result_size_limit(A)
+#define query_cache_resize(A)
+#define query_cache_invalidate3(A, B, C)
+#define query_cache_invalidate1(A)
+#define query_cache_send_result_to_client(A, B, C) 0
+#define query_cache_invalidate_by_MyISAM_filename_ref NULL
+
+#define query_cache_abort(A)
+#define query_cache_end_of_result(A)
+#define query_cache_invalidate_by_MyISAM_filename_ref NULL
+#endif /*HAVE_QUERY_CACHE*/
int mysql_create_db(THD *thd, char *db, uint create_info, bool silent);
int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent);
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index d91d6c2ba5b..5927c65a81c 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -209,7 +209,11 @@ SHOW_COMP_OPTION have_openssl=SHOW_OPTION_YES;
SHOW_COMP_OPTION have_openssl=SHOW_OPTION_NO;
#endif
SHOW_COMP_OPTION have_symlink=SHOW_OPTION_YES;
-
+#ifdef HAVE_QUERY_CACHE
+SHOW_COMP_OPTION have_query_cache=SHOW_OPTION_YES;
+#else
+SHOW_COMP_OPTION have_query_cache=SHOW_OPTION_NO;
+#endif
bool opt_skip_slave_start = 0; // If set, slave is not autostarted
static bool opt_do_pstack = 0;
@@ -276,7 +280,11 @@ ulong keybuff_size,sortbuff_size,max_item_sort_length,table_cache_size,
ulong com_stat[(uint) SQLCOM_END], com_other;
ulong slave_net_timeout;
ulong thread_cache_size=0, binlog_cache_size=0, max_binlog_cache_size=0;
-ulong query_cache_size=0, query_cache_limit=0, query_cache_startup_type=1;
+#ifdef HAVE_QUERY_CACHE
+ulong query_cache_size=0, query_cache_limit=0, query_cache_startup_type=1;
+Query_cache query_cache;
+#endif
+
volatile ulong cached_thread_count=0;
// replication parameters, if master_host is not NULL, we are a slave
@@ -370,8 +378,6 @@ pthread_mutex_t LOCK_mysql_create_db, LOCK_Acl, LOCK_open, LOCK_thread_count,
LOCK_server_id,
LOCK_user_conn, LOCK_slave_list, LOCK_active_mi;
-Query_cache query_cache;
-
pthread_cond_t COND_refresh,COND_thread_count,COND_binlog_update,
COND_slave_stopped, COND_slave_start;
pthread_cond_t COND_thread_cache,COND_flush_thread_cache;
@@ -765,7 +771,7 @@ void clean_up(bool print_message)
bitmap_free(&slave_error_mask);
acl_free(1);
grant_free();
- query_cache.destroy();
+ query_cache_destroy();
table_cache_free();
hostname_cache_free();
item_user_lock_free();
@@ -1870,8 +1876,8 @@ int main(int argc, char **argv)
server_init();
table_cache_init();
hostname_cache_init();
- query_cache.result_size_limit(query_cache_limit);
- query_cache.resize(query_cache_size);
+ query_cache_result_size_limit(query_cache_limit);
+ query_cache_resize(query_cache_size);
randominit(&sql_rand,(ulong) start_time,(ulong) start_time/2);
reset_floating_point_exceptions();
init_thr_lock();
@@ -3001,12 +3007,14 @@ CHANGEABLE_VAR changeable_vars[] = {
0, 0, 65535, 0, 1},
{ "query_buffer_size", (long*) &query_buff_size,
0, MALLOC_OVERHEAD, (long) ~0, MALLOC_OVERHEAD, IO_SIZE },
+#ifdef HAVE_QUERY_CACHE
{ "query_cache_limit", (long*) &query_cache_limit,
1024*1024L, 0, ULONG_MAX, 0, 1},
{ "query_cache_size", (long*) &query_cache_size,
0, 0, ULONG_MAX, 0, 1},
{ "query_cache_startup_type",(long*) &query_cache_startup_type,
1, 0, 2, 0, 1},
+#endif /*HAVE_QUERY_CACHE*/
{ "record_buffer", (long*) &my_default_record_cache_size,
128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, ~0L, MALLOC_OVERHEAD, IO_SIZE },
{ "record_rnd_buffer", (long*) &record_rnd_cache_size,
@@ -3068,6 +3076,7 @@ struct show_var_st init_vars[]= {
{"have_raid", (char*) &have_raid, SHOW_HAVE},
{"have_symlink", (char*) &have_symlink, SHOW_HAVE},
{"have_openssl", (char*) &have_openssl, SHOW_HAVE},
+ {"have_query_cache", (char*) &have_query_cache, SHOW_HAVE},
{"init_file", (char*) &opt_init_file, SHOW_CHAR_PTR},
#ifdef HAVE_INNOBASE_DB
{"innodb_additional_mem_pool_size", (char*) &innobase_additional_mem_pool_size, SHOW_LONG },
@@ -3135,9 +3144,11 @@ struct show_var_st init_vars[]= {
{"record_rnd_buffer", (char*) &record_rnd_cache_size, SHOW_LONG},
{"rpl_recovery_rank", (char*) &rpl_recovery_rank, SHOW_LONG},
{"query_buffer_size", (char*) &query_buff_size, SHOW_LONG},
+#ifdef HAVE_QUERY_CACHE
{"query_cache_limit", (char*) &query_cache.query_cache_limit, SHOW_LONG},
{"query_cache_size", (char*) &query_cache.query_cache_size, SHOW_LONG},
{"query_cache_startup_type",(char*) &query_cache_startup_type, SHOW_LONG},
+#endif /*HAVE_QUERY_CACHE*/
{"safe_show_database", (char*) &opt_safe_show_db, SHOW_BOOL},
{"server_id", (char*) &server_id, SHOW_LONG},
{"slave_net_timeout", (char*) &slave_net_timeout, SHOW_LONG},
@@ -3268,6 +3279,7 @@ struct show_var_st status_vars[]= {
{"Open_streams", (char*) &my_stream_opened, SHOW_INT_CONST},
{"Opened_tables", (char*) &opened_tables, SHOW_LONG},
{"Questions", (char*) 0, SHOW_QUESTION},
+#ifdef HAVE_QUERY_CACHE
{"Qcache_queries_in_cache", (char*) &query_cache.queries_in_cache, SHOW_LONG_CONST},
{"Qcache_inserts", (char*) &query_cache.inserts, SHOW_LONG},
{"Qcache_hits", (char*) &query_cache.hits, SHOW_LONG},
@@ -3278,6 +3290,7 @@ struct show_var_st status_vars[]= {
SHOW_LONG_CONST},
{"Qcache_total_blocks", (char*) &query_cache.total_blocks,
SHOW_LONG_CONST},
+#endif /*HAVE_QUERY_CACHE*/
{"Rpl_status", (char*) 0, SHOW_RPL_STATUS},
{"Select_full_join", (char*) &select_full_join_count, SHOW_LONG},
{"Select_full_range_join", (char*) &select_full_range_join_count, SHOW_LONG},
@@ -3883,7 +3896,9 @@ static void get_options(int argc,char **argv)
my_use_symdir=0;
have_symlink=SHOW_OPTION_DISABLED;
ha_open_options&= ~HA_OPEN_ABORT_IF_CRASHED;
+#ifdef HAVE_QUERY_CACHE
query_cache_size=0;
+#endif
break;
case (int) OPT_SAFE:
opt_specialflag|= SPECIAL_SAFE_MODE;
diff --git a/sql/net_serv.cc b/sql/net_serv.cc
index 811f36bd82e..9884adf9b46 100644
--- a/sql/net_serv.cc
+++ b/sql/net_serv.cc
@@ -329,10 +329,12 @@ net_real_write(NET *net,const char *packet,ulong len)
my_bool net_blocking = vio_is_blocking(net->vio);
DBUG_ENTER("net_real_write");
-#ifdef MYSQL_SERVER
+#ifdef MYSQL_SERVER
+#ifdef HAVE_QUERY_CACHE
if (net->query_cache_query != 0)
query_cache_insert(net, packet, len);
#endif
+#endif
if (net->error == 2)
DBUG_RETURN(-1); /* socket can't be used */
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index c610128bb88..588d60462b0 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -281,6 +281,7 @@ TODO list:
*/
#include "mysql_priv.h"
+#ifdef HAVE_QUERY_CACHE
#include <m_ctype.h>
#include <my_dir.h>
#include <hash.h>
@@ -3460,3 +3461,5 @@ err2:
}
#endif /* DBUG_OFF */
+
+#endif /*HAVE_QUERY_CACHE*/
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 810342c2bc3..fdb7825e344 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -122,10 +122,14 @@ THD::THD():user_time(0),fatal_error(0),last_insert_id_used(0),
server_id = ::server_id;
slave_net = 0;
log_pos = 0;
- server_status=SERVER_STATUS_AUTOCOMMIT;
+ server_status= SERVER_STATUS_AUTOCOMMIT;
update_lock_default= low_priority_updates ? TL_WRITE_LOW_PRIORITY : TL_WRITE;
- options=thd_startup_options;
- query_cache_type = (byte) query_cache_startup_type;
+ options= thd_startup_options;
+#ifdef HAVE_QUERY_CACHE
+ query_cache_type= (byte) query_cache_startup_type;
+#else
+ query_cache_type= 0; //Safety
+#endif
sql_mode=(uint) opt_sql_mode;
inactive_timeout=net_wait_timeout;
open_options=ha_open_options;
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index dd8ed634011..9f521ac5ffd 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -159,7 +159,7 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
if ((deleted=mysql_rm_known_files(thd, dirp, db, path,0)) >= 0 && thd)
{
ha_drop_database(path);
- query_cache.invalidate(db);
+ query_cache_invalidate1(db);
if (!silent)
{
if (!thd->query)
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index a0076c04020..89e30f31fd5 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -182,7 +182,7 @@ cleanup:
thd->lock=0;
}
if (deleted)
- query_cache.invalidate(thd, table_list, 1);
+ query_cache_invalidate3(thd, table_list, 1);
delete select;
if (error >= 0) // Fatal error
send_error(&thd->net,thd->killed ? ER_SERVER_SHUTDOWN: 0);
@@ -470,7 +470,7 @@ bool multi_delete::send_eof()
VOID(ha_autocommit_or_rollback(thd,error > 0));
}
if (deleted)
- query_cache.invalidate(thd, delete_tables, 1);
+ query_cache_invalidate3(thd, delete_tables, 1);
::send_ok(&thd->net,deleted);
return 0;
}
@@ -548,7 +548,7 @@ int mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
bzero((char*) &create_info,sizeof(create_info));
*fn_ext(path)=0; // Remove the .frm extension
error= ha_create_table(path,&create_info,1) ? -1 : 0;
- query_cache.invalidate(thd, table_list, 0);
+ query_cache_invalidate3(thd, table_list, 0);
if (!dont_send_ok)
{
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 13c2564a2a6..235adcc02c1 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -311,7 +311,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
}
thd->proc_info="end";
if (info.copied || info.deleted)
- query_cache.invalidate(thd, table_list, 1);
+ query_cache_invalidate3(thd, table_list, 1);
table->time_stamp=save_time_stamp; // Restore auto timestamp ptr
table->next_number_field=0;
thd->count_cuted_fields=0;
@@ -1217,7 +1217,7 @@ bool delayed_insert::handle_inserts(void)
sql_print_error("%s",thd.net.last_error);
goto err;
}
- query_cache.invalidate(&thd, table, 1);
+ query_cache_invalidate3(&thd, table, 1);
if (thr_reschedule_write_lock(*thd.lock->locks))
{
/* This should never happen */
@@ -1242,7 +1242,7 @@ bool delayed_insert::handle_inserts(void)
sql_print_error("%s",thd.net.last_error);
goto err;
}
- query_cache.invalidate(&thd, table, 1);
+ query_cache_invalidate3(&thd, table, 1);
pthread_mutex_lock(&mutex);
DBUG_RETURN(0);
@@ -1330,7 +1330,7 @@ void select_insert::send_error(uint errcode,const char *err)
table->file->activate_all_index(thd);
ha_rollback_stmt(thd);
if (info.copied || info.deleted)
- query_cache.invalidate(thd, table, 1);
+ query_cache_invalidate3(thd, table, 1);
}
@@ -1343,7 +1343,7 @@ bool select_insert::send_eof()
if ((error2=ha_autocommit_or_rollback(thd,error)) && ! error)
error=error2;
if (info.copied || info.deleted)
- query_cache.invalidate(thd, table, 1);
+ query_cache_invalidate3(thd, table, 1);
if (error)
{
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 8528a7f4ecb..7f4553459f1 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1310,7 +1310,7 @@ mysql_execute_command(void)
if (!(res=open_and_lock_tables(thd,tables)))
{
- query_cache.store_query(thd, tables);
+ query_cache_store_query(thd, tables);
res=handle_select(thd, lex, result);
}
else
@@ -1630,7 +1630,7 @@ mysql_execute_command(void)
goto error;
}
}
- query_cache.invalidate(thd, tables, 0);
+ query_cache_invalidate3(thd, tables, 0);
if (end_active_trans(thd))
res= -1;
else if (mysql_rename_tables(thd,tables))
@@ -1669,7 +1669,7 @@ mysql_execute_command(void)
check_table_access(thd,SELECT_ACL | INSERT_ACL, tables))
goto error; /* purecov: inspected */
res = mysql_repair_table(thd, tables, &lex->check_opt);
- query_cache.invalidate(thd, tables, 0);
+ query_cache_invalidate3(thd, tables, 0);
break;
}
case SQLCOM_CHECK:
@@ -1678,7 +1678,7 @@ mysql_execute_command(void)
check_table_access(thd, SELECT_ACL | EXTRA_ACL , tables))
goto error; /* purecov: inspected */
res = mysql_check_table(thd, tables, &lex->check_opt);
- query_cache.invalidate(thd, tables, 0);
+ query_cache_invalidate3(thd, tables, 0);
break;
}
case SQLCOM_ANALYZE:
@@ -2722,7 +2722,7 @@ mysql_parse(THD *thd,char *inBuf,uint length)
mysql_init_query(thd);
thd->query_length = length;
- if (query_cache.send_result_to_client(thd, inBuf, length) <= 0)
+ if (query_cache_send_result_to_client(thd, inBuf, length) <= 0)
{
LEX *lex=lex_start(thd, (uchar*) inBuf, length);
if (!yyparse() && ! thd->fatal_error)
@@ -3282,6 +3282,7 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables)
if (ha_flush_logs())
result=1;
}
+#ifdef HAVE_QUERY_CACHE
if (options & REFRESH_QUERY_CACHE_FREE)
{
query_cache.pack(); // FLUSH QUERY CACHE
@@ -3291,6 +3292,7 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables)
{
query_cache.flush(); // RESET QUERY CACHE
}
+#endif /*HAVE_QUERY_CACHE*/
if (options & (REFRESH_TABLES | REFRESH_READ_LOCK))
{
if ((options & REFRESH_READ_LOCK) && thd)
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 6ec02e1216f..691ab7b5fe0 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -161,7 +161,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
}
if (some_tables_deleted)
{
- query_cache.invalidate(thd, tables, 0);
+ query_cache_invalidate3(thd, tables, 0);
if (!dont_log_query)
{
mysql_update_log.write(thd, thd->query,thd->query_length);
@@ -1774,7 +1774,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
VOID(pthread_cond_broadcast(&COND_refresh));
VOID(pthread_mutex_unlock(&LOCK_open));
table_list->table=0; // For query cache
- query_cache.invalidate(thd, table_list, 0);
+ query_cache_invalidate3(thd, table_list, 0);
end_temporary:
sprintf(tmp_name,ER(ER_INSERT_INFO),(ulong) (copied+deleted),
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index a9eb6cef6a6..db520af61c1 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -324,7 +324,7 @@ int mysql_update(THD *thd,
thd->lock=0;
}
if (updated)
- query_cache.invalidate(thd, table_list, 1);
+ query_cache_invalidate3(thd, table_list, 1);
delete select;
if (error >= 0)
@@ -788,7 +788,7 @@ bool multi_update::send_eof()
sprintf(buff,ER(ER_UPDATE_INFO), (long) found, (long) updated,
(long) thd->cuted_fields);
if (updated)
- query_cache.invalidate(thd, update_tables, 1);
+ query_cache_invalidate3(thd, update_tables, 1);
::send_ok(&thd->net,
(thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated,