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
ded6f32a
Commit
ded6f32a
authored
Jul 03, 2006
by
lars@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/users/lthalmann/bkroot/mysql-5.0-rpl
into mysql.com:/users/lthalmann/bk/MERGE/mysql-5.0-merge
parents
6036c30b
5d67b052
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
66 deletions
+78
-66
ndb/include/kernel/signaldata/LqhFrag.hpp
ndb/include/kernel/signaldata/LqhFrag.hpp
+22
-22
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+56
-44
No files found.
ndb/include/kernel/signaldata/LqhFrag.hpp
View file @
ded6f32a
...
...
@@ -104,7 +104,7 @@ class LqhFragReq {
friend
bool
printLQH_FRAG_REQ
(
FILE
*
,
const
Uint32
*
,
Uint32
,
Uint16
);
public:
STATIC_CONST
(
SignalLength
=
2
4
);
STATIC_CONST
(
SignalLength
=
2
3
);
enum
RequestInfo
{
CreateInRunning
=
0x8000000
,
...
...
@@ -115,33 +115,33 @@ private:
Uint32
senderData
;
Uint32
senderRef
;
Uint32
fragmentId
;
Uint8
requestInfo
;
Uint8
unused1
;
Uint16
noOfAttributes
;
Uint32
tableId
;
Uint32
localKeyLength
;
Uint16
maxLoadFactor
;
Uint16
minLoadFactor
;
Uint16
kValue
;
Uint8
tableType
;
// DictTabInfo::TableType
Uint8
GCPIndicator
;
Uint32
lh3DistrBits
;
Uint32
lh3PageBits
;
Uint32
noOfNullAttributes
;
Uint32
maxRowsLow
;
Uint32
maxRowsHigh
;
Uint32
minRowsLow
;
Uint32
minRowsHigh
;
Uint32
requestInfo
;
Uint32
maxLoadFactor
;
Uint32
minLoadFactor
;
Uint32
kValue
;
Uint32
schemaVersion
;
Uint32
keyLength
;
Uint32
nextLCP
;
Uint32
noOfKeyAttr
;
Uint16
noOfNewAttr
;
Uint16
noOfCharsets
;
Uint32
checksumIndicator
;
Uint32
noOfAttributeGroups
;
Uint32
startGci
;
Uint32
tableType
;
// DictTabInfo::TableType
Uint32
primaryTableId
;
// table of index or RNIL
Uint16
tableId
;
Uint16
localKeyLength
;
Uint16
lh3DistrBits
;
Uint16
lh3PageBits
;
Uint16
noOfAttributes
;
Uint16
noOfNullAttributes
;
Uint16
noOfPagesToPreAllocate
;
Uint16
keyLength
;
Uint16
noOfKeyAttr
;
Uint8
checksumIndicator
;
Uint8
GCPIndicator
;
Uint32
noOfAttributeGroups
;
Uint32
maxRowsLow
;
Uint32
maxRowsHigh
;
Uint32
minRowsLow
;
Uint32
minRowsHigh
;
};
class
LqhFragConf
{
...
...
sql/ha_ndbcluster.cc
View file @
ded6f32a
...
...
@@ -363,6 +363,7 @@ void ha_ndbcluster::records_update()
{
Ndb
*
ndb
=
get_ndb
();
struct
Ndb_statistics
stat
;
ndb
->
setDatabaseName
(
m_dbname
);
if
(
ndb_get_table_statistics
(
ndb
,
m_tabname
,
&
stat
)
==
0
){
mean_rec_length
=
stat
.
row_size
;
data_file_length
=
stat
.
fragment_memory
;
...
...
@@ -3081,6 +3082,7 @@ void ha_ndbcluster::info(uint flag)
DBUG_VOID_RETURN
;
Ndb
*
ndb
=
get_ndb
();
struct
Ndb_statistics
stat
;
ndb
->
setDatabaseName
(
m_dbname
);
if
(
current_thd
->
variables
.
ndb_use_exact_count
&&
ndb_get_table_statistics
(
ndb
,
m_tabname
,
&
stat
)
==
0
)
{
...
...
@@ -5842,62 +5844,60 @@ ndb_get_table_statistics(Ndb* ndb, const char * table,
DBUG_ENTER
(
"ndb_get_table_statistics"
);
DBUG_PRINT
(
"enter"
,
(
"table: %s"
,
table
));
NdbTransaction
*
pTrans
;
NdbError
error
;
int
retries
=
10
;
int
retry_sleep
=
30
*
1000
;
/* 30 milliseconds */
do
{
pTrans
=
ndb
->
startTransaction
();
if
(
pTrans
==
NULL
)
Uint64
rows
,
commits
,
mem
;
Uint32
size
;
Uint32
count
=
0
;
Uint64
sum_rows
=
0
;
Uint64
sum_commits
=
0
;
Uint64
sum_row_size
=
0
;
Uint64
sum_mem
=
0
;
NdbScanOperation
*
pOp
;
NdbResultSet
*
rs
;
int
check
;
if
((
pTrans
=
ndb
->
startTransaction
())
==
NULL
)
{
if
(
ndb
->
getNdbError
().
status
==
NdbError
::
TemporaryError
&&
retries
--
)
{
my_sleep
(
retry_sleep
);
continue
;
}
break
;
error
=
ndb
->
getNdbError
();
goto
retry
;
}
if
((
pOp
=
pTrans
->
getNdbScanOperation
(
table
))
==
NULL
)
{
error
=
pTrans
->
getNdbError
();
goto
retry
;
}
NdbScanOperation
*
pOp
=
pTrans
->
getNdbScanOperation
(
table
);
if
(
pOp
==
NULL
)
break
;
if
(
pOp
->
readTuples
(
NdbOperation
::
LM_CommittedRead
))
break
;
{
error
=
pOp
->
getNdbError
();
goto
retry
;
}
int
check
=
pOp
->
interpret_exit_last_row
();
if
(
check
==
-
1
)
break
;
if
(
pOp
->
interpret_exit_last_row
()
==
-
1
)
{
error
=
pOp
->
getNdbError
();
goto
retry
;
}
Uint64
rows
,
commits
,
mem
;
Uint32
size
;
pOp
->
getValue
(
NdbDictionary
::
Column
::
ROW_COUNT
,
(
char
*
)
&
rows
);
pOp
->
getValue
(
NdbDictionary
::
Column
::
COMMIT_COUNT
,
(
char
*
)
&
commits
);
pOp
->
getValue
(
NdbDictionary
::
Column
::
ROW_SIZE
,
(
char
*
)
&
size
);
pOp
->
getValue
(
NdbDictionary
::
Column
::
FRAGMENT_MEMORY
,
(
char
*
)
&
mem
);
check
=
pTrans
->
execute
(
NdbTransaction
::
NoCommit
,
NdbTransaction
::
AbortOnError
,
TRUE
);
if
(
check
==
-
1
)
if
(
pTrans
->
execute
(
NdbTransaction
::
NoCommit
,
NdbTransaction
::
AbortOnError
,
TRUE
)
==
-
1
)
{
if
(
pTrans
->
getNdbError
().
status
==
NdbError
::
TemporaryError
&&
retries
--
)
{
ndb
->
closeTransaction
(
pTrans
);
pTrans
=
0
;
my_sleep
(
retry_sleep
);
continue
;
}
break
;
error
=
pTrans
->
getNdbError
();
goto
retry
;
}
Uint32
count
=
0
;
Uint64
sum_rows
=
0
;
Uint64
sum_commits
=
0
;
Uint64
sum_row_size
=
0
;
Uint64
sum_mem
=
0
;
while
((
check
=
pOp
->
nextResult
(
TRUE
,
TRUE
))
==
0
)
{
sum_rows
+=
rows
;
...
...
@@ -5909,7 +5909,10 @@ ndb_get_table_statistics(Ndb* ndb, const char * table,
}
if
(
check
==
-
1
)
break
;
{
error
=
pOp
->
getNdbError
();
goto
retry
;
}
pOp
->
close
(
TRUE
);
...
...
@@ -5926,12 +5929,21 @@ ndb_get_table_statistics(Ndb* ndb, const char * table,
sum_mem
,
count
));
DBUG_RETURN
(
0
);
retry:
if
(
pTrans
)
{
ndb
->
closeTransaction
(
pTrans
);
pTrans
=
NULL
;
}
if
(
error
.
status
==
NdbError
::
TemporaryError
&&
retries
--
)
{
my_sleep
(
retry_sleep
);
continue
;
}
break
;
}
while
(
1
);
if
(
pTrans
)
ndb
->
closeTransaction
(
pTrans
);
DBUG_PRINT
(
"exit"
,
(
"failed"
));
DBUG_RETURN
(
-
1
);
DBUG_PRINT
(
"exit"
,
(
"failed, error %u(%s)"
,
error
.
code
,
error
.
message
));
ERR_RETURN
(
error
);
}
/*
...
...
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