Commit 03bc5997 authored by unknown's avatar unknown
Browse files

Merge of query cache from 4.1 to 5.0


mysql-test/r/ndb_cache.result:
  Added 'order by' to select's
mysql-test/r/ndb_cache2.result:
  Added 'order by' to select's
mysql-test/t/ndb_cache.test:
  Added 'order by' to select's
mysql-test/t/ndb_cache2.test:
  Added 'order by' to select's
sql/ha_innodb.h:
  Changed function name
sql/ha_ndbcluster.cc:
  Merge from query cache from 4.1 to 5.0
  Added better comments
  ndb_get_table_statistics had changed, so there where some adaptions to make
sql/ha_ndbcluster.h:
  Changed name of function
sql/handler.h:
  Changed name of function
sql/sql_cache.cc:
  Changed name of function
parent 2b0a3dbe
Loading
Loading
Loading
Loading
+13 −13
Original line number Diff line number Diff line
@@ -36,22 +36,22 @@ Variable_name Value
Qcache_hits	1
insert into t1 value (2, 7, 8, 'Second row');
insert into t1 value (4, 5, 6, 'Fourth row');
select * from t1;
select * from t1 order by pk;
pk	a	b	c
1	3	3	First row
2	7	8	Second row
4	5	6	Fourth row
1	3	3	First row
show status like "Qcache_inserts";
Variable_name	Value
Qcache_inserts	3
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	1
select * from t1;
select * from t1 order by pk;
pk	a	b	c
1	3	3	First row
2	7	8	Second row
4	5	6	Fourth row
1	3	3	First row
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	2
@@ -81,10 +81,10 @@ show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	3
use test;
select * from t1;
select * from t1 order by pk;
pk	a	b	c
2	7	8	Second row
1	3	3	First row
2	7	8	Second row
select * from t1 where b=3;
pk	a	b	c
1	3	3	First row
@@ -96,11 +96,11 @@ use test;
show status like "Qcache_queries_in_cache";
Variable_name	Value
Qcache_queries_in_cache	0
select * from t1;
select * from t1 order by pk desc;
pk	a	b	c
2	7	8	Second row
1	4	3	First row
select * from t1;
select * from t1 order by pk desc;
pk	a	b	c
2	7	8	Second row
1	4	3	First row
@@ -110,11 +110,11 @@ Qcache_inserts 7
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	5
select * from t1;
select * from t1 order by pk desc;
pk	a	b	c
2	7	8	Second row
1	4	3	First row
select * from t1;
select * from t1 order by pk desc;
pk	a	b	c
2	7	8	Second row
1	4	3	First row
@@ -138,7 +138,7 @@ Qcache_inserts 7
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	7
select * from t1;
select * from t1 order by pk desc;
pk	a	b	c
2	7	8	Second row
1	4	3	First row
@@ -161,7 +161,7 @@ Qcache_inserts 8
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	7
select * from t1;
select * from t1 order by pk desc;
pk	a	b	c
2	7	8	Second row
1	5	3	First row
@@ -171,7 +171,7 @@ Qcache_inserts 9
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	7
select * from t1;
select * from t1 order by pk desc;
pk	a	b	c
2	7	8	Second row
1	5	3	First row
+12 −12
Original line number Diff line number Diff line
@@ -37,10 +37,10 @@ Variable_name Value
Qcache_hits	1
insert into t1 value (2, 7, 8, 'Second row');
insert into t1 value (4, 5, 6, 'Fourth row');
select * from t1;
select * from t1 order by pk desc;
pk	a	b	c
2	7	8	Second row
4	5	6	Fourth row
2	7	8	Second row
1	3	3	First row
show status like "Qcache_inserts";
Variable_name	Value
@@ -48,10 +48,10 @@ Qcache_inserts 3
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	1
select * from t1;
select * from t1 order by pk desc;
pk	a	b	c
2	7	8	Second row
4	5	6	Fourth row
2	7	8	Second row
1	3	3	First row
show status like "Qcache_hits";
Variable_name	Value
@@ -82,7 +82,7 @@ show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	3
use test;
select * from t1;
select * from t1 order by pk desc;
pk	a	b	c
2	7	8	Second row
1	3	3	First row
@@ -97,11 +97,11 @@ use test;
show status like "Qcache_queries_in_cache";
Variable_name	Value
Qcache_queries_in_cache	0
select * from t1;
select * from t1 order by pk desc;
pk	a	b	c
2	7	8	Second row
1	4	3	First row
select * from t1;
select * from t1 order by pk desc;
pk	a	b	c
2	7	8	Second row
1	4	3	First row
@@ -111,11 +111,11 @@ Qcache_inserts 7
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	5
select * from t1;
select * from t1 order by pk desc;
pk	a	b	c
2	7	8	Second row
1	4	3	First row
select * from t1;
select * from t1 order by pk desc;
pk	a	b	c
2	7	8	Second row
1	4	3	First row
@@ -139,7 +139,7 @@ Qcache_inserts 7
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	7
select * from t1;
select * from t1 order by pk desc;
pk	a	b	c
2	7	8	Second row
1	4	3	First row
@@ -162,7 +162,7 @@ Qcache_inserts 8
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	7
select * from t1;
select * from t1 order by pk desc;
pk	a	b	c
2	7	8	Second row
1	5	3	First row
@@ -172,7 +172,7 @@ Qcache_inserts 9
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	7
select * from t1;
select * from t1 order by pk desc;
pk	a	b	c
2	7	8	Second row
1	5	3	First row
+10 −10
Original line number Diff line number Diff line
@@ -35,10 +35,10 @@ show status like "Qcache_hits";
# Insert a new record and make sure the correct data is returned
insert into t1 value (2, 7, 8, 'Second row');
insert into t1 value (4, 5, 6, 'Fourth row');
select * from t1;
select * from t1 order by pk;
show status like "Qcache_inserts";
show status like "Qcache_hits";
select * from t1;
select * from t1 order by pk;
show status like "Qcache_hits";

