mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
e63b5546c5
It includes speed optimizations for HANDLER READ by caching as much as possible in HANDLER OPEN Other things: - Added mysqld option --disable-thr-alarm to be able to benchmark things without thr_alarm - Changed 'Locked' state to 'System lock' and 'Table lock' (these where used in the code but never shown to end user) - Better error message if mysql_install_db.sh fails - Moved handler function prototypes to sql_handler.h - Remove not anymore used 'thd->locked' member include/thr_alarm.h: Added my_disable_thr_alarm include/thr_lock.h: Add new member to THR_LOCK_DATA to remember original lock type state. This is needed as thr_unlock() resets type to TL_UNLOCK. mysql-test/include/check_no_concurrent_insert.inc: Locked -> Table lock mysql-test/include/handler.inc: Locked -> Table lock mysql-test/r/handler_innodb.result: Updated results for new tests mysql-test/r/handler_myisam.result: Updated results for new tests mysql-test/r/sp-threads.result: Locked -> Table lock mysql-test/suite/binlog/t/binlog_stm_row.test: Locked -> Table lock mysql-test/suite/funcs_1/datadict/processlist_val.inc: Locked -> Table lock mysql-test/suite/pbxt/t/lock_multi.test: Locked -> Table lock mysql-test/suite/sys_vars/r/concurrent_insert_func.result: Locked -> Table lock mysql-test/suite/sys_vars/t/concurrent_insert_func.test: Locked -> Table lock mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test: Locked -> Table lock mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test: Locked -> Table lock mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test: Locked -> Table lock mysql-test/t/insert_notembedded.test: Locked -> Table lock mysql-test/t/lock_multi.test: Locked -> Table lock mysql-test/t/merge-big.test: Locked -> Table lock mysql-test/t/multi_update.test: Locked -> Table lock mysql-test/t/query_cache_28249.test: Locked -> Table lock mysql-test/t/sp_notembedded.test: Locked -> Table lock mysql-test/t/sp_sync.test: Locked -> Table lock mysql-test/t/status.test: Locked -> Table lock mysql-test/t/trigger_notembedded.test: Locked -> Table lock mysys/thr_alarm.c: Added option to disable thr_alarm mysys/thr_lock.c: Detect loops scripts/mysql_install_db.sh: Give better error message if something goes wrong sql/Makefile.am: Added sql_handler.h sql/lock.cc: Split functions to allow one to cache value if store_lock() (for HANDLER functions). - Split mysql_lock_tables() into two functions, where first one allocates MYSQL_LOCK and other other one uses it. - Made get_lock_data() an external function. - Added argument to mysql_unlock_tables() to not free sql_lock. - Added argument to reset_lock_data() to reset lock structure to initial state (as after get_lock_data()) sql/mysql_priv.h: Moved handler function prototypes to sql_handler.h Added new lock functions. sql/mysqld.cc: Added --thread-alarm startup option sql/net_serv.cc: Don't call vio_blocking() if not needed sql/sql_base.cc: include sql_handler.h sql/sql_class.cc: include sql_handler.h Remove not anymore used 'thd->locked' member sql/sql_class.h: Remove not anymore used 'thd->locked' member sql/sql_db.cc: include sql_handler.h sql/sql_delete.cc: include sql_handler.h sql/sql_handler.cc: Rewrote all code to use SQL_HANDLER instead of TABLE_LIST (original interface) Rewrote mysql_ha_open() to cache all things from TABLE_LIST and items for field list, where etc. In mysql_ha_open() also cache MYSQL_LOCK structure from get_lock_data(). Split functions into smaller sub functions (needed to be able to implement mysql_ha_read_prepare()) Added mysql_ha_read_prepare() to allow one to prepare HANDLER READ. sql/sql_handler.h: Interface to sql_handler.cc sql/sql_parse.cc: include sql_handler.h sql/sql_prepare.cc: Added mysql_test_handler_read(), prepare for HANDLER READ sql/sql_rename.cc: include sql_handler.h sql/sql_show.cc: Removed usage of thd->locked sql/sql_table.cc: include sql_handler.h sql/sql_trigger.cc: include sql_handler.h
91 lines
2 KiB
Text
91 lines
2 KiB
Text
use test;
|
|
drop table if exists t1;
|
|
create table t1 (s1 int, s2 int, s3 int);
|
|
create procedure bug4934()
|
|
begin
|
|
insert into t1 values (1,0,1);
|
|
end//
|
|
use test;
|
|
call bug4934();
|
|
select * from t1;
|
|
s1 s2 s3
|
|
1 0 1
|
|
drop table t1;
|
|
create table t1 (s1 int, s2 int, s3 int);
|
|
drop procedure bug4934;
|
|
create procedure bug4934()
|
|
begin
|
|
end//
|
|
select * from t1;
|
|
s1 s2 s3
|
|
call bug4934();
|
|
select * from t1;
|
|
s1 s2 s3
|
|
drop table t1;
|
|
drop procedure bug4934;
|
|
drop procedure if exists bug9486;
|
|
drop table if exists t1, t2;
|
|
create table t1 (id1 int, val int);
|
|
create table t2 (id2 int);
|
|
create procedure bug9486()
|
|
update t1, t2 set val= 1 where id1=id2;
|
|
call bug9486();
|
|
lock tables t2 write;
|
|
call bug9486();
|
|
show processlist;
|
|
Id User Host db Command Time State Info
|
|
# root localhost test Sleep # NULL
|
|
# root localhost test Query # Table lock update t1, t2 set val= 1 where id1=id2
|
|
# root localhost test Query # NULL show processlist
|
|
# root localhost test Sleep # NULL
|
|
unlock tables;
|
|
drop procedure bug9486;
|
|
drop table t1, t2;
|
|
drop procedure if exists bug11158;
|
|
create procedure bug11158() delete t1 from t1, t2 where t1.id = t2.id;
|
|
create table t1 (id int, j int);
|
|
insert into t1 values (1, 1), (2, 2);
|
|
create table t2 (id int);
|
|
insert into t2 values (1);
|
|
call bug11158();
|
|
select * from t1;
|
|
id j
|
|
2 2
|
|
lock tables t2 read;
|
|
call bug11158();
|
|
unlock tables;
|
|
drop procedure bug11158;
|
|
drop table t1, t2;
|
|
drop function if exists bug11554;
|
|
drop view if exists v1;
|
|
create table t1 (i int);
|
|
create function bug11554 () returns int return 1;
|
|
create view v1 as select bug11554() as f;
|
|
insert into t1 (select f from v1);
|
|
drop function bug11554;
|
|
drop table t1;
|
|
drop view v1;
|
|
drop procedure if exists p1;
|
|
drop procedure if exists p2;
|
|
create table t1 (s1 int)|
|
|
create procedure p1() select * from t1|
|
|
create procedure p2()
|
|
begin
|
|
insert into t1 values (1);
|
|
call p1();
|
|
select * from t1;
|
|
end|
|
|
use test;
|
|
lock table t1 write;
|
|
call p2();
|
|
use test;
|
|
drop procedure p1;
|
|
create procedure p1() select * from t1;
|
|
unlock tables;
|
|
s1
|
|
1
|
|
s1
|
|
1
|
|
drop procedure p1;
|
|
drop procedure p2;
|
|
drop table t1;
|