From ea646dce60994b8a5d36d575ed371144cd01eeb3 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 May 2004 11:22:10 +0300 Subject: avoid using ndb tables in query cache sql/ha_ndbcluster.h: fixed layout prohibit using query cache with ndb tables sql/handler.h: new caching type sql/sql_cache.cc: support of new caching type (caching prohibited) --- sql/sql_cache.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sql/sql_cache.cc') diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index e1a15eff475..f17f4bb2b7f 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -2614,12 +2614,14 @@ TABLE_COUNTER_TYPE Query_cache::is_cacheable(THD *thd, uint32 query_len, */ if (tables_used->table->db_type == DB_TYPE_MRG_ISAM || tables_used->table->tmp_table != NO_TMP_TABLE || + (*tables_type & HA_CACHE_TBL_NOCACHE) || (tables_used->db_length == 5 && my_strnncoll(table_alias_charset, (uchar*)tables_used->db, 6, (uchar*)"mysql",6) == 0)) { DBUG_PRINT("qcache", - ("select not cacheable: used MRG_ISAM, temporary or system table(s)")); + ("select not cacheable: used MRG_ISAM, temporary, \ +system or other non-cacheable table(s)")); DBUG_RETURN(0); } if (tables_used->table->db_type == DB_TYPE_MRG_MYISAM) -- cgit v1.2.1 From f6428e8bb9ac0cad24465513c5969a50cd13f6f2 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 May 2004 21:21:41 +0300 Subject: caching of queries with isammerge tables forbiden using general way SQL_SELECT_LIMIT as default will be applied only for SELECT statement if there was not explicit LIMIT clause correct table list passed to class constructor of select_update mysql-test/r/subselect.result: do not show limit if it is not explicit mysql-test/r/union.result: test of LIMIT + ORDER mysql-test/t/union.test: test of LIMIT + ORDER sql/ha_isammrg.h: caching of queries with isammerge tables forbiden sql/sql_cache.cc: removed check on isammerge sql/sql_lex.cc: tag of explicit limit in statement sql/sql_lex.h: tag of explicit limit in statement sql/sql_parse.cc: blanks in empty line removed no limit by default (SQL_SELECT_LIMIT as default will be applied only for SELECT statement if there was not explicit LIMIT clause) sql/sql_union.cc: reverted incorrect patch sql/sql_update.cc: reverted incorrect patch correct table list passed to class constructor sql/sql_yacc.yy: explicit LIMIT marked --- sql/sql_cache.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sql/sql_cache.cc') diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index f17f4bb2b7f..359150cf716 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -2612,16 +2612,15 @@ TABLE_COUNTER_TYPE Query_cache::is_cacheable(THD *thd, uint32 query_len, table_alias_charset used here because it depends of lower_case_table_names variable */ - if (tables_used->table->db_type == DB_TYPE_MRG_ISAM || - tables_used->table->tmp_table != NO_TMP_TABLE || + if (tables_used->table->tmp_table != NO_TMP_TABLE || (*tables_type & HA_CACHE_TBL_NOCACHE) || (tables_used->db_length == 5 && my_strnncoll(table_alias_charset, (uchar*)tables_used->db, 6, (uchar*)"mysql",6) == 0)) { DBUG_PRINT("qcache", - ("select not cacheable: used MRG_ISAM, temporary, \ -system or other non-cacheable table(s)")); + ("select not cacheable: temporary, system or \ +other non-cacheable table(s)")); DBUG_RETURN(0); } if (tables_used->table->db_type == DB_TYPE_MRG_MYISAM) -- cgit v1.2.1 From 526569690e1d0d89d91359df1334b2ffba204a02 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 May 2004 19:55:12 +0200 Subject: Fixed (portability) bug in handler.h, and tried to silence cast warnings on some platforms. sql/handler.h: Fixed (portability) bug. No qualified method names in the class definition. sql/item_cmpfunc.h: Attempt to silence cast warnings on some platforms. sql/item_subselect.h: Attempt to silence cast warnings on some platforms. sql/set_var.cc: Silence warning (missing cast). sql/spatial.h: Attempt to silence cast warnings on some platforms. sql/sql_cache.cc: Silence warning (wrong cast). sql/sql_lex.h: Attempt to silence cast warnings on some platforms. --- sql/sql_cache.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/sql_cache.cc') diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 359150cf716..d7d4219c7fd 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -661,7 +661,7 @@ void query_cache_end_of_result(THD *thd) if (thd->net.query_cache_query != 0) // Quick check on unlocked structure { #ifdef EMBEDDED_LIBRARY - query_cache_insert(&thd->net, (byte*)thd, + query_cache_insert(&thd->net, (char*)thd, emb_count_querycache_size(thd)); #endif STRUCT_LOCK(&query_cache.structure_guard_mutex); -- cgit v1.2.1