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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
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:
...
@@ -1558,7 +1558,7 @@ public:
/*
/*
* TUX checks if tuple is visible to scan.
* 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
,
int
load_diskpage
(
Signal
*
,
Uint32
opRec
,
Uint32
fragPtrI
,
Uint32
local_key
,
Uint32
flags
);
Uint32
local_key
,
Uint32
flags
);
...
@@ -3041,16 +3041,15 @@ inline
...
@@ -3041,16 +3041,15 @@ inline
bool
Dbtup
::
find_savepoint
(
OperationrecPtr
&
loopOpPtr
,
Uint32
savepointId
)
bool
Dbtup
::
find_savepoint
(
OperationrecPtr
&
loopOpPtr
,
Uint32
savepointId
)
{
{
while
(
true
)
{
while
(
true
)
{
if
(
savepointId
>
loopOpPtr
.
p
->
save
P
ointId
)
{
if
(
savepointId
>
loopOpPtr
.
p
->
save
p
ointId
)
{
jam
();
jam
();
return
true
;
return
true
;
}
}
// note 5.0 has reversed next/prev pointers
loopOpPtr
.
i
=
loopOpPtr
.
p
->
prevActiveOp
;
loopOpPtr
.
i
=
loopOpPtr
.
p
->
nextActiveOp
;
if
(
loopOpPtr
.
i
==
RNIL
)
{
if
(
loopOpPtr
.
i
==
RNIL
)
{
break
;
break
;
}
}
ptrCheckGuard
(
loopOpPtr
,
cnoOfOprec
,
operationrec
);
c_operation_pool
.
getPtr
(
loopOpPtr
);
}
}
return
false
;
return
false
;
}
}
...
...
storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
View file @
5b0280e7
...
@@ -358,21 +358,7 @@ Dbtup::setup_read(KeyReqStruct *req_struct,
...
@@ -358,21 +358,7 @@ Dbtup::setup_read(KeyReqStruct *req_struct,
dirty
=
false
;
dirty
=
false
;
}
}
OperationrecPtr
prevOpPtr
=
currOpPtr
;
bool
found
=
find_savepoint
(
currOpPtr
,
savepointId
);
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
);
}
Uint32
currOp
=
currOpPtr
.
p
->
op_struct
.
op_type
;
Uint32
currOp
=
currOpPtr
.
p
->
op_struct
.
op_type
;
...
...
storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp
View file @
5b0280e7
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
#define DBTUP_C
#define DBTUP_C
#define DBTUP_INDEX_CPP
#define DBTUP_INDEX_CPP
#include <Dblqh.hpp>
#include "Dbtup.hpp"
#include "Dbtup.hpp"
#include <RefConvert.hpp>
#include <RefConvert.hpp>
#include <ndb_limits.h>
#include <ndb_limits.h>
...
@@ -330,7 +331,14 @@ Dbtup::accReadPk(Uint32 tableId, Uint32 fragId, Uint32 fragPageId, Uint32 pageIn
...
@@ -330,7 +331,14 @@ Dbtup::accReadPk(Uint32 tableId, Uint32 fragId, Uint32 fragPageId, Uint32 pageIn
* clear to do the full check here.
* clear to do the full check here.
*/
*/
bool
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
();
jamEntry
();
FragrecordPtr
fragPtr
;
FragrecordPtr
fragPtr
;
...
@@ -341,30 +349,40 @@ Dbtup::tuxQueryTh(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32 tupV
...
@@ -341,30 +349,40 @@ Dbtup::tuxQueryTh(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32 tupV
ptrCheckGuard
(
tablePtr
,
cnoOfTablerec
,
tablerec
);
ptrCheckGuard
(
tablePtr
,
cnoOfTablerec
,
tablerec
);
PagePtr
pagePtr
;
PagePtr
pagePtr
;
pagePtr
.
i
=
pageId
;
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
;
OperationrecPtr
currOpPtr
;
currOpPtr
.
i
=
pagePtr
.
p
->
pageWord
[
pageOffset
]
;
currOpPtr
.
i
=
tuple_ptr
->
m_operation_ptr_i
;
if
(
currOpPtr
.
i
==
RNIL
)
{
if
(
currOpPtr
.
i
==
RNIL
)
{
l
jam
();
jam
();
// tuple has no operation, any scan can see it
// tuple has no operation, any scan can see it
return
true
;
return
true
;
}
}
ptrCheckGuard
(
currOpPtr
,
cnoOfOprec
,
operationrec
);
c_operation_pool
.
getPtr
(
currOpPtr
);
const
bool
sameTrans
=
const
bool
sameTrans
=
transId1
==
currOpPtr
.
p
->
transid1
&&
c_lqh
->
is_same_trans
(
currOpPtr
.
p
->
userpointer
,
transId1
,
transId2
);
transId2
==
currOpPtr
.
p
->
transid2
;
bool
res
=
false
;
bool
res
=
false
;
OperationrecPtr
loopOpPtr
=
currOpPtr
;
OperationrecPtr
loopOpPtr
=
currOpPtr
;
if
(
!
sameTrans
)
{
if
(
!
sameTrans
)
{
l
jam
();
jam
();
if
(
!
dirty
)
{
if
(
!
dirty
)
{
l
jam
();
jam
();
if
(
currOpPtr
.
p
->
prev
ActiveOp
==
RNIL
)
{
if
(
currOpPtr
.
p
->
next
ActiveOp
==
RNIL
)
{
l
jam
();
jam
();
// last op - TUX makes ACC lock request in same timeslice
// last op - TUX makes ACC lock request in same timeslice
res
=
true
;
res
=
true
;
}
}
...
@@ -372,33 +390,33 @@ Dbtup::tuxQueryTh(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32 tupV
...
@@ -372,33 +390,33 @@ Dbtup::tuxQueryTh(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32 tupV
else
{
else
{
// loop to first op (returns false)
// loop to first op (returns false)
find_savepoint
(
loopOpPtr
,
0
);
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
)
{
if
(
op_type
!=
ZINSERT
)
{
l
jam
();
jam
();
// read committed version
from the page
// read committed version
const
Uint32
origVersion
=
pagePtr
.
p
->
pageWord
[
pageOffset
+
1
]
;
const
Uint32
origVersion
=
tuple_ptr
->
get_tuple_version
()
;
if
(
origVersion
==
tupVersion
)
{
if
(
origVersion
==
tupVersion
)
{
l
jam
();
jam
();
res
=
true
;
res
=
true
;
}
}
}
}
}
}
}
}
else
{
else
{
l
jam
();
jam
();
// for own trans, ignore dirty flag
// for own trans, ignore dirty flag
if
(
find_savepoint
(
loopOpPtr
,
save
P
ointId
))
{
if
(
find_savepoint
(
loopOpPtr
,
save
p
ointId
))
{
l
jam
();
jam
();
const
Uint32
op_type
=
loopOpPtr
.
p
->
optype
;
const
Uint32
op_type
=
loopOpPtr
.
p
->
op
_struct
.
op_
type
;
if
(
op_type
!=
ZDELETE
)
{
if
(
op_type
!=
ZDELETE
)
{
l
jam
();
jam
();
// check if this op has produced the scanned version
// check if this op has produced the scanned version
Uint32
loopVersion
=
loopOpPtr
.
p
->
tupVersion
;
Uint32
loopVersion
=
loopOpPtr
.
p
->
tupVersion
;
if
(
loopVersion
==
tupVersion
)
{
if
(
loopVersion
==
tupVersion
)
{
l
jam
();
jam
();
res
=
true
;
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