Commit 8a3e00a0 authored by igor@rurik.mysql.com's avatar igor@rurik.mysql.com

preload.result, key_cache.result, preload.test, key_cache.test, sql_yacc.yy:

  Fixed bug #2602 in CACHE INDEX, LOAD INDEX
parent d4d09768
...@@ -100,7 +100,7 @@ p i a ...@@ -100,7 +100,7 @@ p i a
4 3 zzzz 4 3 zzzz
update t1 set p=2 where p=1; update t1 set p=2 where p=1;
update t2 set i=2 where i=1; update t2 set i=2 where i=1;
cache index t1 keys (`primary`) in keycache1; cache index t1 key (`primary`) in keycache1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 assign_to_keycache status OK test.t1 assign_to_keycache status OK
explain select p from t1; explain select p from t1;
...@@ -177,7 +177,7 @@ yyyy ...@@ -177,7 +177,7 @@ yyyy
zzzz zzzz
cache index t1 in unknown_key_cache; cache index t1 in unknown_key_cache;
ERROR HY000: Unknown key cache 'unknown_key_cache' ERROR HY000: Unknown key cache 'unknown_key_cache'
cache index t1 keys (unknown_key) in keycache1; cache index t1 key (unknown_key) in keycache1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 assign_to_keycache error Key column 'unknown_key' doesn't exist in table test.t1 assign_to_keycache error Key column 'unknown_key' doesn't exist in table
test.t1 assign_to_keycache status Operation failed test.t1 assign_to_keycache status Operation failed
......
...@@ -117,7 +117,7 @@ set session preload_buffer_size=1*1024; ...@@ -117,7 +117,7 @@ set session preload_buffer_size=1*1024;
select @@preload_buffer_size; select @@preload_buffer_size;
@@preload_buffer_size @@preload_buffer_size
1024 1024
load index into cache t1, t2 keys (primary,b) ignore leaves; load index into cache t1, t2 key (primary,b) ignore leaves;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 preload_keys status OK test.t1 preload_keys status OK
test.t2 preload_keys status OK test.t2 preload_keys status OK
...@@ -141,7 +141,7 @@ show status like "key_read%"; ...@@ -141,7 +141,7 @@ show status like "key_read%";
Variable_name Value Variable_name Value
Key_read_requests 0 Key_read_requests 0
Key_reads 0 Key_reads 0
load index into cache t3, t2 keys (primary,b) ; load index into cache t3, t2 key (primary,b) ;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t3 preload_keys error Table 'test.t3' doesn't exist test.t3 preload_keys error Table 'test.t3' doesn't exist
test.t2 preload_keys status OK test.t2 preload_keys status OK
...@@ -155,7 +155,7 @@ show status like "key_read%"; ...@@ -155,7 +155,7 @@ show status like "key_read%";
Variable_name Value Variable_name Value
Key_read_requests 0 Key_read_requests 0
Key_reads 0 Key_reads 0
load index into cache t3 keys (b), t2 keys (c) ; load index into cache t3 key (b), t2 key (c) ;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t3 preload_keys error Table 'test.t3' doesn't exist test.t3 preload_keys error Table 'test.t3' doesn't exist
test.t2 preload_keys error Key column 'c' doesn't exist in table test.t2 preload_keys error Key column 'c' doesn't exist in table
......
...@@ -75,7 +75,7 @@ select * from t2; ...@@ -75,7 +75,7 @@ select * from t2;
update t1 set p=2 where p=1; update t1 set p=2 where p=1;
update t2 set i=2 where i=1; update t2 set i=2 where i=1;
cache index t1 keys (`primary`) in keycache1; cache index t1 key (`primary`) in keycache1;
explain select p from t1; explain select p from t1;
select p from t1; select p from t1;
...@@ -101,7 +101,7 @@ select a from t2; ...@@ -101,7 +101,7 @@ select a from t2;
# Test some error conditions # Test some error conditions
--error 1283 --error 1283
cache index t1 in unknown_key_cache; cache index t1 in unknown_key_cache;
cache index t1 keys (unknown_key) in keycache1; cache index t1 key (unknown_key) in keycache1;
select @@keycache2.key_buffer_size; select @@keycache2.key_buffer_size;
select @@keycache2.key_cache_block_size; select @@keycache2.key_cache_block_size;
......
...@@ -81,7 +81,7 @@ flush tables; flush status; ...@@ -81,7 +81,7 @@ flush tables; flush status;
show status like "key_read%"; show status like "key_read%";
set session preload_buffer_size=1*1024; set session preload_buffer_size=1*1024;
select @@preload_buffer_size; select @@preload_buffer_size;
load index into cache t1, t2 keys (primary,b) ignore leaves; load index into cache t1, t2 key (primary,b) ignore leaves;
show status like "key_read%"; show status like "key_read%";
select count(*) from t1 where b = 'test1'; select count(*) from t1 where b = 'test1';
select count(*) from t2 where b = 'test1'; select count(*) from t2 where b = 'test1';
...@@ -89,12 +89,12 @@ show status like "key_read%"; ...@@ -89,12 +89,12 @@ show status like "key_read%";
flush tables; flush status; flush tables; flush status;
show status like "key_read%"; show status like "key_read%";
load index into cache t3, t2 keys (primary,b) ; load index into cache t3, t2 key (primary,b) ;
show status like "key_read%"; show status like "key_read%";
flush tables; flush status; flush tables; flush status;
show status like "key_read%"; show status like "key_read%";
load index into cache t3 keys (b), t2 keys (c) ; load index into cache t3 key (b), t2 key (c) ;
show status like "key_read%"; show status like "key_read%";
drop table t1, t2; drop table t1, t2;
...@@ -1615,11 +1615,6 @@ opt_key_or_index: ...@@ -1615,11 +1615,6 @@ opt_key_or_index:
| key_or_index | key_or_index
; ;
opt_keys_or_index:
/* empty */ {}
| keys_or_index
;
keys_or_index: keys_or_index:
KEYS {} KEYS {}
| INDEX {} | INDEX {}
...@@ -2120,7 +2115,7 @@ cache_keys_spec: ...@@ -2120,7 +2115,7 @@ cache_keys_spec:
cache_key_list_or_empty: cache_key_list_or_empty:
/* empty */ { Lex->select_lex.use_index_ptr= 0; } /* empty */ { Lex->select_lex.use_index_ptr= 0; }
| opt_keys_or_index '(' key_usage_list2 ')' | opt_key_or_index '(' key_usage_list2 ')'
{ {
SELECT_LEX *sel= &Lex->select_lex; SELECT_LEX *sel= &Lex->select_lex;
sel->use_index_ptr= &sel->use_index; sel->use_index_ptr= &sel->use_index;
......
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