Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
c81d4856
Commit
c81d4856
authored
Jan 29, 2008
by
pekka@sama.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb - bug#34118 - hash index trigger vs. disk
parent
86ccc887
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
20 deletions
+66
-20
mysql-test/suite/ndb/r/ndb_dd_basic.result
mysql-test/suite/ndb/r/ndb_dd_basic.result
+12
-0
mysql-test/suite/ndb/t/ndb_dd_basic.test
mysql-test/suite/ndb/t/ndb_dd_basic.test
+15
-0
storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
+11
-6
storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
+6
-3
storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp
+22
-11
No files found.
mysql-test/suite/ndb/r/ndb_dd_basic.result
View file @
c81d4856
...
...
@@ -501,6 +501,18 @@ f1 f2
111111 aaaaaa
222222 bbbbbb
drop table test.t1;
CREATE TABLE t1 (
id int unsigned NOT NULL,
c1 int unsigned NOT NULL,
c2 int DEFAULT NULL,
PRIMARY KEY using hash (id),
UNIQUE KEY c1 using hash (c1))
TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster;
insert into t1 values(1, 1, 3);
insert into t1 values(2, 2, 3);
update t1 set c1 = 1 where id = 2;
ERROR 23000: Duplicate entry '1' for key 'c1'
drop table t1;
ALTER TABLESPACE ts1
DROP DATAFILE 'datafile.dat'
ENGINE = NDB;
...
...
mysql-test/suite/ndb/t/ndb_dd_basic.test
View file @
c81d4856
...
...
@@ -439,6 +439,21 @@ select f2 from test.t1 order by f2;
select
f1
,
f2
from
test
.
t1
order
by
f1
;
drop
table
test
.
t1
;
# bug#34118 hash index trigger and do not update any disk attr
CREATE
TABLE
t1
(
id
int
unsigned
NOT
NULL
,
c1
int
unsigned
NOT
NULL
,
c2
int
DEFAULT
NULL
,
PRIMARY
KEY
using
hash
(
id
),
UNIQUE
KEY
c1
using
hash
(
c1
))
TABLESPACE
ts1
STORAGE
DISK
ENGINE
=
ndbcluster
;
insert
into
t1
values
(
1
,
1
,
3
);
insert
into
t1
values
(
2
,
2
,
3
);
--
error
ER_DUP_ENTRY
update
t1
set
c1
=
1
where
id
=
2
;
drop
table
t1
;
###################
# Test Cleanup
###################
...
...
storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
View file @
c81d4856
...
...
@@ -2202,17 +2202,20 @@ private:
void
checkImmediateTriggersAfterInsert
(
KeyReqStruct
*
req_struct
,
Operationrec
*
regOperPtr
,
Tablerec
*
tablePtr
);
Tablerec
*
tablePtr
,
bool
disk
);
void
checkImmediateTriggersAfterUpdate
(
KeyReqStruct
*
req_struct
,
Operationrec
*
regOperPtr
,
Tablerec
*
tablePtr
);
Tablerec
*
tablePtr
,
bool
disk
);
void
checkImmediateTriggersAfterDelete
(
KeyReqStruct
*
req_struct
,
Operationrec
*
regOperPtr
,
Tablerec
*
tablePtr
);
Tablerec
*
tablePtr
,
bool
disk
);
#if 0
void checkDeferredTriggers(Signal* signal,
...
...
@@ -2226,7 +2229,8 @@ private:
void
fireImmediateTriggers
(
KeyReqStruct
*
req_struct
,
DLList
<
TupTriggerData
>&
triggerList
,
Operationrec
*
regOperPtr
);
Operationrec
*
regOperPtr
,
bool
disk
);
void
fireDeferredTriggers
(
KeyReqStruct
*
req_struct
,
DLList
<
TupTriggerData
>&
triggerList
,
...
...
@@ -2239,12 +2243,13 @@ private:
void
executeTriggers
(
KeyReqStruct
*
req_struct
,
DLList
<
TupTriggerData
>&
triggerList
,
Operationrec
*
regOperPtr
);
Operationrec
*
regOperPtr
,
bool
disk
);
void
executeTrigger
(
KeyReqStruct
*
req_struct
,
TupTriggerData
*
trigPtr
,
Operationrec
*
regOperPtr
,
bool
disk
=
true
);
bool
disk
);
bool
readTriggerInfo
(
TupTriggerData
*
trigPtr
,
Operationrec
*
regOperPtr
,
...
...
storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
View file @
c81d4856
...
...
@@ -749,7 +749,8 @@ void Dbtup::execTUPKEYREQ(Signal* signal)
}
checkImmediateTriggersAfterInsert
(
&
req_struct
,
regOperPtr
,
regTabPtr
);
regTabPtr
,
disk_page
!=
RNIL
);
set_change_mask_state
(
regOperPtr
,
SET_ALL_MASK
);
sendTUPKEYCONF
(
signal
,
&
req_struct
,
regOperPtr
);
return
;
...
...
@@ -782,7 +783,8 @@ void Dbtup::execTUPKEYREQ(Signal* signal)
}
checkImmediateTriggersAfterUpdate
(
&
req_struct
,
regOperPtr
,
regTabPtr
);
regTabPtr
,
disk_page
!=
RNIL
);
// XXX use terrorCode for now since all methods are void
if
(
terrorCode
!=
0
)
{
...
...
@@ -813,7 +815,8 @@ void Dbtup::execTUPKEYREQ(Signal* signal)
*/
checkImmediateTriggersAfterDelete
(
&
req_struct
,
regOperPtr
,
regTabPtr
);
regTabPtr
,
disk_page
!=
RNIL
);
set_change_mask_state
(
regOperPtr
,
DELETE_CHANGES
);
sendTUPKEYCONF
(
signal
,
&
req_struct
,
regOperPtr
);
return
;
...
...
storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp
View file @
c81d4856
...
...
@@ -369,7 +369,8 @@ Dbtup::dropTrigger(Tablerec* table, const DropTrigReq* req, BlockNumber sender)
void
Dbtup
::
checkImmediateTriggersAfterInsert
(
KeyReqStruct
*
req_struct
,
Operationrec
*
regOperPtr
,
Tablerec
*
regTablePtr
)
Tablerec
*
regTablePtr
,
bool
disk
)
{
if
(
refToBlock
(
req_struct
->
TC_ref
)
!=
DBTC
)
{
return
;
...
...
@@ -380,14 +381,16 @@ Dbtup::checkImmediateTriggersAfterInsert(KeyReqStruct *req_struct,
jam
();
fireImmediateTriggers
(
req_struct
,
regTablePtr
->
afterInsertTriggers
,
regOperPtr
);
regOperPtr
,
disk
);
}
}
void
Dbtup
::
checkImmediateTriggersAfterUpdate
(
KeyReqStruct
*
req_struct
,
Operationrec
*
regOperPtr
,
Tablerec
*
regTablePtr
)
Tablerec
*
regTablePtr
,
bool
disk
)
{
if
(
refToBlock
(
req_struct
->
TC_ref
)
!=
DBTC
)
{
return
;
...
...
@@ -398,21 +401,24 @@ Dbtup::checkImmediateTriggersAfterUpdate(KeyReqStruct *req_struct,
jam
();
fireImmediateTriggers
(
req_struct
,
regTablePtr
->
afterUpdateTriggers
,
regOperPtr
);
regOperPtr
,
disk
);
}
if
((
regOperPtr
->
op_struct
.
primary_replica
)
&&
(
!
(
regTablePtr
->
constraintUpdateTriggers
.
isEmpty
())))
{
jam
();
fireImmediateTriggers
(
req_struct
,
regTablePtr
->
constraintUpdateTriggers
,
regOperPtr
);
regOperPtr
,
disk
);
}
}
void
Dbtup
::
checkImmediateTriggersAfterDelete
(
KeyReqStruct
*
req_struct
,
Operationrec
*
regOperPtr
,
Tablerec
*
regTablePtr
)
Tablerec
*
regTablePtr
,
bool
disk
)
{
if
(
refToBlock
(
req_struct
->
TC_ref
)
!=
DBTC
)
{
return
;
...
...
@@ -423,7 +429,8 @@ Dbtup::checkImmediateTriggersAfterDelete(KeyReqStruct *req_struct,
jam
();
executeTriggers
(
req_struct
,
regTablePtr
->
afterDeleteTriggers
,
regOperPtr
);
regOperPtr
,
disk
);
}
}
...
...
@@ -547,7 +554,8 @@ void Dbtup::checkDetachedTriggers(KeyReqStruct *req_struct,
void
Dbtup
::
fireImmediateTriggers
(
KeyReqStruct
*
req_struct
,
DLList
<
TupTriggerData
>&
triggerList
,
Operationrec
*
const
regOperPtr
)
Operationrec
*
const
regOperPtr
,
bool
disk
)
{
TriggerPtr
trigPtr
;
triggerList
.
first
(
trigPtr
);
...
...
@@ -558,7 +566,8 @@ Dbtup::fireImmediateTriggers(KeyReqStruct *req_struct,
jam
();
executeTrigger
(
req_struct
,
trigPtr
.
p
,
regOperPtr
);
regOperPtr
,
disk
);
}
//if
triggerList
.
next
(
trigPtr
);
}
//while
...
...
@@ -621,7 +630,8 @@ Dbtup::fireDetachedTriggers(KeyReqStruct *req_struct,
void
Dbtup
::
executeTriggers
(
KeyReqStruct
*
req_struct
,
DLList
<
TupTriggerData
>&
triggerList
,
Operationrec
*
regOperPtr
)
Operationrec
*
regOperPtr
,
bool
disk
)
{
TriggerPtr
trigPtr
;
triggerList
.
first
(
trigPtr
);
...
...
@@ -629,7 +639,8 @@ void Dbtup::executeTriggers(KeyReqStruct *req_struct,
jam
();
executeTrigger
(
req_struct
,
trigPtr
.
p
,
regOperPtr
);
regOperPtr
,
disk
);
triggerList
.
next
(
trigPtr
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment