mirror of
https://github.com/MariaDB/server.git
synced 2025-02-20 20:33:15 +01:00
ndb - bug#24039
Make sure index scan does not commitDelete
This commit is contained in:
parent
ebf4de96e3
commit
4bf35faaf2
3 changed files with 66 additions and 1 deletions
mysql-test
storage/ndb/src/kernel/blocks/dbacc
|
@ -796,3 +796,42 @@ Variable_name Value
|
||||||
ndb_index_stat_cache_entries 32
|
ndb_index_stat_cache_entries 32
|
||||||
ndb_index_stat_enable OFF
|
ndb_index_stat_enable OFF
|
||||||
ndb_index_stat_update_freq 20
|
ndb_index_stat_update_freq 20
|
||||||
|
create table t1 (a int primary key) engine = ndb;
|
||||||
|
insert into t1 values (1), (2), (3);
|
||||||
|
begin;
|
||||||
|
delete from t1 where a > 1;
|
||||||
|
rollback;
|
||||||
|
select * from t1 order by a;
|
||||||
|
a
|
||||||
|
1
|
||||||
|
2
|
||||||
|
3
|
||||||
|
begin;
|
||||||
|
delete from t1 where a > 1;
|
||||||
|
rollback;
|
||||||
|
begin;
|
||||||
|
select * from t1 order by a;
|
||||||
|
a
|
||||||
|
1
|
||||||
|
2
|
||||||
|
3
|
||||||
|
delete from t1 where a > 2;
|
||||||
|
select * from t1 order by a;
|
||||||
|
a
|
||||||
|
1
|
||||||
|
2
|
||||||
|
delete from t1 where a > 1;
|
||||||
|
select * from t1 order by a;
|
||||||
|
a
|
||||||
|
1
|
||||||
|
delete from t1 where a > 0;
|
||||||
|
select * from t1 order by a;
|
||||||
|
a
|
||||||
|
rollback;
|
||||||
|
select * from t1 order by a;
|
||||||
|
a
|
||||||
|
1
|
||||||
|
2
|
||||||
|
3
|
||||||
|
delete from t1;
|
||||||
|
drop table t1;
|
||||||
|
|
|
@ -430,3 +430,28 @@ set ndb_index_stat_update_freq = @@global.ndb_index_stat_update_freq;
|
||||||
show session variables like 'ndb_index_stat_%';
|
show session variables like 'ndb_index_stat_%';
|
||||||
|
|
||||||
# End of 4.1 tests
|
# End of 4.1 tests
|
||||||
|
|
||||||
|
# bug#24039
|
||||||
|
|
||||||
|
create table t1 (a int primary key) engine = ndb;
|
||||||
|
insert into t1 values (1), (2), (3);
|
||||||
|
begin;
|
||||||
|
delete from t1 where a > 1;
|
||||||
|
rollback;
|
||||||
|
select * from t1 order by a;
|
||||||
|
begin;
|
||||||
|
delete from t1 where a > 1;
|
||||||
|
rollback;
|
||||||
|
|
||||||
|
begin;
|
||||||
|
select * from t1 order by a;
|
||||||
|
delete from t1 where a > 2;
|
||||||
|
select * from t1 order by a;
|
||||||
|
delete from t1 where a > 1;
|
||||||
|
select * from t1 order by a;
|
||||||
|
delete from t1 where a > 0;
|
||||||
|
select * from t1 order by a;
|
||||||
|
rollback;
|
||||||
|
select * from t1 order by a;
|
||||||
|
delete from t1;
|
||||||
|
drop table t1;
|
||||||
|
|
|
@ -4394,7 +4394,8 @@ void Dbacc::commitOperation(Signal* signal)
|
||||||
Uint32 opbits = operationRecPtr.p->m_op_bits;
|
Uint32 opbits = operationRecPtr.p->m_op_bits;
|
||||||
Uint32 op = opbits & Operationrec::OP_MASK;
|
Uint32 op = opbits & Operationrec::OP_MASK;
|
||||||
ndbrequire((opbits & Operationrec::OP_STATE_MASK) == Operationrec::OP_STATE_EXECUTED);
|
ndbrequire((opbits & Operationrec::OP_STATE_MASK) == Operationrec::OP_STATE_EXECUTED);
|
||||||
if ((opbits & Operationrec::OP_COMMIT_DELETE_CHECK) == 0 && (op != ZREAD))
|
if ((opbits & Operationrec::OP_COMMIT_DELETE_CHECK) == 0 &&
|
||||||
|
(op != ZREAD && op != ZSCAN_OP))
|
||||||
{
|
{
|
||||||
jam();
|
jam();
|
||||||
/* This method is used to check whether the end result of the transaction
|
/* This method is used to check whether the end result of the transaction
|
||||||
|
|
Loading…
Add table
Reference in a new issue