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
97683c4a
Commit
97683c4a
authored
Mar 09, 2007
by
tomas@poseidon.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge poseidon.mysql.com:/home/tomas/mysql-5.0-ndb-clean
into poseidon.mysql.com:/home/tomas/mysql-5.0
parents
433d3e6c
56442970
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
227 additions
and
205 deletions
+227
-205
ndb/src/kernel/blocks/dbdict/Dbdict.cpp
ndb/src/kernel/blocks/dbdict/Dbdict.cpp
+21
-15
ndb/src/kernel/blocks/dbdict/Dbdict.hpp
ndb/src/kernel/blocks/dbdict/Dbdict.hpp
+2
-0
ndb/src/ndbapi/NdbRecAttr.cpp
ndb/src/ndbapi/NdbRecAttr.cpp
+193
-189
ndb/tools/waiter.cpp
ndb/tools/waiter.cpp
+11
-1
No files found.
ndb/src/kernel/blocks/dbdict/Dbdict.cpp
View file @
97683c4a
...
...
@@ -2910,9 +2910,7 @@ Dbdict::execCREATE_TABLE_REQ(Signal* signal){
break
;
}
if
(
getNodeState
().
getSingleUserMode
()
&&
(
refToNode
(
signal
->
getSendersBlockRef
())
!=
getNodeState
().
getSingleUserApi
()))
if
(
checkSingleUserMode
(
signal
->
getSendersBlockRef
()))
{
jam
();
parseRecord
.
errorCode
=
CreateTableRef
::
SingleUser
;
...
...
@@ -3081,9 +3079,7 @@ Dbdict::execALTER_TABLE_REQ(Signal* signal)
return
;
}
if
(
getNodeState
().
getSingleUserMode
()
&&
(
refToNode
(
signal
->
getSendersBlockRef
())
!=
getNodeState
().
getSingleUserApi
()))
if
(
checkSingleUserMode
(
signal
->
getSendersBlockRef
()))
{
jam
();
alterTableRef
(
signal
,
req
,
AlterTableRef
::
SingleUser
);
...
...
@@ -5414,9 +5410,7 @@ Dbdict::execDROP_TABLE_REQ(Signal* signal){
return
;
}
if
(
getNodeState
().
getSingleUserMode
()
&&
(
refToNode
(
signal
->
getSendersBlockRef
())
!=
getNodeState
().
getSingleUserApi
()))
if
(
checkSingleUserMode
(
signal
->
getSendersBlockRef
()))
{
jam
();
dropTableRef
(
signal
,
req
,
DropTableRef
::
SingleUser
);
...
...
@@ -6553,9 +6547,7 @@ Dbdict::execCREATE_INDX_REQ(Signal* signal)
jam
();
tmperr
=
CreateIndxRef
::
Busy
;
}
else
if
(
getNodeState
().
getSingleUserMode
()
&&
(
refToNode
(
senderRef
)
!=
getNodeState
().
getSingleUserApi
()))
else
if
(
checkSingleUserMode
(
senderRef
))
{
jam
();
tmperr
=
CreateIndxRef
::
SingleUser
;
...
...
@@ -7130,9 +7122,7 @@ Dbdict::execDROP_INDX_REQ(Signal* signal)
jam
();
tmperr
=
DropIndxRef
::
Busy
;
}
else
if
(
getNodeState
().
getSingleUserMode
()
&&
(
refToNode
(
senderRef
)
!=
getNodeState
().
getSingleUserApi
()))
else
if
(
checkSingleUserMode
(
senderRef
))
{
jam
();
tmperr
=
DropIndxRef
::
SingleUser
;
...
...
@@ -10574,4 +10564,20 @@ Dbdict::getMetaAttribute(MetaData::Attribute& attr, const MetaData::Table& table
return
0
;
}
/*
return 1 if all of the below is true
a) node in single user mode
b) senderRef is not a db node
c) senderRef nodeid is not the singleUserApi
*/
int
Dbdict
::
checkSingleUserMode
(
Uint32
senderRef
)
{
Uint32
nodeId
=
refToNode
(
senderRef
);
return
getNodeState
().
getSingleUserMode
()
&&
(
getNodeInfo
(
nodeId
).
m_type
!=
NodeInfo
::
DB
)
&&
(
nodeId
!=
getNodeState
().
getSingleUserApi
());
}
CArray
<
KeyDescriptor
>
g_key_descriptor_pool
;
ndb/src/kernel/blocks/dbdict/Dbdict.hpp
View file @
97683c4a
...
...
@@ -2003,6 +2003,8 @@ private:
int
getMetaTable
(
MetaData
::
Table
&
table
,
const
char
*
tableName
);
int
getMetaAttribute
(
MetaData
::
Attribute
&
attribute
,
const
MetaData
::
Table
&
table
,
Uint32
attributeId
);
int
getMetaAttribute
(
MetaData
::
Attribute
&
attribute
,
const
MetaData
::
Table
&
table
,
const
char
*
attributeName
);
int
checkSingleUserMode
(
Uint32
senderRef
);
};
#endif
ndb/src/ndbapi/NdbRecAttr.cpp
View file @
97683c4a
...
...
@@ -55,7 +55,7 @@ NdbRecAttr::setup(const NdbColumnImpl* anAttrInfo, char* aValue)
if
(
theStorageX
)
delete
[]
theStorageX
;
// check alignment to signal data
// a future version could check alignment per data type as well
...
...
@@ -181,7 +181,7 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r)
out
<<
"[NULL]"
;
return
out
;
}
const
NdbDictionary
::
Column
*
c
=
r
.
getColumn
();
uint
length
=
c
->
getLength
();
if
(
length
>
1
)
...
...
@@ -192,196 +192,200 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r)
if
(
j
>
0
)
out
<<
" "
;
switch
(
r
.
getType
())
{
case
NdbDictionary
:
:
Column
::
Bigunsigned
:
out
<<
r
.
u_64_value
();
break
;
case
NdbDictionary
:
:
Column
::
Bit
:
out
<<
hex
<<
"H'"
<<
r
.
u_32_value
()
<<
dec
;
break
;
case
NdbDictionary
:
:
Column
::
Unsigned
:
out
<<
r
.
u_32_value
();
break
;
case
NdbDictionary
:
:
Column
::
Smallunsigned
:
out
<<
r
.
u_short_value
();
break
;
case
NdbDictionary
:
:
Column
::
Tinyunsigned
:
out
<<
(
unsigned
)
r
.
u_char_value
();
break
;
case
NdbDictionary
:
:
Column
::
Bigint
:
out
<<
r
.
int64_value
();
break
;
case
NdbDictionary
:
:
Column
::
Int
:
out
<<
r
.
int32_value
();
break
;
case
NdbDictionary
:
:
Column
::
Smallint
:
out
<<
r
.
short_value
();
break
;
case
NdbDictionary
:
:
Column
::
Tinyint
:
out
<<
(
int
)
r
.
char_value
();
break
;
case
NdbDictionary
:
:
Column
::
Binary
:
ndbrecattr_print_string
(
out
,
"Binary"
,
r
.
aRef
(),
r
.
arraySize
());
j
=
r
.
arraySize
();
break
;
case
NdbDictionary
:
:
Column
::
Char
:
ndbrecattr_print_string
(
out
,
"Char"
,
r
.
aRef
(),
r
.
arraySize
());
j
=
length
;
break
;
case
NdbDictionary
:
:
Column
::
Varchar
:
{
unsigned
len
=
*
(
const
unsigned
char
*
)
r
.
aRef
();
ndbrecattr_print_string
(
out
,
"Varchar"
,
r
.
aRef
()
+
1
,
len
);
j
=
length
;
}
break
;
case
NdbDictionary
:
:
Column
::
Varbinary
:
{
unsigned
len
=
*
(
const
unsigned
char
*
)
r
.
aRef
();
ndbrecattr_print_string
(
out
,
"Varbinary"
,
r
.
aRef
()
+
1
,
len
);
j
=
length
;
}
break
;
case
NdbDictionary
:
:
Column
::
Float
:
out
<<
r
.
float_value
();
break
;
case
NdbDictionary
:
:
Column
::
Double
:
out
<<
r
.
double_value
();
break
;
case
NdbDictionary
:
:
Column
::
Olddecimal
:
{
short
len
=
1
+
c
->
getPrecision
()
+
(
c
->
getScale
()
>
0
);
out
.
print
(
"%.*s"
,
len
,
r
.
aRef
());
}
break
;
case
NdbDictionary
:
:
Column
::
Olddecimalunsigned
:
{
short
len
=
0
+
c
->
getPrecision
()
+
(
c
->
getScale
()
>
0
);
out
.
print
(
"%.*s"
,
len
,
r
.
aRef
());
}
break
;
case
NdbDictionary
:
:
Column
::
Decimal
:
case
NdbDictionary
:
:
Column
::
Decimalunsigned
:
goto
unknown
;
// TODO
break
;
// for dates cut-and-paste from field.cc
case
NdbDictionary
:
:
Column
::
Datetime
:
{
ulonglong
tmp
=
r
.
u_64_value
();
long
part1
,
part2
,
part3
;
part1
=
(
long
)
(
tmp
/
LL
(
1000000
));
part2
=
(
long
)
(
tmp
-
(
ulonglong
)
part1
*
LL
(
1000000
));
char
buf
[
40
];
char
*
pos
=
(
char
*
)
buf
+
19
;
*
pos
--=
0
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
(
part2
%
10
));
part2
/=
10
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
(
part2
%
10
));
part3
=
(
int
)
(
part2
/
10
);
*
pos
--=
':'
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
(
part3
%
10
));
part3
/=
10
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
(
part3
%
10
));
part3
/=
10
;
*
pos
--=
':'
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
(
part3
%
10
));
part3
/=
10
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
part3
);
*
pos
--=
'/'
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
(
part1
%
10
));
part1
/=
10
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
(
part1
%
10
));
part1
/=
10
;
*
pos
--=
'-'
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
(
part1
%
10
));
part1
/=
10
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
(
part1
%
10
));
part3
=
(
int
)
(
part1
/
10
);
*
pos
--=
'-'
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
(
part3
%
10
));
part3
/=
10
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
(
part3
%
10
));
part3
/=
10
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
(
part3
%
10
));
part3
/=
10
;
*
pos
=
(
char
)
(
'0'
+
(
char
)
part3
);
out
<<
buf
;
}
break
;
case
NdbDictionary
:
:
Column
::
Date
:
{
uint32
tmp
=
(
uint32
)
uint3korr
(
r
.
aRef
());
int
part
;
char
buf
[
40
];
char
*
pos
=
(
char
*
)
buf
+
10
;
*
pos
--=
0
;
part
=
(
int
)
(
tmp
&
31
);
*
pos
--=
(
char
)
(
'0'
+
part
%
10
);
*
pos
--=
(
char
)
(
'0'
+
part
/
10
);
*
pos
--=
'-'
;
part
=
(
int
)
(
tmp
>>
5
&
15
);
*
pos
--=
(
char
)
(
'0'
+
part
%
10
);
*
pos
--=
(
char
)
(
'0'
+
part
/
10
);
*
pos
--=
'-'
;
part
=
(
int
)
(
tmp
>>
9
);
*
pos
--=
(
char
)
(
'0'
+
part
%
10
);
part
/=
10
;
*
pos
--=
(
char
)
(
'0'
+
part
%
10
);
part
/=
10
;
*
pos
--=
(
char
)
(
'0'
+
part
%
10
);
part
/=
10
;
*
pos
=
(
char
)
(
'0'
+
part
);
out
<<
buf
;
}
break
;
case
NdbDictionary
:
:
Column
::
Time
:
{
long
tmp
=
(
long
)
sint3korr
(
r
.
aRef
());
int
hour
=
(
uint
)
(
tmp
/
10000
);
int
minute
=
(
uint
)
(
tmp
/
100
%
100
);
int
second
=
(
uint
)
(
tmp
%
100
);
char
buf
[
40
];
sprintf
(
buf
,
"%02d:%02d:%02d"
,
hour
,
minute
,
second
);
out
<<
buf
;
}
break
;
case
NdbDictionary
:
:
Column
::
Year
:
{
uint
year
=
1900
+
r
.
u_char_value
();
char
buf
[
40
];
sprintf
(
buf
,
"%04d"
,
year
);
out
<<
buf
;
}
break
;
case
NdbDictionary
:
:
Column
::
Timestamp
:
{
time_t
time
=
r
.
u_32_value
();
out
<<
(
uint
)
time
;
}
break
;
case
NdbDictionary
:
:
Column
::
Blob
:
case
NdbDictionary
:
:
Column
::
Text
:
{
// user defined aRef() may not be aligned to Uint64
NdbBlob
::
Head
head
;
memcpy
(
&
head
,
r
.
aRef
(),
sizeof
(
head
));
out
<<
head
.
length
<<
":"
;
const
unsigned
char
*
p
=
(
const
unsigned
char
*
)
r
.
aRef
()
+
sizeof
(
head
);
if
(
r
.
arraySize
()
<
sizeof
(
head
))
out
<<
"***error***"
;
// really cannot happen
else
{
unsigned
n
=
r
.
arraySize
()
-
sizeof
(
head
);
for
(
unsigned
k
=
0
;
k
<
n
&&
k
<
head
.
length
;
k
++
)
{
if
(
r
.
getType
()
==
NdbDictionary
::
Column
::
Blob
)
out
.
print
(
"%02X"
,
(
int
)
p
[
k
]);
else
out
.
print
(
"%c"
,
(
int
)
p
[
k
]);
}
}
j
=
length
;
}
switch
(
r
.
getType
()){
case
NdbDictionary
:
:
Column
::
Bigunsigned
:
out
<<
r
.
u_64_value
();
break
;
case
NdbDictionary
:
:
Column
::
Bit
:
out
<<
hex
<<
"H'"
<<
r
.
u_32_value
()
<<
dec
;
break
;
case
NdbDictionary
:
:
Column
::
Unsigned
:
out
<<
r
.
u_32_value
();
break
;
case
NdbDictionary
:
:
Column
::
Smallunsigned
:
out
<<
r
.
u_short_value
();
break
;
case
NdbDictionary
:
:
Column
::
Tinyunsigned
:
out
<<
(
unsigned
)
r
.
u_char_value
();
break
;
case
NdbDictionary
:
:
Column
::
Bigint
:
out
<<
r
.
int64_value
();
break
;
case
NdbDictionary
:
:
Column
::
Int
:
out
<<
r
.
int32_value
();
break
;
case
NdbDictionary
:
:
Column
::
Longvarchar
:
{
unsigned
len
=
uint2korr
(
r
.
aRef
());
ndbrecattr_print_string
(
out
,
"Longvarchar"
,
r
.
aRef
()
+
2
,
len
);
j
=
length
;
case
NdbDictionary
:
:
Column
::
Smallint
:
out
<<
r
.
short_value
();
break
;
case
NdbDictionary
:
:
Column
::
Tinyint
:
out
<<
(
int
)
r
.
char_value
();
break
;
case
NdbDictionary
:
:
Column
::
Binary
:
j
=
r
.
arraySize
();
ndbrecattr_print_string
(
out
,
"Binary"
,
r
.
aRef
(),
j
);
break
;
case
NdbDictionary
:
:
Column
::
Char
:
j
=
length
;
ndbrecattr_print_string
(
out
,
"Char"
,
r
.
aRef
(),
r
.
arraySize
());
break
;
case
NdbDictionary
:
:
Column
::
Varchar
:
{
unsigned
len
=
*
(
const
unsigned
char
*
)
r
.
aRef
();
ndbrecattr_print_string
(
out
,
"Varchar"
,
r
.
aRef
()
+
1
,
len
);
j
=
length
;
}
break
;
case
NdbDictionary
:
:
Column
::
Varbinary
:
{
unsigned
len
=
*
(
const
unsigned
char
*
)
r
.
aRef
();
ndbrecattr_print_string
(
out
,
"Varbinary"
,
r
.
aRef
()
+
1
,
len
);
j
=
length
;
}
break
;
case
NdbDictionary
:
:
Column
::
Float
:
out
<<
r
.
float_value
();
break
;
case
NdbDictionary
:
:
Column
::
Double
:
out
<<
r
.
double_value
();
break
;
case
NdbDictionary
:
:
Column
::
Olddecimal
:
{
short
len
=
1
+
c
->
getPrecision
()
+
(
c
->
getScale
()
>
0
);
out
.
print
(
"%.*s"
,
len
,
r
.
aRef
());
}
break
;
case
NdbDictionary
:
:
Column
::
Olddecimalunsigned
:
{
short
len
=
0
+
c
->
getPrecision
()
+
(
c
->
getScale
()
>
0
);
out
.
print
(
"%.*s"
,
len
,
r
.
aRef
());
}
break
;
case
NdbDictionary
:
:
Column
::
Decimal
:
case
NdbDictionary
:
:
Column
::
Decimalunsigned
:
goto
unknown
;
// TODO
break
;
// for dates cut-and-paste from field.cc
case
NdbDictionary
:
:
Column
::
Datetime
:
{
ulonglong
tmp
=
r
.
u_64_value
();
long
part1
,
part2
,
part3
;
part1
=
(
long
)
(
tmp
/
LL
(
1000000
));
part2
=
(
long
)
(
tmp
-
(
ulonglong
)
part1
*
LL
(
1000000
));
char
buf
[
40
];
char
*
pos
=
(
char
*
)
buf
+
19
;
*
pos
--=
0
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
(
part2
%
10
));
part2
/=
10
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
(
part2
%
10
));
part3
=
(
int
)
(
part2
/
10
);
*
pos
--=
':'
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
(
part3
%
10
));
part3
/=
10
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
(
part3
%
10
));
part3
/=
10
;
*
pos
--=
':'
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
(
part3
%
10
));
part3
/=
10
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
part3
);
*
pos
--=
'/'
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
(
part1
%
10
));
part1
/=
10
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
(
part1
%
10
));
part1
/=
10
;
*
pos
--=
'-'
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
(
part1
%
10
));
part1
/=
10
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
(
part1
%
10
));
part3
=
(
int
)
(
part1
/
10
);
*
pos
--=
'-'
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
(
part3
%
10
));
part3
/=
10
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
(
part3
%
10
));
part3
/=
10
;
*
pos
--=
(
char
)
(
'0'
+
(
char
)
(
part3
%
10
));
part3
/=
10
;
*
pos
=
(
char
)
(
'0'
+
(
char
)
part3
);
out
<<
buf
;
}
break
;
case
NdbDictionary
:
:
Column
::
Date
:
{
uint32
tmp
=
(
uint32
)
uint3korr
(
r
.
aRef
());
int
part
;
char
buf
[
40
];
char
*
pos
=
(
char
*
)
buf
+
10
;
*
pos
--=
0
;
part
=
(
int
)
(
tmp
&
31
);
*
pos
--=
(
char
)
(
'0'
+
part
%
10
);
*
pos
--=
(
char
)
(
'0'
+
part
/
10
);
*
pos
--=
'-'
;
part
=
(
int
)
(
tmp
>>
5
&
15
);
*
pos
--=
(
char
)
(
'0'
+
part
%
10
);
*
pos
--=
(
char
)
(
'0'
+
part
/
10
);
*
pos
--=
'-'
;
part
=
(
int
)
(
tmp
>>
9
);
*
pos
--=
(
char
)
(
'0'
+
part
%
10
);
part
/=
10
;
*
pos
--=
(
char
)
(
'0'
+
part
%
10
);
part
/=
10
;
*
pos
--=
(
char
)
(
'0'
+
part
%
10
);
part
/=
10
;
*
pos
=
(
char
)
(
'0'
+
part
);
out
<<
buf
;
}
break
;
case
NdbDictionary
:
:
Column
::
Time
:
{
long
tmp
=
(
long
)
sint3korr
(
r
.
aRef
());
int
hour
=
(
uint
)
(
tmp
/
10000
);
int
minute
=
(
uint
)
(
tmp
/
100
%
100
);
int
second
=
(
uint
)
(
tmp
%
100
);
char
buf
[
40
];
sprintf
(
buf
,
"%02d:%02d:%02d"
,
hour
,
minute
,
second
);
out
<<
buf
;
}
break
;
case
NdbDictionary
:
:
Column
::
Year
:
{
uint
year
=
1900
+
r
.
u_char_value
();
char
buf
[
40
];
sprintf
(
buf
,
"%04d"
,
year
);
out
<<
buf
;
}
break
;
case
NdbDictionary
:
:
Column
::
Timestamp
:
{
time_t
time
=
r
.
u_32_value
();
out
<<
(
uint
)
time
;
}
break
;
case
NdbDictionary
:
:
Column
::
Blob
:
case
NdbDictionary
:
:
Column
::
Text
:
{
// user defined aRef() may not be aligned to Uint64
NdbBlob
::
Head
head
;
memcpy
(
&
head
,
r
.
aRef
(),
sizeof
(
head
));
out
<<
head
.
length
<<
":"
;
const
unsigned
char
*
p
=
(
const
unsigned
char
*
)
r
.
aRef
()
+
sizeof
(
head
);
if
(
r
.
arraySize
()
<
sizeof
(
head
))
out
<<
"***error***"
;
// really cannot happen
else
{
unsigned
n
=
r
.
arraySize
()
-
sizeof
(
head
);
for
(
unsigned
k
=
0
;
k
<
n
&&
k
<
head
.
length
;
k
++
)
{
if
(
r
.
getType
()
==
NdbDictionary
::
Column
::
Blob
)
out
.
print
(
"%02X"
,
(
int
)
p
[
k
]);
else
out
.
print
(
"%c"
,
(
int
)
p
[
k
]);
}
break
;
unknown:
default:
/* no print functions for the rest, just print type */
out
<<
(
int
)
r
.
getType
();
j
=
length
;
if
(
j
>
1
)
out
<<
" "
<<
j
<<
" times"
;
break
;
}
j
=
length
;
}
break
;
case
NdbDictionary
:
:
Column
::
Longvarchar
:
{
unsigned
len
=
uint2korr
(
r
.
aRef
());
ndbrecattr_print_string
(
out
,
"Longvarchar"
,
r
.
aRef
()
+
2
,
len
);
j
=
length
;
}
break
;
case
NdbDictionary
:
:
Column
::
Undefined
:
case
NdbDictionary
:
:
Column
::
Mediumint
:
case
NdbDictionary
:
:
Column
::
Mediumunsigned
:
case
NdbDictionary
:
:
Column
::
Longvarbinary
:
unknown:
//default: /* no print functions for the rest, just print type */
out
<<
(
int
)
r
.
getType
();
j
=
length
;
if
(
j
>
1
)
out
<<
" "
<<
j
<<
" times"
;
break
;
}
}
if
(
length
>
1
)
...
...
ndb/tools/waiter.cpp
View file @
97683c4a
...
...
@@ -30,12 +30,14 @@ waitClusterStatus(const char* _addr, ndb_mgm_node_status _status,
unsigned
int
_timeout
);
enum
ndb_waiter_options
{
OPT_WAIT_STATUS_NOT_STARTED
=
NDB_STD_OPTIONS_LAST
OPT_WAIT_STATUS_NOT_STARTED
=
NDB_STD_OPTIONS_LAST
,
OPT_WAIT_STATUS_SINGLE_USER
};
NDB_STD_OPTS_VARS
;
static
int
_no_contact
=
0
;
static
int
_not_started
=
0
;
static
int
_single_user
=
0
;
static
int
_timeout
=
120
;
const
char
*
load_default_groups
[]
=
{
"mysql_cluster"
,
0
};
...
...
@@ -49,6 +51,10 @@ static struct my_option my_long_options[] =
{
"not-started"
,
OPT_WAIT_STATUS_NOT_STARTED
,
"Wait for cluster not started"
,
(
gptr
*
)
&
_not_started
,
(
gptr
*
)
&
_not_started
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"single-user"
,
OPT_WAIT_STATUS_SINGLE_USER
,
"Wait for cluster to enter single user mode"
,
(
gptr
*
)
&
_single_user
,
(
gptr
*
)
&
_single_user
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"timeout"
,
't'
,
"Timeout to wait"
,
(
gptr
*
)
&
_timeout
,
(
gptr
*
)
&
_timeout
,
0
,
GET_INT
,
REQUIRED_ARG
,
120
,
0
,
0
,
0
,
0
,
0
},
...
...
@@ -90,6 +96,10 @@ int main(int argc, char** argv){
{
wait_status
=
NDB_MGM_NODE_STATUS_NOT_STARTED
;
}
else
if
(
_single_user
)
{
wait_status
=
NDB_MGM_NODE_STATUS_SINGLEUSER
;
}
else
{
wait_status
=
NDB_MGM_NODE_STATUS_STARTED
;
...
...
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