⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cisco.subsql

📁 derby database source code.good for you.
💻 SUBSQL
字号:
--------------------------------------------------------------------------------
-- Test 0.1: ddl interaction
--------------------------------------------------------------------------------

-- create 1st table.  Drop the table, which will get regular X locks on the
-- rows in the system catalogs (which are different than insert locks).
set connection create1;
create table create1 (a int);
drop table create1;

-- create 2nd table
--    The following should not block now that ddl work is done under 
--    repeatable read no matter what the user isolation level.
set connection create2;
create table create2 (a int);

set connection create1;
commit;
set connection create2;
commit;

--------------------------------------------------------------------------------
-- Test 0.2: normal user data, previous key must block on serializable read,
--           if create1 session isolation is serializable, otherwise it will
--           not block.
--------------------------------------------------------------------------------

-- get lock on range of keys 0->10, iso level determines if phantoms allowed.
set connection create1;
select * from data where keycol <= 10;

-- the following must block if create1 isolation level disallows phantoms
set connection create2;
insert into data values (5, '50');
commit;

-- now do the select again from session one to see if a phantom showed up.
set connection create1;
select * from data where keycol <= 10;

set connection create1;
commit;
delete from data where keycol = 5;
commit;
set connection create2;
commit;

--------------------------------------------------------------------------------
-- Test 0.3: normal user data, previous key must block on serializable delete,
--           if create1 session isolation is serializable, otherwise it will
--           not block.
--------------------------------------------------------------------------------

-- get lock on range of keys 0->10, iso level determines if phantoms allowed.
set connection create1;
delete from data where keycol <= 10;

-- the following must block if create1 isolation level disallows phantoms
set connection create2;
insert into data values (6, '60');
commit;

-- now do the select again from session one to see if a phantom showed up.
set connection create1;
select * from data where keycol <= 10;

set connection create1;
commit;
delete from data where keycol = 6;
commit;
set connection create2;
commit;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -