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
6b9f1ef2
Commit
6b9f1ef2
authored
Mar 09, 2007
by
unknown
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
d6bd171f
9565e8cd
Changes
4
Expand all
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 @
6b9f1ef2
...
@@ -2910,9 +2910,7 @@ Dbdict::execCREATE_TABLE_REQ(Signal* signal){
...
@@ -2910,9 +2910,7 @@ Dbdict::execCREATE_TABLE_REQ(Signal* signal){
break
;
break
;
}
}
if
(
getNodeState
().
getSingleUserMode
()
&&
if
(
checkSingleUserMode
(
signal
->
getSendersBlockRef
()))
(
refToNode
(
signal
->
getSendersBlockRef
())
!=
getNodeState
().
getSingleUserApi
()))
{
{
jam
();
jam
();
parseRecord
.
errorCode
=
CreateTableRef
::
SingleUser
;
parseRecord
.
errorCode
=
CreateTableRef
::
SingleUser
;
...
@@ -3081,9 +3079,7 @@ Dbdict::execALTER_TABLE_REQ(Signal* signal)
...
@@ -3081,9 +3079,7 @@ Dbdict::execALTER_TABLE_REQ(Signal* signal)
return
;
return
;
}
}
if
(
getNodeState
().
getSingleUserMode
()
&&
if
(
checkSingleUserMode
(
signal
->
getSendersBlockRef
()))
(
refToNode
(
signal
->
getSendersBlockRef
())
!=
getNodeState
().
getSingleUserApi
()))
{
{
jam
();
jam
();
alterTableRef
(
signal
,
req
,
AlterTableRef
::
SingleUser
);
alterTableRef
(
signal
,
req
,
AlterTableRef
::
SingleUser
);
...
@@ -5414,9 +5410,7 @@ Dbdict::execDROP_TABLE_REQ(Signal* signal){
...
@@ -5414,9 +5410,7 @@ Dbdict::execDROP_TABLE_REQ(Signal* signal){
return
;
return
;
}
}
if
(
getNodeState
().
getSingleUserMode
()
&&
if
(
checkSingleUserMode
(
signal
->
getSendersBlockRef
()))
(
refToNode
(
signal
->
getSendersBlockRef
())
!=
getNodeState
().
getSingleUserApi
()))
{
{
jam
();
jam
();
dropTableRef
(
signal
,
req
,
DropTableRef
::
SingleUser
);
dropTableRef
(
signal
,
req
,
DropTableRef
::
SingleUser
);
...
@@ -6553,9 +6547,7 @@ Dbdict::execCREATE_INDX_REQ(Signal* signal)
...
@@ -6553,9 +6547,7 @@ Dbdict::execCREATE_INDX_REQ(Signal* signal)
jam
();
jam
();
tmperr
=
CreateIndxRef
::
Busy
;
tmperr
=
CreateIndxRef
::
Busy
;
}
}
else
if
(
getNodeState
().
getSingleUserMode
()
&&
else
if
(
checkSingleUserMode
(
senderRef
))
(
refToNode
(
senderRef
)
!=
getNodeState
().
getSingleUserApi
()))
{
{
jam
();
jam
();
tmperr
=
CreateIndxRef
::
SingleUser
;
tmperr
=
CreateIndxRef
::
SingleUser
;
...
@@ -7130,9 +7122,7 @@ Dbdict::execDROP_INDX_REQ(Signal* signal)
...
@@ -7130,9 +7122,7 @@ Dbdict::execDROP_INDX_REQ(Signal* signal)
jam
();
jam
();
tmperr
=
DropIndxRef
::
Busy
;
tmperr
=
DropIndxRef
::
Busy
;
}
}
else
if
(
getNodeState
().
getSingleUserMode
()
&&
else
if
(
checkSingleUserMode
(
senderRef
))
(
refToNode
(
senderRef
)
!=
getNodeState
().
getSingleUserApi
()))
{
{
jam
();
jam
();
tmperr
=
DropIndxRef
::
SingleUser
;
tmperr
=
DropIndxRef
::
SingleUser
;
...
@@ -10574,4 +10564,20 @@ Dbdict::getMetaAttribute(MetaData::Attribute& attr, const MetaData::Table& table
...
@@ -10574,4 +10564,20 @@ Dbdict::getMetaAttribute(MetaData::Attribute& attr, const MetaData::Table& table
return
0
;
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
;
CArray
<
KeyDescriptor
>
g_key_descriptor_pool
;
ndb/src/kernel/blocks/dbdict/Dbdict.hpp
View file @
6b9f1ef2
...
@@ -2003,6 +2003,8 @@ private:
...
@@ -2003,6 +2003,8 @@ private:
int
getMetaTable
(
MetaData
::
Table
&
table
,
const
char
*
tableName
);
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
,
Uint32
attributeId
);
int
getMetaAttribute
(
MetaData
::
Attribute
&
attribute
,
const
MetaData
::
Table
&
table
,
const
char
*
attributeName
);
int
getMetaAttribute
(
MetaData
::
Attribute
&
attribute
,
const
MetaData
::
Table
&
table
,
const
char
*
attributeName
);
int
checkSingleUserMode
(
Uint32
senderRef
);
};
};
#endif
#endif
ndb/src/ndbapi/NdbRecAttr.cpp
View file @
6b9f1ef2
This diff is collapsed.
Click to expand it.
ndb/tools/waiter.cpp
View file @
6b9f1ef2
...
@@ -30,12 +30,14 @@ waitClusterStatus(const char* _addr, ndb_mgm_node_status _status,
...
@@ -30,12 +30,14 @@ waitClusterStatus(const char* _addr, ndb_mgm_node_status _status,
unsigned
int
_timeout
);
unsigned
int
_timeout
);
enum
ndb_waiter_options
{
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
;
NDB_STD_OPTS_VARS
;
static
int
_no_contact
=
0
;
static
int
_no_contact
=
0
;
static
int
_not_started
=
0
;
static
int
_not_started
=
0
;
static
int
_single_user
=
0
;
static
int
_timeout
=
120
;
static
int
_timeout
=
120
;
const
char
*
load_default_groups
[]
=
{
"mysql_cluster"
,
0
};
const
char
*
load_default_groups
[]
=
{
"mysql_cluster"
,
0
};
...
@@ -49,6 +51,10 @@ static struct my_option my_long_options[] =
...
@@ -49,6 +51,10 @@ static struct my_option my_long_options[] =
{
"not-started"
,
OPT_WAIT_STATUS_NOT_STARTED
,
"Wait for cluster not started"
,
{
"not-started"
,
OPT_WAIT_STATUS_NOT_STARTED
,
"Wait for cluster not started"
,
(
gptr
*
)
&
_not_started
,
(
gptr
*
)
&
_not_started
,
0
,
(
gptr
*
)
&
_not_started
,
(
gptr
*
)
&
_not_started
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
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"
,
{
"timeout"
,
't'
,
"Timeout to wait"
,
(
gptr
*
)
&
_timeout
,
(
gptr
*
)
&
_timeout
,
0
,
(
gptr
*
)
&
_timeout
,
(
gptr
*
)
&
_timeout
,
0
,
GET_INT
,
REQUIRED_ARG
,
120
,
0
,
0
,
0
,
0
,
0
},
GET_INT
,
REQUIRED_ARG
,
120
,
0
,
0
,
0
,
0
,
0
},
...
@@ -90,6 +96,10 @@ int main(int argc, char** argv){
...
@@ -90,6 +96,10 @@ int main(int argc, char** argv){
{
{
wait_status
=
NDB_MGM_NODE_STATUS_NOT_STARTED
;
wait_status
=
NDB_MGM_NODE_STATUS_NOT_STARTED
;
}
}
else
if
(
_single_user
)
{
wait_status
=
NDB_MGM_NODE_STATUS_SINGLEUSER
;
}
else
else
{
{
wait_status
=
NDB_MGM_NODE_STATUS_STARTED
;
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