Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-04-16 11:43:14+02:00, tomas@stripped +5 -0
Bug #27712 Single user mode. Creating logfile group and tablespace is allowed
mysql-test/r/ndb_single_user.result@stripped, 2007-04-16 11:43:12+02:00,
tomas@stripped +30 -0
Bug #27712 Single user mode. Creating logfile group and tablespace is allowed
mysql-test/t/ndb_single_user.test@stripped, 2007-04-16 11:43:12+02:00,
tomas@stripped +30 -0
Bug #27712 Single user mode. Creating logfile group and tablespace is allowed
storage/ndb/include/kernel/signaldata/CreateFilegroup.hpp@stripped, 2007-04-16
11:43:12+02:00, tomas@stripped +4 -2
Bug #27712 Single user mode. Creating logfile group and tablespace is allowed
storage/ndb/include/kernel/signaldata/DropFilegroup.hpp@stripped, 2007-04-16 11:43:12+02:00,
tomas@stripped +4 -2
Bug #27712 Single user mode. Creating logfile group and tablespace is allowed
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp@stripped, 2007-04-16 11:43:12+02:00,
tomas@stripped +36 -2
Bug #27712 Single user mode. Creating logfile group and tablespace is allowed
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: tomas
# Host: whalegate.ndb.mysql.com
# Root: /home/tomas/mysql-5.1-single-user
--- 1.5/storage/ndb/include/kernel/signaldata/CreateFilegroup.hpp 2007-02-21 05:41:13
+01:00
+++ 1.6/storage/ndb/include/kernel/signaldata/CreateFilegroup.hpp 2007-04-16 11:43:12
+02:00
@@ -66,7 +66,8 @@
InvalidExtentSize = 764,
InvalidUndoBufferSize = 779,
NoSuchLogfileGroup = 767,
- InvalidFilegroupVersion = 768
+ InvalidFilegroupVersion = 768,
+ SingleUser = 299
};
Uint32 senderData;
@@ -159,7 +160,8 @@
FilenameAlreadyExists = 760,
OutOfFileRecords = 751,
InvalidFileType = 750,
- NotSupportedWhenDiskless = 775
+ NotSupportedWhenDiskless = 775,
+ SingleUser = 299
};
Uint32 senderData;
--- 1.4/storage/ndb/include/kernel/signaldata/DropFilegroup.hpp 2006-12-23 20:33:29 +01:00
+++ 1.5/storage/ndb/include/kernel/signaldata/DropFilegroup.hpp 2007-04-16 11:43:12 +02:00
@@ -66,7 +66,8 @@
NotMaster = 702,
NoSuchFilegroup = 767,
FilegroupInUse = 768,
- InvalidSchemaObjectVersion = 774
+ InvalidSchemaObjectVersion = 774,
+ SingleUser = 299
};
Uint32 senderData;
@@ -152,7 +153,8 @@
NotMaster = 702,
NoSuchFile = 766,
DropUndoFileNotSupported = 769,
- InvalidSchemaObjectVersion = 774
+ InvalidSchemaObjectVersion = 774,
+ SingleUser = 299
};
Uint32 senderData;
--- 1.122/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 2007-03-23 17:15:16 +01:00
+++ 1.123/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 2007-04-16 11:43:12 +02:00
@@ -14084,6 +14084,15 @@
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 @@
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 @@
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 @@
Ptr<SchemaTransaction> trans_ptr;
if (! c_Trans.seize(trans_ptr))
{
- ref->errorCode = CreateFileRef::Busy;
+ ref->errorCode = DropFileRef::Busy;
ref->errorLine = __LINE__;
break;
}
@@ -14392,6 +14418,14 @@
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 @@
Ptr<SchemaTransaction> trans_ptr;
if (! c_Trans.seize(trans_ptr))
{
- ref->errorCode = CreateFilegroupRef::Busy;
+ ref->errorCode = DropFilegroupRef::Busy;
ref->errorLine = __LINE__;
break;
}
--- 1.6/mysql-test/r/ndb_single_user.result 2007-03-29 14:18:19 +02:00
+++ 1.7/mysql-test/r/ndb_single_user.result 2007-04-16 11:43:12 +02:00
@@ -2,7 +2,37 @@
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;
--- 1.3/mysql-test/t/ndb_single_user.test 2007-03-28 10:10:26 +02:00
+++ 1.4/mysql-test/t/ndb_single_user.test 2007-04-16 11:43:12 +02:00
@@ -20,13 +20,43 @@
--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 16M
+UNDO_BUFFER_SIZE = 1M
+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 16M
+UNDO_BUFFER_SIZE = 1M
+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
| Thread |
|---|
| • bk commit into 5.1 tree (tomas:1.2590) BUG#27712 | tomas | 16 Apr |