List:Internals« Previous MessageNext Message »
From:sanja Date:November 22 2005 9:15am
Subject:bk commit into 5.0 tree (bell:1.1988) BUG#14652
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of bell. When bell does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.1988 05/11/22 11:15:49 bell@stripped +3 -0
  We should not skipp temptable view with other derived tables during query tables registration. (BUG#14652)

  sql/sql_cache.cc
    1.87 05/11/22 11:15:45 bell@stripped +1 -1
    We should not skipp temptable view with other derived tables during query tables registration.

  mysql-test/t/view_query_cache.test
    1.4 05/11/22 11:15:45 bell@stripped +31 -0
    Tests for temptable views in the query cache.

  mysql-test/r/view_query_cache.result
    1.4 05/11/22 11:15:45 bell@stripped +61 -0
    Tests for temptable views in the query cache.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	bell
# Host:	sanja.is.com.ua
# Root:	/home/bell/mysql/bk/work-bug5-5.0

--- 1.86/sql/sql_cache.cc	2005-10-28 00:24:03 +03:00
+++ 1.87/sql/sql_cache.cc	2005-11-22 11:15:45 +02:00
@@ -2184,7 +2184,7 @@
        tables_used;
        tables_used= tables_used->next_global, n++, block_table++)
   {
-    if (tables_used->derived)
+    if (tables_used->derived && !tables_used->view)
     {
       DBUG_PRINT("qcache", ("derived table skipped"));
       n--;

--- 1.3/mysql-test/r/view_query_cache.result	2005-09-26 17:59:48 +03:00
+++ 1.4/mysql-test/r/view_query_cache.result	2005-11-22 11:15:45 +02:00
@@ -132,4 +132,65 @@
 set query_cache_wlock_invalidate=default;
 drop view v1;
 drop table t1;
+flush status;
+create table t1 (a int, b int);
+create algorithm=temptable view v1 as select * from t1;
+select * from v1;
+a	b
+show status like "Qcache_queries_in_cache";
+Variable_name	Value
+Qcache_queries_in_cache	1
+show status like "Qcache_inserts";
+Variable_name	Value
+Qcache_inserts	1
+show status like "Qcache_hits";
+Variable_name	Value
+Qcache_hits	0
+select * from v1;
+a	b
+show status like "Qcache_queries_in_cache";
+Variable_name	Value
+Qcache_queries_in_cache	1
+show status like "Qcache_inserts";
+Variable_name	Value
+Qcache_inserts	1
+show status like "Qcache_hits";
+Variable_name	Value
+Qcache_hits	1
+insert into t1 values (1,1);
+show status like "Qcache_queries_in_cache";
+Variable_name	Value
+Qcache_queries_in_cache	0
+show status like "Qcache_inserts";
+Variable_name	Value
+Qcache_inserts	1
+show status like "Qcache_hits";
+Variable_name	Value
+Qcache_hits	1
+select * from v1;
+a	b
+1	1
+select * from v1;
+a	b
+1	1
+show status like "Qcache_queries_in_cache";
+Variable_name	Value
+Qcache_queries_in_cache	1
+show status like "Qcache_inserts";
+Variable_name	Value
+Qcache_inserts	2
+show status like "Qcache_hits";
+Variable_name	Value
+Qcache_hits	2
+drop view v1;
+show status like "Qcache_queries_in_cache";
+Variable_name	Value
+Qcache_queries_in_cache	0
+show status like "Qcache_inserts";
+Variable_name	Value
+Qcache_inserts	2
+show status like "Qcache_hits";
+Variable_name	Value
+Qcache_hits	2
+drop table t1;
 set GLOBAL query_cache_size=default;

--- 1.3/mysql-test/t/view_query_cache.test	2005-09-26 17:58:17 +03:00
+++ 1.4/mysql-test/t/view_query_cache.test	2005-11-22 11:15:45 +02:00
@@ -96,4 +96,35 @@
 set query_cache_wlock_invalidate=default;
 drop view v1;
 drop table t1;
+
+#
+# BUG#15119: returning temptable view from the query cache.
+#
+flush status;
+create table t1 (a int, b int);
+create algorithm=temptable view v1 as select * from t1;
+select * from v1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+select * from v1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+insert into t1 values (1,1);
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+select * from v1;
+select * from v1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+drop view v1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+drop table t1;
+
+# Reset default environment.
 set GLOBAL query_cache_size=default;
Thread
bk commit into 5.0 tree (bell:1.1988) BUG#14652sanja22 Nov