Commit b6a28b3c authored by unknown's avatar unknown

Merge 51.0.168.192.in-addr.arpa:/Users/bell/mysql/bk/mysql-5.0

into 51.0.168.192.in-addr.arpa:/Users/bell/mysql/bk/work-qc_item_view-5.0


mysql-test/r/sp.result:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_cache.cc:
  Auto merged
BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
parents b3b5f8fb 57a32632
...@@ -27,6 +27,7 @@ bar@deer.(none) ...@@ -27,6 +27,7 @@ bar@deer.(none)
bar@gw.udmsearch.izhnet.ru bar@gw.udmsearch.izhnet.ru
bar@mysql.com bar@mysql.com
bar@noter.intranet.mysql.r18.ru bar@noter.intranet.mysql.r18.ru
bell@51.0.168.192.in-addr.arpa
bell@laptop.sanja.is.com.ua bell@laptop.sanja.is.com.ua
bell@sanja.is.com.ua bell@sanja.is.com.ua
bk@admin.bk bk@admin.bk
......
...@@ -2480,5 +2480,17 @@ ERROR 42000: Can't find any matching row in the user table ...@@ -2480,5 +2480,17 @@ ERROR 42000: Can't find any matching row in the user table
select bug5278()| select bug5278()|
ERROR 42000: Can't find any matching row in the user table ERROR 42000: Can't find any matching row in the user table
drop function bug5278| drop function bug5278|
drop procedure if exists p1|
create table t3(id int)|
insert into t3 values(1)|
create procedure bug7992()
begin
declare i int;
select max(id)+1 into i from t3;
end|
call bug7992()|
call bug7992()|
drop procedure bug7992|
drop table t3|
drop table t1; drop table t1;
drop table t2; drop table t2;
drop table if exists t1,t2,v1,v2,v3;
drop view if exists t1,t2,v1,v2,v3;
set GLOBAL query_cache_size=1355776; set GLOBAL query_cache_size=1355776;
flush status; flush status;
create table t1 (a int, b int); create table t1 (a int, b int);
...@@ -98,4 +100,27 @@ Qcache_hits 1 ...@@ -98,4 +100,27 @@ Qcache_hits 1
drop view v1; drop view v1;
set query_cache_type=default; set query_cache_type=default;
drop table t1; drop table t1;
create table t1 (a int);
insert into t1 values (1), (2), (3);
create view v1 as select a from t1 where a > 1;
select * from v1;
a
2
3
alter view v1 as select a from t1 where a > 2;
select * from v1;
a
3
drop view v1;
select * from v1;
ERROR 42S02: Table 'test.v1' doesn't exist
drop table t1;
create table t1 (a int, primary key (a), b int);
create table t2 (a int, primary key (a), b int);
insert into t2 values (1000, 2000);
create view v3 (a,b) as select t1.a as a, t2.a as b from t1, t2;
select * from v3;
a b
drop view v3;
drop table t1, t2;
set GLOBAL query_cache_size=default; set GLOBAL query_cache_size=default;
...@@ -2982,7 +2982,26 @@ select bug5278()| ...@@ -2982,7 +2982,26 @@ select bug5278()|
select bug5278()| select bug5278()|
drop function bug5278| drop function bug5278|
#
# BUG#7992: rolling back temporary Item tree changes in SP
#
--disable_warnings
drop procedure if exists p1|
--enable_warnings
create table t3(id int)|
insert into t3 values(1)|
create procedure bug7992()
begin
declare i int;
select max(id)+1 into i from t3;
end|
call bug7992()|
call bug7992()|
drop procedure bug7992|
drop table t3|
delimiter ;| delimiter ;|
drop table t1; drop table t1;
drop table t2; drop table t2;
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
# #
# QUERY CACHE options for VIEWs # QUERY CACHE options for VIEWs
# #
--disable_warnings
drop table if exists t1,t2,v1,v2,v3;
drop view if exists t1,t2,v1,v2,v3;
--enable_warnings
set GLOBAL query_cache_size=1355776; set GLOBAL query_cache_size=1355776;
flush status; flush status;
create table t1 (a int, b int); create table t1 (a int, b int);
...@@ -53,6 +58,30 @@ drop view v1; ...@@ -53,6 +58,30 @@ drop view v1;
set query_cache_type=default; set query_cache_type=default;
drop table t1; drop table t1;
set GLOBAL query_cache_size=default;
#
# invalidation of view
#
create table t1 (a int);
insert into t1 values (1), (2), (3);
create view v1 as select a from t1 where a > 1;
select * from v1;
alter view v1 as select a from t1 where a > 2;
select * from v1;
drop view v1;
-- error 1146
select * from v1;
drop table t1;
#
# join view with QC
#
create table t1 (a int, primary key (a), b int);
create table t2 (a int, primary key (a), b int);
insert into t2 values (1000, 2000);
create view v3 (a,b) as select t1.a as a, t2.a as b from t1, t2;
select * from v3;
drop view v3;
drop table t1, t2;
set GLOBAL query_cache_size=default;
...@@ -504,6 +504,7 @@ sp_head::execute(THD *thd) ...@@ -504,6 +504,7 @@ sp_head::execute(THD *thd)
break; break;
DBUG_PRINT("execute", ("Instruction %u", ip)); DBUG_PRINT("execute", ("Instruction %u", ip));
ret= i->execute(thd, &ip); ret= i->execute(thd, &ip);
thd->rollback_item_tree_changes();
if (i->free_list) if (i->free_list)
cleanup_items(i->free_list); cleanup_items(i->free_list);
// Check if an exception has occurred and a handler has been found // Check if an exception has occurred and a handler has been found
......
This diff is collapsed.
...@@ -285,6 +285,10 @@ class Query_cache ...@@ -285,6 +285,10 @@ class Query_cache
void invalidate_table(TABLE *table); void invalidate_table(TABLE *table);
void invalidate_table(byte *key, uint32 key_length); void invalidate_table(byte *key, uint32 key_length);
void invalidate_table(Query_cache_block *table_block); void invalidate_table(Query_cache_block *table_block);
TABLE_COUNTER_TYPE
register_tables_from_list(TABLE_LIST *tables_used,
TABLE_COUNTER_TYPE counter,
Query_cache_block_table *block_table);
my_bool register_all_tables(Query_cache_block *block, my_bool register_all_tables(Query_cache_block *block,
TABLE_LIST *tables_used, TABLE_LIST *tables_used,
TABLE_COUNTER_TYPE tables); TABLE_COUNTER_TYPE tables);
......
...@@ -305,6 +305,8 @@ bool mysql_create_view(THD *thd, ...@@ -305,6 +305,8 @@ bool mysql_create_view(THD *thd,
VOID(pthread_mutex_lock(&LOCK_open)); VOID(pthread_mutex_lock(&LOCK_open));
res= mysql_register_view(thd, view, mode); res= mysql_register_view(thd, view, mode);
VOID(pthread_mutex_unlock(&LOCK_open)); VOID(pthread_mutex_unlock(&LOCK_open));
if (view->revision != 1)
query_cache_invalidate3(thd, view, 0);
start_waiting_global_read_lock(thd); start_waiting_global_read_lock(thd);
if (res) if (res)
goto err; goto err;
...@@ -917,6 +919,7 @@ bool mysql_drop_view(THD *thd, TABLE_LIST *views, enum_drop_mode drop_mode) ...@@ -917,6 +919,7 @@ bool mysql_drop_view(THD *thd, TABLE_LIST *views, enum_drop_mode drop_mode)
} }
if (my_delete(path, MYF(MY_WME))) if (my_delete(path, MYF(MY_WME)))
goto err; goto err;
query_cache_invalidate3(thd, view, 0);
VOID(pthread_mutex_unlock(&LOCK_open)); VOID(pthread_mutex_unlock(&LOCK_open));
} }
send_ok(thd); send_ok(thd);
......
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