ndb - bug#33619

  make sure to alloc logspace and set bits
  if doing delete after previous update wo/ touching DD part
parent 9bfd0791
...@@ -406,6 +406,16 @@ a b c ...@@ -406,6 +406,16 @@ a b c
1 7 7 1 7 7
2 2 2 2 2 2
3 3 3 3 3 3
DELETE FROM t1;
INSERT INTO t1 VALUES (3,'1','1');
BEGIN;
UPDATE t1 SET b = b + 2 WHERE A = 3;
DELETE FROM t1 WHERE A = 3;
INSERT INTO t1 VALUES (3,'0','0');
COMMIT;
SELECT * from t1 ORDER BY 1;
a b c
3 0 0
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 ( CREATE TABLE t1 (
a INT NOT NULL PRIMARY KEY, a INT NOT NULL PRIMARY KEY,
......
...@@ -346,6 +346,16 @@ UPDATE t1 SET c = '6' WHERE b = '7'; ...@@ -346,6 +346,16 @@ UPDATE t1 SET c = '6' WHERE b = '7';
SELECT * FROM t1 ORDER BY 1; SELECT * FROM t1 ORDER BY 1;
UPDATE t1 SET c = '7' WHERE c = '6'; UPDATE t1 SET c = '7' WHERE c = '6';
SELECT * FROM t1 ORDER BY 1; SELECT * FROM t1 ORDER BY 1;
DELETE FROM t1;
INSERT INTO t1 VALUES (3,'1','1');
BEGIN;
UPDATE t1 SET b = b + 2 WHERE A = 3;
DELETE FROM t1 WHERE A = 3;
INSERT INTO t1 VALUES (3,'0','0');
COMMIT;
SELECT * from t1 ORDER BY 1;
DROP TABLE t1; DROP TABLE t1;
######################## ########################
......
...@@ -1503,33 +1503,23 @@ int Dbtup::handleDeleteReq(Signal* signal, ...@@ -1503,33 +1503,23 @@ int Dbtup::handleDeleteReq(Signal* signal,
else else
{ {
regOperPtr->tupVersion= req_struct->m_tuple_ptr->get_tuple_version(); regOperPtr->tupVersion= req_struct->m_tuple_ptr->get_tuple_version();
if(regTabPtr->m_no_of_disk_attributes)
{
Uint32 sz;
if(regTabPtr->m_attributes[DD].m_no_of_varsize)
{
/**
* Need to have page in memory to read size
* to alloc undo space
*/
abort();
} }
else
sz= (sizeof(Dbtup::Disk_undo::Free) >> 2) +
regTabPtr->m_offsets[DD].m_fix_header_size - 1;
regOperPtr->m_undo_buffer_space= sz; if(disk && regOperPtr->m_undo_buffer_space == 0)
{
regOperPtr->op_struct.m_wait_log_buffer = 1;
regOperPtr->op_struct.m_load_diskpage_on_commit = 1;
Uint32 sz= regOperPtr->m_undo_buffer_space=
(sizeof(Dbtup::Disk_undo::Free) >> 2) +
regTabPtr->m_offsets[DD].m_fix_header_size - 1;
int res; terrorCode= c_lgman->alloc_log_space(regFragPtr->m_logfile_group_id,
if((res= c_lgman->alloc_log_space(regFragPtr->m_logfile_group_id, sz);
sz))) if(unlikely(terrorCode))
{ {
terrorCode= res;
regOperPtr->m_undo_buffer_space= 0; regOperPtr->m_undo_buffer_space= 0;
goto error; goto error;
} }
}
} }
if (req_struct->attrinfo_len == 0) if (req_struct->attrinfo_len == 0)
{ {
...@@ -1537,7 +1527,9 @@ int Dbtup::handleDeleteReq(Signal* signal, ...@@ -1537,7 +1527,9 @@ int Dbtup::handleDeleteReq(Signal* signal,
} }
if (regTabPtr->need_expand(disk)) if (regTabPtr->need_expand(disk))
{
prepare_read(req_struct, regTabPtr, disk); prepare_read(req_struct, regTabPtr, disk);
}
{ {
Uint32 RlogSize; Uint32 RlogSize;
......
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