# Perform a "new" query and make sure the query cache is not hit
@@ -60,7 +60,7 @@ show status like "Qcache_hits";
connect (con1,localhost,root,,);
connection con1;
use test;
select * from t1;
select * from t1 order by pk;
select * from t1 where b=3;
show status like "Qcache_hits";

@@ -70,13 +70,13 @@ connect (con2,localhost,root,,);
connection con2;
use test;
show status like "Qcache_queries_in_cache";
select * from t1;
select * from t1;
select * from t1 order by pk desc;
select * from t1 order by pk desc;
show status like "Qcache_inserts";
show status like "Qcache_hits";
connection con1;
select * from t1;
select * from t1;
select * from t1 order by pk desc;
select * from t1 order by pk desc;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
@@ -92,7 +92,7 @@ show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
connection con2;
select * from t1;
select * from t1 order by pk desc;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
@@ -103,11 +103,11 @@ show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
connection con2;
select * from t1;
select * from t1 order by pk desc;
show status like "Qcache_inserts";
show status like "Qcache_hits";
connection con1;
select * from t1;
select * from t1 order by pk desc;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
+10 −10
Original line number Diff line number Diff line
@@ -41,10 +41,10 @@ show status like "Qcache_hits";
# Insert a new record and make sure the correct data is returned
insert into t1 value (2, 7, 8, 'Second row');
insert into t1 value (4, 5, 6, 'Fourth row');
select * from t1;
select * from t1 order by pk desc;
show status like "Qcache_inserts";
show status like "Qcache_hits";
select * from t1;
select * from t1 order by pk desc;
show status like "Qcache_hits";

# Perform a "new" query and make sure the query cache is not hit
@@ -66,7 +66,7 @@ show status like "Qcache_hits";
connect (con1,localhost,root,,);
connection con1;
use test;
select * from t1;
select * from t1 order by pk desc;
select * from t1 where b=3;
show status like "Qcache_hits";

@@ -76,13 +76,13 @@ connect (con2,localhost,root,,);
connection con2;
use test;
show status like "Qcache_queries_in_cache";
select * from t1;
select * from t1;
select * from t1 order by pk desc;
select * from t1 order by pk desc;
show status like "Qcache_inserts";
show status like "Qcache_hits";
connection con1;
select * from t1;
select * from t1;
select * from t1 order by pk desc;
select * from t1 order by pk desc;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
@@ -95,7 +95,7 @@ show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
connection con2;
select * from t1;
select * from t1 order by pk desc;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
@@ -107,11 +107,11 @@ show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
connection con2;
select * from t1;
select * from t1 order by pk desc;
show status like "Qcache_inserts";
show status like "Qcache_hits";
connection con1;
select * from t1;
select * from t1 order by pk desc;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
+4 −4
Original line number Diff line number Diff line
@@ -180,7 +180,7 @@ class ha_innobase: public handler
        /*
          ask handler about permission to cache table during query registration
        */
        my_bool cached_table_registration(THD *thd, char *table_key,
        my_bool register_query_cache_table(THD *thd, char *table_key,
					   uint key_length,
					   qc_engine_callback *call_back,
					   ulonglong *engine_data)
Loading