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
5b0280e7
Commit
5b0280e7
authored
Jan 28, 2008
by
pekka@sama.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb - bug#31477 post-merge fixes in 5.1
parent
fc351758
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
42 deletions
+45
-42
storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
+4
-5
storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
+1
-15
storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp
+40
-22
No files found.
storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
View file @
5b0280e7
...
...
@@ -1558,7 +1558,7 @@ public:
/*
* TUX checks if tuple is visible to scan.
*/
bool
tuxQueryTh
(
Uint32
fragPtrI
,
Uint32
pageId
,
Uint32
page
Offset
,
Uint32
tupVersion
,
Uint32
transId1
,
Uint32
transId2
,
bool
dirty
,
Uint32
saveP
ointId
);
bool
tuxQueryTh
(
Uint32
fragPtrI
,
Uint32
pageId
,
Uint32
page
Index
,
Uint32
tupVersion
,
Uint32
transId1
,
Uint32
transId2
,
bool
dirty
,
Uint32
savep
ointId
);
int
load_diskpage
(
Signal
*
,
Uint32
opRec
,
Uint32
fragPtrI
,
Uint32
local_key
,
Uint32
flags
);
...
...
@@ -3041,16 +3041,15 @@ inline
bool
Dbtup
::
find_savepoint
(
OperationrecPtr
&
loopOpPtr
,
Uint32
savepointId
)
{
while
(
true
)
{
if
(
savepointId
>
loopOpPtr
.
p
->
save
P
ointId
)
{
if
(
savepointId
>
loopOpPtr
.
p
->
save
p
ointId
)
{
jam
();
return
true
;
}
// note 5.0 has reversed next/prev pointers
loopOpPtr
.
i
=
loopOpPtr
.
p
->
nextActiveOp
;
loopOpPtr
.
i
=
loopOpPtr
.
p
->
prevActiveOp
;
if
(
loopOpPtr
.
i
==
RNIL
)
{
break
;
}
ptrCheckGuard
(
loopOpPtr
,
cnoOfOprec
,
operationrec
);
c_operation_pool
.
getPtr
(
loopOpPtr
);
}
return
false
;
}
...
...
storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
View file @
5b0280e7
...
...
@@ -358,21 +358,7 @@ Dbtup::setup_read(KeyReqStruct *req_struct,
dirty
=
false
;
}
OperationrecPtr
prevOpPtr
=
currOpPtr
;
bool
found
=
false
;
while
(
true
)
{
if
(
savepointId
>
currOpPtr
.
p
->
savepointId
)
{
found
=
true
;
break
;
}
if
(
currOpPtr
.
p
->
is_first_operation
()){
break
;
}
prevOpPtr
=
currOpPtr
;
currOpPtr
.
i
=
currOpPtr
.
p
->
prevActiveOp
;
c_operation_pool
.
getPtr
(
currOpPtr
);
}
bool
found
=
find_savepoint
(
currOpPtr
,
savepointId
);
Uint32
currOp
=
currOpPtr
.
p
->
op_struct
.
op_type
;
...
...
storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp
View file @
5b0280e7
...
...
@@ -15,6 +15,7 @@
#define DBTUP_C
#define DBTUP_INDEX_CPP
#include <Dblqh.hpp>
#include "Dbtup.hpp"
#include <RefConvert.hpp>
#include <ndb_limits.h>
...
...
@@ -330,7 +331,14 @@ Dbtup::accReadPk(Uint32 tableId, Uint32 fragId, Uint32 fragPageId, Uint32 pageIn
* clear to do the full check here.
*/
bool
Dbtup
::
tuxQueryTh
(
Uint32
fragPtrI
,
Uint32
pageId
,
Uint32
pageOffset
,
Uint32
tupVersion
,
Uint32
transId1
,
Uint32
transId2
,
bool
dirty
,
Uint32
savePointId
)
Dbtup
::
tuxQueryTh
(
Uint32
fragPtrI
,
Uint32
pageId
,
Uint32
pageIndex
,
Uint32
tupVersion
,
Uint32
transId1
,
Uint32
transId2
,
bool
dirty
,
Uint32
savepointId
)
{
jamEntry
();
FragrecordPtr
fragPtr
;
...
...
@@ -341,30 +349,40 @@ Dbtup::tuxQueryTh(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32 tupV
ptrCheckGuard
(
tablePtr
,
cnoOfTablerec
,
tablerec
);
PagePtr
pagePtr
;
pagePtr
.
i
=
pageId
;
ptrCheckGuard
(
pagePtr
,
cnoOfPage
,
page
);
c_page_pool
.
getPtr
(
pagePtr
);
KeyReqStruct
req_struct
;
{
Operationrec
tmpOp
;
tmpOp
.
m_tuple_location
.
m_page_no
=
pageId
;
tmpOp
.
m_tuple_location
.
m_page_idx
=
pageIndex
;
setup_fixed_part
(
&
req_struct
,
&
tmpOp
,
tablePtr
.
p
);
}
Tuple_header
*
tuple_ptr
=
req_struct
.
m_tuple_ptr
;
OperationrecPtr
currOpPtr
;
currOpPtr
.
i
=
pagePtr
.
p
->
pageWord
[
pageOffset
]
;
currOpPtr
.
i
=
tuple_ptr
->
m_operation_ptr_i
;
if
(
currOpPtr
.
i
==
RNIL
)
{
l
jam
();
jam
();
// tuple has no operation, any scan can see it
return
true
;
}
ptrCheckGuard
(
currOpPtr
,
cnoOfOprec
,
operationrec
);
c_operation_pool
.
getPtr
(
currOpPtr
);
const
bool
sameTrans
=
transId1
==
currOpPtr
.
p
->
transid1
&&
transId2
==
currOpPtr
.
p
->
transid2
;
c_lqh
->
is_same_trans
(
currOpPtr
.
p
->
userpointer
,
transId1
,
transId2
);
bool
res
=
false
;
OperationrecPtr
loopOpPtr
=
currOpPtr
;
if
(
!
sameTrans
)
{
l
jam
();
jam
();
if
(
!
dirty
)
{
l
jam
();
if
(
currOpPtr
.
p
->
prev
ActiveOp
==
RNIL
)
{
l
jam
();
jam
();
if
(
currOpPtr
.
p
->
next
ActiveOp
==
RNIL
)
{
jam
();
// last op - TUX makes ACC lock request in same timeslice
res
=
true
;
}
...
...
@@ -372,33 +390,33 @@ Dbtup::tuxQueryTh(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32 tupV
else
{
// loop to first op (returns false)
find_savepoint
(
loopOpPtr
,
0
);
const
Uint32
op_type
=
loopOpPtr
.
p
->
optype
;
const
Uint32
op_type
=
loopOpPtr
.
p
->
op
_struct
.
op_
type
;
if
(
op_type
!=
ZINSERT
)
{
l
jam
();
// read committed version
from the page
const
Uint32
origVersion
=
pagePtr
.
p
->
pageWord
[
pageOffset
+
1
]
;
jam
();
// read committed version
const
Uint32
origVersion
=
tuple_ptr
->
get_tuple_version
()
;
if
(
origVersion
==
tupVersion
)
{
l
jam
();
jam
();
res
=
true
;
}
}
}
}
else
{
l
jam
();
jam
();
// for own trans, ignore dirty flag
if
(
find_savepoint
(
loopOpPtr
,
save
P
ointId
))
{
l
jam
();
const
Uint32
op_type
=
loopOpPtr
.
p
->
optype
;
if
(
find_savepoint
(
loopOpPtr
,
save
p
ointId
))
{
jam
();
const
Uint32
op_type
=
loopOpPtr
.
p
->
op
_struct
.
op_
type
;
if
(
op_type
!=
ZDELETE
)
{
l
jam
();
jam
();
// check if this op has produced the scanned version
Uint32
loopVersion
=
loopOpPtr
.
p
->
tupVersion
;
if
(
loopVersion
==
tupVersion
)
{
l
jam
();
jam
();
res
=
true
;
}
}
...
...
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