mirror of
https://github.com/MariaDB/server.git
synced 2025-07-02 14:22:51 +03:00
Also some small fixes to make the PBXT testsuite work in --embedded. config/ac-macros/plugins.m4: MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS macro extended to support multiple files. mysql-test/std_data/pbxt_load_unique_error1.inc: Move file to be accessible also for testing embedded server. mysql-test/suite/pbxt/r/pbxt_bugs.result: Fix LOAD DATA LOCAL INFILE path so it works also for testing embedded server. mysql-test/suite/pbxt/t/pbxt_bugs.test: Fix LOAD DATA LOCAL INFILE path so it works also for testing embedded server. mysql-test/suite/pbxt/t/pbxt_locking.test: Disable for embedded, as it needs SHOW PROCESSLIST functionality not available there. mysql-test/suite/pbxt/t/pbxt_transactions.test: Disable test for embedded, as it needs ability to connect from outside (mysqldump). mysql-test/suite/pbxt/t/ps_1general.test: Fix replace_result for new mysql-test-run.pl. sql/sql_plugin.cc: Remove hack that disables PBXT in embedded. storage/pbxt/plug.in: Fix crash in PBXT in embedded server. storage/pbxt/src/Makefile.am: Remove not needed CFLAGS/CXXFLAGS (they cause autotools to generate different object names, which in turn cause the MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS replacement of object files inside library files not to work). storage/pbxt/src/ha_pbxt.cc: Ugly hack to allow more threads in embedded server (need a better fix I think). storage/pbxt/src/table_xt.cc: Use stderr for logging not stdout (prevent spamming --embedded test suite output with stray messages). storage/pbxt/src/thread_xt.cc: Use stderr for logging not stdout (prevent spamming --embedded test suite output with stray messages). storage/pbxt/src/trace_xt.cc: Use stderr for logging not stdout (prevent spamming --embedded test suite output with stray messages).
129 lines
2.7 KiB
Plaintext
129 lines
2.7 KiB
Plaintext
# This test covers various aspects of PBXT locking mechanism, including
|
|
# internal permanent/temporary row locking and MySQL locking
|
|
|
|
# SHOW PROCESSLIST has hardcoded "Writing to net" as state.
|
|
-- source include/not_embedded.inc
|
|
|
|
# TEST: select for update test
|
|
|
|
drop table if exists t1;
|
|
create table t1 (id int, index (id)) engine = pbxt;
|
|
insert into t1 values (1), (2), (3), (4), (5);
|
|
begin;
|
|
select * from t1 where id < 5 for update;
|
|
|
|
connect (con1,localhost,root,,);
|
|
|
|
connection con1;
|
|
|
|
# this shouldn't lock
|
|
# note this implies usage of the index, table scan will block
|
|
update t1 set id = 8 where id = 5;
|
|
|
|
# this should block
|
|
send update t1 set id = 8 where id = 4;
|
|
|
|
connection default;
|
|
sleep 1;
|
|
replace_column 1 x 3 x 6 x;
|
|
show processlist;
|
|
commit;
|
|
|
|
connection con1;
|
|
reap;
|
|
select * from t1;
|
|
|
|
# TEST: make sure no unneeded temporary locks are set
|
|
|
|
connection default;
|
|
|
|
drop table if exists t1;
|
|
# notice absence of index
|
|
create table t1 (id int) engine = pbxt;
|
|
insert into t1 values (1), (2), (3), (4), (5);
|
|
|
|
begin;
|
|
# after this statement all rows should be unlocked
|
|
select * from t1 where id > 10 for update;
|
|
|
|
connection con1;
|
|
# this shouldn't block
|
|
update t1 set id = 8;
|
|
|
|
connection default;
|
|
commit;
|
|
select * from t1;
|
|
|
|
# TEST: last row temp->perm locking
|
|
|
|
connection default;
|
|
|
|
drop table if exists t1;
|
|
create table t1 (id int, index (id)) engine = pbxt;
|
|
insert into t1 values (1), (2), (3), (4), (5);
|
|
|
|
begin;
|
|
select * from t1 where id = 5 for update;
|
|
|
|
connection con1;
|
|
|
|
update t1 set id = 8 where id < 4;
|
|
# this should block
|
|
send update t1 set id = 8 where id = 5;
|
|
|
|
connection default;
|
|
sleep 1;
|
|
replace_column 1 x 3 x 6 x;
|
|
show processlist;
|
|
commit;
|
|
|
|
connection con1;
|
|
reap;
|
|
|
|
connection default;
|
|
select * from t1;
|
|
|
|
# TEST: select for update in auto-commit mode
|
|
# although this is not a widely used case in practice, make sure it operates correctly
|
|
|
|
connection default;
|
|
|
|
drop table if exists t1;
|
|
create table t1 (id int, index (id)) engine = pbxt;
|
|
insert into t1 values (1), (2), (3), (4), (5);
|
|
|
|
# auto-commit mode - should unlock immediately
|
|
select * from t1 for update;
|
|
|
|
connection con1;
|
|
# this shouldn't block
|
|
update t1 set id = 8;
|
|
|
|
# TEST: same as before but from a stored routine
|
|
|
|
connection default;
|
|
|
|
drop table if exists t1;
|
|
create table t1 (id int, index (id)) engine = pbxt;
|
|
insert into t1 values (1), (2), (3), (4), (5);
|
|
|
|
delimiter |;
|
|
create procedure p1 ()
|
|
begin
|
|
select * from t1 for update;
|
|
end|
|
|
|
|
delimiter ;|
|
|
call p1 ();
|
|
|
|
connection con1;
|
|
|
|
# this shouldn't block
|
|
update t1 set id = 8;
|
|
|
|
--disable_query_log
|
|
drop procedure p1;
|
|
drop table t1;
|
|
drop database pbxt;
|
|
--enable_query_log
|