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
2c723aa9
Commit
2c723aa9
authored
Apr 16, 2007
by
tomas@whalegate.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #27712 Single user mode. Creating logfile group and tablespace is allowed
parent
9ca17d3c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
104 additions
and
6 deletions
+104
-6
mysql-test/r/ndb_single_user.result
mysql-test/r/ndb_single_user.result
+30
-0
mysql-test/t/ndb_single_user.test
mysql-test/t/ndb_single_user.test
+30
-0
storage/ndb/include/kernel/signaldata/CreateFilegroup.hpp
storage/ndb/include/kernel/signaldata/CreateFilegroup.hpp
+4
-2
storage/ndb/include/kernel/signaldata/DropFilegroup.hpp
storage/ndb/include/kernel/signaldata/DropFilegroup.hpp
+4
-2
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
+36
-2
No files found.
mysql-test/r/ndb_single_user.result
View file @
2c723aa9
...
...
@@ -2,7 +2,37 @@ use test;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
create table t1 (a int key, b int unique, c int) engine ndb;
ERROR HY000: Can't create table 'test.t1' (errno: 299)
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 16M
UNDO_BUFFER_SIZE = 1M
ENGINE=NDB;
ERROR HY000: Failed to create LOGFILE GROUP
show warnings;
Level Code Message
Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
Error 1516 Failed to create LOGFILE GROUP
create table t1 (a int key, b int unique, c int) engine ndb;
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 16M
UNDO_BUFFER_SIZE = 1M
ENGINE=NDB;
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 12M
ENGINE NDB;
ERROR HY000: Failed to create TABLESPACE
show warnings;
Level Code Message
Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
Error 1516 Failed to create TABLESPACE
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 12M
ENGINE NDB;
insert into t1 values (1,1,0),(2,2,0),(3,3,0),(4,4,0),(5,5,0),(6,6,0),(7,7,0),(8,8,0),(9,9,0),(10,10,0);
create table t2 as select * from t1;
select * from t1 where a = 1;
...
...
mysql-test/t/ndb_single_user.test
View file @
2c723aa9
...
...
@@ -20,13 +20,43 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
--
exec
$NDB_TOOLS_DIR
/
ndb_waiter
--
no
-
defaults
--
ndb
-
connectstring
=
"localhost:
$NDBCLUSTER_PORT
"
--
single
-
user
>>
$NDB_TOOLS_OUTPUT
# verify that we are indeed in single user mode
# and test that some operations give correct errors
--
connection
server2
--
error
1005
create
table
t1
(
a
int
key
,
b
int
unique
,
c
int
)
engine
ndb
;
# Bug #27712 Single user mode. Creating logfile group and tablespace is allowed
# - before bug fix these would succeed
--
error
1516
CREATE
LOGFILE
GROUP
lg1
ADD
UNDOFILE
'undofile.dat'
INITIAL_SIZE
16
M
UNDO_BUFFER_SIZE
=
1
M
ENGINE
=
NDB
;
show
warnings
;
# test some sql on first mysqld
--
connection
server1
create
table
t1
(
a
int
key
,
b
int
unique
,
c
int
)
engine
ndb
;
# Check that we can create logfile group
CREATE
LOGFILE
GROUP
lg1
ADD
UNDOFILE
'undofile.dat'
INITIAL_SIZE
16
M
UNDO_BUFFER_SIZE
=
1
M
ENGINE
=
NDB
;
--
connection
server2
--
error
1516
CREATE
TABLESPACE
ts1
ADD
DATAFILE
'datafile.dat'
USE
LOGFILE
GROUP lg1
INITIAL_SIZE 12M
ENGINE NDB
;
show
warnings
;
--
connection
server1
CREATE
TABLESPACE
ts1
ADD
DATAFILE
'datafile.dat'
USE
LOGFILE
GROUP lg1
INITIAL_SIZE 12M
ENGINE NDB
;
insert
into
t1
values
(
1
,
1
,
0
),(
2
,
2
,
0
),(
3
,
3
,
0
),(
4
,
4
,
0
),(
5
,
5
,
0
),(
6
,
6
,
0
),(
7
,
7
,
0
),(
8
,
8
,
0
),(
9
,
9
,
0
),(
10
,
10
,
0
);
create
table
t2
as
select
*
from
t1
;
# read with pk
...
...
storage/ndb/include/kernel/signaldata/CreateFilegroup.hpp
View file @
2c723aa9
...
...
@@ -66,7 +66,8 @@ struct CreateFilegroupRef {
InvalidExtentSize
=
764
,
InvalidUndoBufferSize
=
779
,
NoSuchLogfileGroup
=
767
,
InvalidFilegroupVersion
=
768
InvalidFilegroupVersion
=
768
,
SingleUser
=
299
};
Uint32
senderData
;
...
...
@@ -159,7 +160,8 @@ struct CreateFileRef {
FilenameAlreadyExists
=
760
,
OutOfFileRecords
=
751
,
InvalidFileType
=
750
,
NotSupportedWhenDiskless
=
775
NotSupportedWhenDiskless
=
775
,
SingleUser
=
299
};
Uint32
senderData
;
...
...
storage/ndb/include/kernel/signaldata/DropFilegroup.hpp
View file @
2c723aa9
...
...
@@ -66,7 +66,8 @@ struct DropFilegroupRef {
NotMaster
=
702
,
NoSuchFilegroup
=
767
,
FilegroupInUse
=
768
,
InvalidSchemaObjectVersion
=
774
InvalidSchemaObjectVersion
=
774
,
SingleUser
=
299
};
Uint32
senderData
;
...
...
@@ -152,7 +153,8 @@ struct DropFileRef {
NotMaster
=
702
,
NoSuchFile
=
766
,
DropUndoFileNotSupported
=
769
,
InvalidSchemaObjectVersion
=
774
InvalidSchemaObjectVersion
=
774
,
SingleUser
=
299
};
Uint32
senderData
;
...
...
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
View file @
2c723aa9
...
...
@@ -14084,6 +14084,15 @@ Dbdict::execCREATE_FILE_REQ(Signal* signal){
break
;
}
if
(
checkSingleUserMode
(
senderRef
))
{
ref
->
errorCode
=
CreateFileRef
::
SingleUser
;
ref
->
status
=
0
;
ref
->
errorKey
=
0
;
ref
->
errorLine
=
__LINE__
;
break
;
}
Ptr
<
SchemaTransaction
>
trans_ptr
;
if
(
!
c_Trans
.
seize
(
trans_ptr
)){
ref
->
errorCode
=
CreateFileRef
::
Busy
;
...
...
@@ -14189,6 +14198,15 @@ Dbdict::execCREATE_FILEGROUP_REQ(Signal* signal){
break
;
}
if
(
checkSingleUserMode
(
senderRef
))
{
ref
->
errorCode
=
CreateFilegroupRef
::
SingleUser
;
ref
->
status
=
0
;
ref
->
errorKey
=
0
;
ref
->
errorLine
=
__LINE__
;
break
;
}
Ptr
<
SchemaTransaction
>
trans_ptr
;
if
(
!
c_Trans
.
seize
(
trans_ptr
)){
ref
->
errorCode
=
CreateFilegroupRef
::
Busy
;
...
...
@@ -14291,6 +14309,14 @@ Dbdict::execDROP_FILE_REQ(Signal* signal)
break
;
}
if
(
checkSingleUserMode
(
senderRef
))
{
ref
->
errorCode
=
DropFileRef
::
SingleUser
;
ref
->
errorKey
=
0
;
ref
->
errorLine
=
__LINE__
;
break
;
}
Ptr
<
File
>
file_ptr
;
if
(
!
c_file_hash
.
find
(
file_ptr
,
objId
))
{
...
...
@@ -14309,7 +14335,7 @@ Dbdict::execDROP_FILE_REQ(Signal* signal)
Ptr
<
SchemaTransaction
>
trans_ptr
;
if
(
!
c_Trans
.
seize
(
trans_ptr
))
{
ref
->
errorCode
=
Create
FileRef
::
Busy
;
ref
->
errorCode
=
Drop
FileRef
::
Busy
;
ref
->
errorLine
=
__LINE__
;
break
;
}
...
...
@@ -14392,6 +14418,14 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal)
break
;
}
if
(
checkSingleUserMode
(
senderRef
))
{
ref
->
errorCode
=
DropFilegroupRef
::
SingleUser
;
ref
->
errorKey
=
0
;
ref
->
errorLine
=
__LINE__
;
break
;
}
Ptr
<
Filegroup
>
filegroup_ptr
;
if
(
!
c_filegroup_hash
.
find
(
filegroup_ptr
,
objId
))
{
...
...
@@ -14410,7 +14444,7 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal)
Ptr
<
SchemaTransaction
>
trans_ptr
;
if
(
!
c_Trans
.
seize
(
trans_ptr
))
{
ref
->
errorCode
=
Create
FilegroupRef
::
Busy
;
ref
->
errorCode
=
Drop
FilegroupRef
::
Busy
;
ref
->
errorLine
=
__LINE__
;
break
;
}
...
...
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