mirror of
https://github.com/MariaDB/server.git
synced 2025-08-05 13:16:09 +03:00
ndb - bug#16341
create tablespace/logfile group should "back out changes" mysql-test/r/ndb_dd_ddl.result: add testcase for bug#16341 mysql-test/t/ndb_dd_ddl.test: add testcase for bug#16341 sql/ha_ndbcluster.cc: If create data/undo file fails, check if filegroup is same version, and if it is drop it (wo/ checking error) storage/ndb/include/kernel/signaldata/CreateFilegroup.hpp: add version to createfileconf storage/ndb/include/ndbapi/NdbDictionary.hpp: Add NdbDictionary::ObjectId, that can be used to get [ id, version ] during create (only for DD object so far) storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp: add version to createfileconf storage/ndb/src/ndbapi/NdbDictionary.cpp: Add NdbDictionary::ObjectId, that can be used to get [ id, version ] during create (only for DD object so far) storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp: Add NdbDictionary::ObjectId, that can be used to get [ id, version ] during create (only for DD object so far) storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp: Add NdbDictionary::ObjectId, that can be used to get [ id, version ] during create (only for DD object so far)
This commit is contained in:
@@ -4,12 +4,12 @@ CREATE DATABASE mysqltest;
|
|||||||
**** Begin Duplicate Statement Testing ****
|
**** Begin Duplicate Statement Testing ****
|
||||||
CREATE LOGFILE GROUP lg1
|
CREATE LOGFILE GROUP lg1
|
||||||
ADD UNDOFILE 'undofile.dat'
|
ADD UNDOFILE 'undofile.dat'
|
||||||
INITIAL_SIZE 16M
|
INITIAL_SIZE 1M
|
||||||
UNDO_BUFFER_SIZE = 1M
|
UNDO_BUFFER_SIZE = 1M
|
||||||
ENGINE=NDB;
|
ENGINE=NDB;
|
||||||
CREATE LOGFILE GROUP lg2
|
CREATE LOGFILE GROUP lg2
|
||||||
ADD UNDOFILE 'undofile2.dat'
|
ADD UNDOFILE 'undofile2.dat'
|
||||||
INITIAL_SIZE 16M
|
INITIAL_SIZE 1M
|
||||||
UNDO_BUFFER_SIZE 1M
|
UNDO_BUFFER_SIZE 1M
|
||||||
ENGINE NDB;
|
ENGINE NDB;
|
||||||
ERROR HY000: Failed to create LOGFILE GROUP
|
ERROR HY000: Failed to create LOGFILE GROUP
|
||||||
@@ -19,35 +19,35 @@ Error 1296 Got error 1514 'Currently there is a limit of one logfile group' from
|
|||||||
Error 1515 Failed to create LOGFILE GROUP
|
Error 1515 Failed to create LOGFILE GROUP
|
||||||
CREATE LOGFILE GROUP lg1
|
CREATE LOGFILE GROUP lg1
|
||||||
ADD UNDOFILE 'undofile.dat'
|
ADD UNDOFILE 'undofile.dat'
|
||||||
INITIAL_SIZE 16M
|
INITIAL_SIZE 1M
|
||||||
UNDO_BUFFER_SIZE = 1M
|
UNDO_BUFFER_SIZE = 1M
|
||||||
ENGINE=NDB;
|
ENGINE=NDB;
|
||||||
ERROR HY000: Failed to create LOGFILE GROUP
|
ERROR HY000: Failed to create LOGFILE GROUP
|
||||||
ALTER LOGFILE GROUP lg1
|
ALTER LOGFILE GROUP lg1
|
||||||
ADD UNDOFILE 'undofile02.dat'
|
ADD UNDOFILE 'undofile02.dat'
|
||||||
INITIAL_SIZE 4M ENGINE NDB;
|
INITIAL_SIZE 1M ENGINE NDB;
|
||||||
ALTER LOGFILE GROUP lg1
|
ALTER LOGFILE GROUP lg1
|
||||||
ADD UNDOFILE 'undofile02.dat'
|
ADD UNDOFILE 'undofile02.dat'
|
||||||
INITIAL_SIZE 4M ENGINE=NDB;
|
INITIAL_SIZE 1M ENGINE=NDB;
|
||||||
ERROR HY000: Failed to alter: CREATE UNDOFILE
|
ERROR HY000: Failed to alter: CREATE UNDOFILE
|
||||||
CREATE TABLESPACE ts1
|
CREATE TABLESPACE ts1
|
||||||
ADD DATAFILE 'datafile.dat'
|
ADD DATAFILE 'datafile.dat'
|
||||||
USE LOGFILE GROUP lg1
|
USE LOGFILE GROUP lg1
|
||||||
INITIAL_SIZE 12M
|
INITIAL_SIZE 1M
|
||||||
ENGINE NDB;
|
ENGINE NDB;
|
||||||
CREATE TABLESPACE ts1
|
CREATE TABLESPACE ts1
|
||||||
ADD DATAFILE 'datafile.dat'
|
ADD DATAFILE 'datafile.dat'
|
||||||
USE LOGFILE GROUP lg1
|
USE LOGFILE GROUP lg1
|
||||||
INITIAL_SIZE 12M
|
INITIAL_SIZE 1M
|
||||||
ENGINE NDB;
|
ENGINE NDB;
|
||||||
ERROR HY000: Failed to create TABLESPACE
|
ERROR HY000: Failed to create TABLESPACE
|
||||||
ALTER TABLESPACE ts1
|
ALTER TABLESPACE ts1
|
||||||
ADD DATAFILE 'datafile2.dat'
|
ADD DATAFILE 'datafile2.dat'
|
||||||
INITIAL_SIZE 12M
|
INITIAL_SIZE 1M
|
||||||
ENGINE=NDB;
|
ENGINE=NDB;
|
||||||
ALTER TABLESPACE ts1
|
ALTER TABLESPACE ts1
|
||||||
ADD DATAFILE 'datafile2.dat'
|
ADD DATAFILE 'datafile2.dat'
|
||||||
INITIAL_SIZE 12M
|
INITIAL_SIZE 1M
|
||||||
ENGINE=NDB;
|
ENGINE=NDB;
|
||||||
ERROR HY000: Failed to alter: CREATE DATAFILE
|
ERROR HY000: Failed to alter: CREATE DATAFILE
|
||||||
CREATE TABLE mysqltest.t1
|
CREATE TABLE mysqltest.t1
|
||||||
@@ -94,20 +94,20 @@ DROP DATABASE IF EXISTS mysqltest;
|
|||||||
**** Begin Statment CaSe Testing ****
|
**** Begin Statment CaSe Testing ****
|
||||||
creaTE LOgfilE GrOuP lg1
|
creaTE LOgfilE GrOuP lg1
|
||||||
adD undoFILE 'undofile.dat'
|
adD undoFILE 'undofile.dat'
|
||||||
initiAL_siZE 16M
|
initiAL_siZE 1M
|
||||||
UnDo_BuFfEr_SiZe = 1M
|
UnDo_BuFfEr_SiZe = 1M
|
||||||
ENGInE=NDb;
|
ENGInE=NDb;
|
||||||
altER LOgFiLE GrOUp lg1
|
altER LOgFiLE GrOUp lg1
|
||||||
AdD UnDOfILe 'uNdOfiLe02.daT'
|
AdD UnDOfILe 'uNdOfiLe02.daT'
|
||||||
INItIAl_SIzE 4M ENgINE nDB;
|
INItIAl_SIzE 1M ENgINE nDB;
|
||||||
CrEAtE TABLEspaCE ts1
|
CrEAtE TABLEspaCE ts1
|
||||||
ADD DATAfilE 'datafile.dat'
|
ADD DATAfilE 'datafile.dat'
|
||||||
UsE LoGFiLE GRoUP lg1
|
UsE LoGFiLE GRoUP lg1
|
||||||
INITiaL_SizE 12M
|
INITiaL_SizE 1M
|
||||||
ENGiNe NDb;
|
ENGiNe NDb;
|
||||||
AlTeR tAbLeSpAcE ts1
|
AlTeR tAbLeSpAcE ts1
|
||||||
AdD DaTaFiLe 'dAtAfiLe2.daT'
|
AdD DaTaFiLe 'dAtAfiLe2.daT'
|
||||||
InItIaL_SiZe 12M
|
InItIaL_SiZe 1M
|
||||||
EnGiNe=NDB;
|
EnGiNe=NDB;
|
||||||
CREATE TABLE t1
|
CREATE TABLE t1
|
||||||
(pk1 int not null primary key, b int not null, c int not null)
|
(pk1 int not null primary key, b int not null, c int not null)
|
||||||
@@ -129,21 +129,21 @@ EnGiNe=nDb;
|
|||||||
**** Begin = And No = Testing ****
|
**** Begin = And No = Testing ****
|
||||||
CREATE LOGFILE GROUP lg1
|
CREATE LOGFILE GROUP lg1
|
||||||
ADD UNDOFILE 'undofile.dat'
|
ADD UNDOFILE 'undofile.dat'
|
||||||
INITIAL_SIZE=16M
|
INITIAL_SIZE=1M
|
||||||
UNDO_BUFFER_SIZE=1M
|
UNDO_BUFFER_SIZE=1M
|
||||||
ENGINE=NDB;
|
ENGINE=NDB;
|
||||||
ALTER LOGFILE GROUP lg1
|
ALTER LOGFILE GROUP lg1
|
||||||
ADD UNDOFILE 'undofile02.dat'
|
ADD UNDOFILE 'undofile02.dat'
|
||||||
INITIAL_SIZE=4M
|
INITIAL_SIZE=1M
|
||||||
ENGINE=NDB;
|
ENGINE=NDB;
|
||||||
CREATE TABLESPACE ts1
|
CREATE TABLESPACE ts1
|
||||||
ADD DATAFILE 'datafile.dat'
|
ADD DATAFILE 'datafile.dat'
|
||||||
USE LOGFILE GROUP lg1
|
USE LOGFILE GROUP lg1
|
||||||
INITIAL_SIZE=12M
|
INITIAL_SIZE=1M
|
||||||
ENGINE=NDB;
|
ENGINE=NDB;
|
||||||
ALTER TABLESPACE ts1
|
ALTER TABLESPACE ts1
|
||||||
ADD DATAFILE 'datafile2.dat'
|
ADD DATAFILE 'datafile2.dat'
|
||||||
INITIAL_SIZE=12M
|
INITIAL_SIZE=1M
|
||||||
ENGINE=NDB;
|
ENGINE=NDB;
|
||||||
CREATE TABLE t1
|
CREATE TABLE t1
|
||||||
(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
|
(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
|
||||||
@@ -165,21 +165,21 @@ ENGINE=NDB;
|
|||||||
|
|
||||||
CREATE LOGFILE GROUP lg1
|
CREATE LOGFILE GROUP lg1
|
||||||
ADD UNDOFILE 'undofile.dat'
|
ADD UNDOFILE 'undofile.dat'
|
||||||
INITIAL_SIZE 16M
|
INITIAL_SIZE 1M
|
||||||
UNDO_BUFFER_SIZE 1M
|
UNDO_BUFFER_SIZE 1M
|
||||||
ENGINE NDB;
|
ENGINE NDB;
|
||||||
ALTER LOGFILE GROUP lg1
|
ALTER LOGFILE GROUP lg1
|
||||||
ADD UNDOFILE 'undofile02.dat'
|
ADD UNDOFILE 'undofile02.dat'
|
||||||
INITIAL_SIZE 4M
|
INITIAL_SIZE 1M
|
||||||
ENGINE NDB;
|
ENGINE NDB;
|
||||||
CREATE TABLESPACE ts1
|
CREATE TABLESPACE ts1
|
||||||
ADD DATAFILE 'datafile.dat'
|
ADD DATAFILE 'datafile.dat'
|
||||||
USE LOGFILE GROUP lg1
|
USE LOGFILE GROUP lg1
|
||||||
INITIAL_SIZE 12M
|
INITIAL_SIZE 1M
|
||||||
ENGINE NDB;
|
ENGINE NDB;
|
||||||
ALTER TABLESPACE ts1
|
ALTER TABLESPACE ts1
|
||||||
ADD DATAFILE 'datafile2.dat'
|
ADD DATAFILE 'datafile2.dat'
|
||||||
INITIAL_SIZE 12M
|
INITIAL_SIZE 1M
|
||||||
ENGINE NDB;
|
ENGINE NDB;
|
||||||
CREATE TABLE t1
|
CREATE TABLE t1
|
||||||
(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
|
(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
|
||||||
@@ -199,3 +199,19 @@ ENGINE NDB;
|
|||||||
DROP LOGFILE GROUP lg1
|
DROP LOGFILE GROUP lg1
|
||||||
ENGINE NDB;
|
ENGINE NDB;
|
||||||
**** End = And No = ****
|
**** End = And No = ****
|
||||||
|
create table t1 (a int primary key) engine = myisam;
|
||||||
|
create logfile group lg1 add undofile '/home/jonas/src/51-work/mysql-test/var/master-data/test/t1.frm' initial_size 1M undo_buffer_size = 1M engine=ndb;;
|
||||||
|
ERROR HY000: Failed to create UNDOFILE
|
||||||
|
create logfile group lg1
|
||||||
|
add undofile 'undofile.dat'
|
||||||
|
initial_size 1M
|
||||||
|
undo_buffer_size = 1M
|
||||||
|
engine=ndb;
|
||||||
|
create tablespace ts1 add datafile '/home/jonas/src/51-work/mysql-test/var/master-data/test/t1.frm' use logfile group lg1 initial_size 1M engine ndb;;
|
||||||
|
ERROR HY000: Failed to create DATAFILE
|
||||||
|
drop tablespace ts1
|
||||||
|
engine ndb;
|
||||||
|
ERROR HY000: Failed to drop TABLESPACE
|
||||||
|
drop logfile group lg1
|
||||||
|
engine ndb;
|
||||||
|
drop table t1;
|
||||||
|
@@ -40,7 +40,7 @@ CREATE DATABASE mysqltest;
|
|||||||
|
|
||||||
CREATE LOGFILE GROUP lg1
|
CREATE LOGFILE GROUP lg1
|
||||||
ADD UNDOFILE 'undofile.dat'
|
ADD UNDOFILE 'undofile.dat'
|
||||||
INITIAL_SIZE 16M
|
INITIAL_SIZE 1M
|
||||||
UNDO_BUFFER_SIZE = 1M
|
UNDO_BUFFER_SIZE = 1M
|
||||||
ENGINE=NDB;
|
ENGINE=NDB;
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ ENGINE=NDB;
|
|||||||
--error ER_CREATE_FILEGROUP_FAILED
|
--error ER_CREATE_FILEGROUP_FAILED
|
||||||
CREATE LOGFILE GROUP lg2
|
CREATE LOGFILE GROUP lg2
|
||||||
ADD UNDOFILE 'undofile2.dat'
|
ADD UNDOFILE 'undofile2.dat'
|
||||||
INITIAL_SIZE 16M
|
INITIAL_SIZE 1M
|
||||||
UNDO_BUFFER_SIZE 1M
|
UNDO_BUFFER_SIZE 1M
|
||||||
ENGINE NDB;
|
ENGINE NDB;
|
||||||
SHOW WARNINGS;
|
SHOW WARNINGS;
|
||||||
@@ -56,42 +56,42 @@ SHOW WARNINGS;
|
|||||||
--error ER_CREATE_FILEGROUP_FAILED
|
--error ER_CREATE_FILEGROUP_FAILED
|
||||||
CREATE LOGFILE GROUP lg1
|
CREATE LOGFILE GROUP lg1
|
||||||
ADD UNDOFILE 'undofile.dat'
|
ADD UNDOFILE 'undofile.dat'
|
||||||
INITIAL_SIZE 16M
|
INITIAL_SIZE 1M
|
||||||
UNDO_BUFFER_SIZE = 1M
|
UNDO_BUFFER_SIZE = 1M
|
||||||
ENGINE=NDB;
|
ENGINE=NDB;
|
||||||
|
|
||||||
ALTER LOGFILE GROUP lg1
|
ALTER LOGFILE GROUP lg1
|
||||||
ADD UNDOFILE 'undofile02.dat'
|
ADD UNDOFILE 'undofile02.dat'
|
||||||
INITIAL_SIZE 4M ENGINE NDB;
|
INITIAL_SIZE 1M ENGINE NDB;
|
||||||
|
|
||||||
--error ER_ALTER_FILEGROUP_FAILED
|
--error ER_ALTER_FILEGROUP_FAILED
|
||||||
ALTER LOGFILE GROUP lg1
|
ALTER LOGFILE GROUP lg1
|
||||||
ADD UNDOFILE 'undofile02.dat'
|
ADD UNDOFILE 'undofile02.dat'
|
||||||
INITIAL_SIZE 4M ENGINE=NDB;
|
INITIAL_SIZE 1M ENGINE=NDB;
|
||||||
|
|
||||||
CREATE TABLESPACE ts1
|
CREATE TABLESPACE ts1
|
||||||
ADD DATAFILE 'datafile.dat'
|
ADD DATAFILE 'datafile.dat'
|
||||||
USE LOGFILE GROUP lg1
|
USE LOGFILE GROUP lg1
|
||||||
INITIAL_SIZE 12M
|
INITIAL_SIZE 1M
|
||||||
ENGINE NDB;
|
ENGINE NDB;
|
||||||
|
|
||||||
--error ER_CREATE_FILEGROUP_FAILED
|
--error ER_CREATE_FILEGROUP_FAILED
|
||||||
CREATE TABLESPACE ts1
|
CREATE TABLESPACE ts1
|
||||||
ADD DATAFILE 'datafile.dat'
|
ADD DATAFILE 'datafile.dat'
|
||||||
USE LOGFILE GROUP lg1
|
USE LOGFILE GROUP lg1
|
||||||
INITIAL_SIZE 12M
|
INITIAL_SIZE 1M
|
||||||
ENGINE NDB;
|
ENGINE NDB;
|
||||||
|
|
||||||
|
|
||||||
ALTER TABLESPACE ts1
|
ALTER TABLESPACE ts1
|
||||||
ADD DATAFILE 'datafile2.dat'
|
ADD DATAFILE 'datafile2.dat'
|
||||||
INITIAL_SIZE 12M
|
INITIAL_SIZE 1M
|
||||||
ENGINE=NDB;
|
ENGINE=NDB;
|
||||||
|
|
||||||
--error ER_ALTER_FILEGROUP_FAILED
|
--error ER_ALTER_FILEGROUP_FAILED
|
||||||
ALTER TABLESPACE ts1
|
ALTER TABLESPACE ts1
|
||||||
ADD DATAFILE 'datafile2.dat'
|
ADD DATAFILE 'datafile2.dat'
|
||||||
INITIAL_SIZE 12M
|
INITIAL_SIZE 1M
|
||||||
ENGINE=NDB;
|
ENGINE=NDB;
|
||||||
|
|
||||||
CREATE TABLE mysqltest.t1
|
CREATE TABLE mysqltest.t1
|
||||||
@@ -155,23 +155,23 @@ DROP DATABASE IF EXISTS mysqltest;
|
|||||||
|
|
||||||
creaTE LOgfilE GrOuP lg1
|
creaTE LOgfilE GrOuP lg1
|
||||||
adD undoFILE 'undofile.dat'
|
adD undoFILE 'undofile.dat'
|
||||||
initiAL_siZE 16M
|
initiAL_siZE 1M
|
||||||
UnDo_BuFfEr_SiZe = 1M
|
UnDo_BuFfEr_SiZe = 1M
|
||||||
ENGInE=NDb;
|
ENGInE=NDb;
|
||||||
|
|
||||||
altER LOgFiLE GrOUp lg1
|
altER LOgFiLE GrOUp lg1
|
||||||
AdD UnDOfILe 'uNdOfiLe02.daT'
|
AdD UnDOfILe 'uNdOfiLe02.daT'
|
||||||
INItIAl_SIzE 4M ENgINE nDB;
|
INItIAl_SIzE 1M ENgINE nDB;
|
||||||
|
|
||||||
CrEAtE TABLEspaCE ts1
|
CrEAtE TABLEspaCE ts1
|
||||||
ADD DATAfilE 'datafile.dat'
|
ADD DATAfilE 'datafile.dat'
|
||||||
UsE LoGFiLE GRoUP lg1
|
UsE LoGFiLE GRoUP lg1
|
||||||
INITiaL_SizE 12M
|
INITiaL_SizE 1M
|
||||||
ENGiNe NDb;
|
ENGiNe NDb;
|
||||||
|
|
||||||
AlTeR tAbLeSpAcE ts1
|
AlTeR tAbLeSpAcE ts1
|
||||||
AdD DaTaFiLe 'dAtAfiLe2.daT'
|
AdD DaTaFiLe 'dAtAfiLe2.daT'
|
||||||
InItIaL_SiZe 12M
|
InItIaL_SiZe 1M
|
||||||
EnGiNe=NDB;
|
EnGiNe=NDB;
|
||||||
|
|
||||||
CREATE TABLE t1
|
CREATE TABLE t1
|
||||||
@@ -203,24 +203,24 @@ EnGiNe=nDb;
|
|||||||
|
|
||||||
CREATE LOGFILE GROUP lg1
|
CREATE LOGFILE GROUP lg1
|
||||||
ADD UNDOFILE 'undofile.dat'
|
ADD UNDOFILE 'undofile.dat'
|
||||||
INITIAL_SIZE=16M
|
INITIAL_SIZE=1M
|
||||||
UNDO_BUFFER_SIZE=1M
|
UNDO_BUFFER_SIZE=1M
|
||||||
ENGINE=NDB;
|
ENGINE=NDB;
|
||||||
|
|
||||||
ALTER LOGFILE GROUP lg1
|
ALTER LOGFILE GROUP lg1
|
||||||
ADD UNDOFILE 'undofile02.dat'
|
ADD UNDOFILE 'undofile02.dat'
|
||||||
INITIAL_SIZE=4M
|
INITIAL_SIZE=1M
|
||||||
ENGINE=NDB;
|
ENGINE=NDB;
|
||||||
|
|
||||||
CREATE TABLESPACE ts1
|
CREATE TABLESPACE ts1
|
||||||
ADD DATAFILE 'datafile.dat'
|
ADD DATAFILE 'datafile.dat'
|
||||||
USE LOGFILE GROUP lg1
|
USE LOGFILE GROUP lg1
|
||||||
INITIAL_SIZE=12M
|
INITIAL_SIZE=1M
|
||||||
ENGINE=NDB;
|
ENGINE=NDB;
|
||||||
|
|
||||||
ALTER TABLESPACE ts1
|
ALTER TABLESPACE ts1
|
||||||
ADD DATAFILE 'datafile2.dat'
|
ADD DATAFILE 'datafile2.dat'
|
||||||
INITIAL_SIZE=12M
|
INITIAL_SIZE=1M
|
||||||
ENGINE=NDB;
|
ENGINE=NDB;
|
||||||
|
|
||||||
CREATE TABLE t1
|
CREATE TABLE t1
|
||||||
@@ -250,24 +250,24 @@ ENGINE=NDB;
|
|||||||
|
|
||||||
CREATE LOGFILE GROUP lg1
|
CREATE LOGFILE GROUP lg1
|
||||||
ADD UNDOFILE 'undofile.dat'
|
ADD UNDOFILE 'undofile.dat'
|
||||||
INITIAL_SIZE 16M
|
INITIAL_SIZE 1M
|
||||||
UNDO_BUFFER_SIZE 1M
|
UNDO_BUFFER_SIZE 1M
|
||||||
ENGINE NDB;
|
ENGINE NDB;
|
||||||
|
|
||||||
ALTER LOGFILE GROUP lg1
|
ALTER LOGFILE GROUP lg1
|
||||||
ADD UNDOFILE 'undofile02.dat'
|
ADD UNDOFILE 'undofile02.dat'
|
||||||
INITIAL_SIZE 4M
|
INITIAL_SIZE 1M
|
||||||
ENGINE NDB;
|
ENGINE NDB;
|
||||||
|
|
||||||
CREATE TABLESPACE ts1
|
CREATE TABLESPACE ts1
|
||||||
ADD DATAFILE 'datafile.dat'
|
ADD DATAFILE 'datafile.dat'
|
||||||
USE LOGFILE GROUP lg1
|
USE LOGFILE GROUP lg1
|
||||||
INITIAL_SIZE 12M
|
INITIAL_SIZE 1M
|
||||||
ENGINE NDB;
|
ENGINE NDB;
|
||||||
|
|
||||||
ALTER TABLESPACE ts1
|
ALTER TABLESPACE ts1
|
||||||
ADD DATAFILE 'datafile2.dat'
|
ADD DATAFILE 'datafile2.dat'
|
||||||
INITIAL_SIZE 12M
|
INITIAL_SIZE 1M
|
||||||
ENGINE NDB;
|
ENGINE NDB;
|
||||||
|
|
||||||
CREATE TABLE t1
|
CREATE TABLE t1
|
||||||
@@ -297,5 +297,30 @@ ENGINE NDB;
|
|||||||
--echo **** End = And No = ****
|
--echo **** End = And No = ****
|
||||||
############ End = And No = ##################
|
############ End = And No = ##################
|
||||||
|
|
||||||
# End 5.1 test
|
###
|
||||||
|
#
|
||||||
|
# bug#16341
|
||||||
|
create table t1 (a int primary key) engine = myisam;
|
||||||
|
|
||||||
|
--error ER_CREATE_FILEGROUP_FAILED
|
||||||
|
--eval create logfile group lg1 add undofile '$MYSQLTEST_VARDIR/master-data/test/t1.frm' initial_size 1M undo_buffer_size = 1M engine=ndb;
|
||||||
|
|
||||||
|
create logfile group lg1
|
||||||
|
add undofile 'undofile.dat'
|
||||||
|
initial_size 1M
|
||||||
|
undo_buffer_size = 1M
|
||||||
|
engine=ndb;
|
||||||
|
|
||||||
|
--error ER_CREATE_FILEGROUP_FAILED
|
||||||
|
--eval create tablespace ts1 add datafile '$MYSQLTEST_VARDIR/master-data/test/t1.frm' use logfile group lg1 initial_size 1M engine ndb;
|
||||||
|
|
||||||
|
--error ER_DROP_FILEGROUP_FAILED
|
||||||
|
drop tablespace ts1
|
||||||
|
engine ndb;
|
||||||
|
|
||||||
|
drop logfile group lg1
|
||||||
|
engine ndb;
|
||||||
|
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
# End 5.1 test
|
||||||
|
@@ -9947,7 +9947,8 @@ int ndbcluster_alter_tablespace(THD* thd, st_alter_tablespace *info)
|
|||||||
{
|
{
|
||||||
DBUG_RETURN(HA_ERR_NO_CONNECTION);
|
DBUG_RETURN(HA_ERR_NO_CONNECTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NdbError err;
|
||||||
NDBDICT *dict = ndb->getDictionary();
|
NDBDICT *dict = ndb->getDictionary();
|
||||||
int error;
|
int error;
|
||||||
const char * errmsg;
|
const char * errmsg;
|
||||||
@@ -9960,6 +9961,7 @@ int ndbcluster_alter_tablespace(THD* thd, st_alter_tablespace *info)
|
|||||||
|
|
||||||
NdbDictionary::Tablespace ndb_ts;
|
NdbDictionary::Tablespace ndb_ts;
|
||||||
NdbDictionary::Datafile ndb_df;
|
NdbDictionary::Datafile ndb_df;
|
||||||
|
NdbDictionary::ObjectId objid;
|
||||||
if (set_up_tablespace(info, &ndb_ts))
|
if (set_up_tablespace(info, &ndb_ts))
|
||||||
{
|
{
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
@@ -9969,7 +9971,7 @@ int ndbcluster_alter_tablespace(THD* thd, st_alter_tablespace *info)
|
|||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
}
|
}
|
||||||
errmsg= "TABLESPACE";
|
errmsg= "TABLESPACE";
|
||||||
if (dict->createTablespace(ndb_ts))
|
if (dict->createTablespace(ndb_ts, &objid))
|
||||||
{
|
{
|
||||||
DBUG_PRINT("error", ("createTablespace returned %d", error));
|
DBUG_PRINT("error", ("createTablespace returned %d", error));
|
||||||
goto ndberror;
|
goto ndberror;
|
||||||
@@ -9978,8 +9980,17 @@ int ndbcluster_alter_tablespace(THD* thd, st_alter_tablespace *info)
|
|||||||
errmsg= "DATAFILE";
|
errmsg= "DATAFILE";
|
||||||
if (dict->createDatafile(ndb_df))
|
if (dict->createDatafile(ndb_df))
|
||||||
{
|
{
|
||||||
|
err= dict->getNdbError();
|
||||||
|
NdbDictionary::Tablespace tmp= dict->getTablespace(ndb_ts.getName());
|
||||||
|
if (dict->getNdbError().code == 0 &&
|
||||||
|
tmp.getObjectId() == objid.getObjectId() &&
|
||||||
|
tmp.getObjectVersion() == objid.getObjectVersion())
|
||||||
|
{
|
||||||
|
dict->dropTablespace(tmp);
|
||||||
|
}
|
||||||
|
|
||||||
DBUG_PRINT("error", ("createDatafile returned %d", error));
|
DBUG_PRINT("error", ("createDatafile returned %d", error));
|
||||||
goto ndberror;
|
goto ndberror2;
|
||||||
}
|
}
|
||||||
is_tablespace= 1;
|
is_tablespace= 1;
|
||||||
break;
|
break;
|
||||||
@@ -10033,6 +10044,7 @@ int ndbcluster_alter_tablespace(THD* thd, st_alter_tablespace *info)
|
|||||||
error= ER_CREATE_FILEGROUP_FAILED;
|
error= ER_CREATE_FILEGROUP_FAILED;
|
||||||
NdbDictionary::LogfileGroup ndb_lg;
|
NdbDictionary::LogfileGroup ndb_lg;
|
||||||
NdbDictionary::Undofile ndb_uf;
|
NdbDictionary::Undofile ndb_uf;
|
||||||
|
NdbDictionary::ObjectId objid;
|
||||||
if (info->undo_file_name == NULL)
|
if (info->undo_file_name == NULL)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@@ -10045,7 +10057,7 @@ int ndbcluster_alter_tablespace(THD* thd, st_alter_tablespace *info)
|
|||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
}
|
}
|
||||||
errmsg= "LOGFILE GROUP";
|
errmsg= "LOGFILE GROUP";
|
||||||
if (dict->createLogfileGroup(ndb_lg))
|
if (dict->createLogfileGroup(ndb_lg, &objid))
|
||||||
{
|
{
|
||||||
goto ndberror;
|
goto ndberror;
|
||||||
}
|
}
|
||||||
@@ -10057,7 +10069,15 @@ int ndbcluster_alter_tablespace(THD* thd, st_alter_tablespace *info)
|
|||||||
errmsg= "UNDOFILE";
|
errmsg= "UNDOFILE";
|
||||||
if (dict->createUndofile(ndb_uf))
|
if (dict->createUndofile(ndb_uf))
|
||||||
{
|
{
|
||||||
goto ndberror;
|
err= dict->getNdbError();
|
||||||
|
NdbDictionary::LogfileGroup tmp= dict->getLogfileGroup(ndb_lg.getName());
|
||||||
|
if (dict->getNdbError().code == 0 &&
|
||||||
|
tmp.getObjectId() == objid.getObjectId() &&
|
||||||
|
tmp.getObjectVersion() == objid.getObjectVersion())
|
||||||
|
{
|
||||||
|
dict->dropLogfileGroup(tmp);
|
||||||
|
}
|
||||||
|
goto ndberror2;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -10134,7 +10154,8 @@ int ndbcluster_alter_tablespace(THD* thd, st_alter_tablespace *info)
|
|||||||
DBUG_RETURN(FALSE);
|
DBUG_RETURN(FALSE);
|
||||||
|
|
||||||
ndberror:
|
ndberror:
|
||||||
const NdbError err= dict->getNdbError();
|
err= dict->getNdbError();
|
||||||
|
ndberror2:
|
||||||
ERR_PRINT(err);
|
ERR_PRINT(err);
|
||||||
ndb_to_mysql_error(&err);
|
ndb_to_mysql_error(&err);
|
||||||
|
|
||||||
|
@@ -193,6 +193,7 @@ struct CreateFileConf {
|
|||||||
Uint32 senderData;
|
Uint32 senderData;
|
||||||
Uint32 senderRef;
|
Uint32 senderRef;
|
||||||
Uint32 fileId;
|
Uint32 fileId;
|
||||||
|
Uint32 fileVersion;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -163,6 +163,31 @@ public:
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Dictionary; // Forward declaration
|
||||||
|
|
||||||
|
class ObjectId : public Object
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ObjectId();
|
||||||
|
virtual ~ObjectId();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get status of object
|
||||||
|
*/
|
||||||
|
virtual Status getObjectStatus() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get version of object
|
||||||
|
*/
|
||||||
|
virtual int getObjectVersion() const;
|
||||||
|
|
||||||
|
virtual int getObjectId() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
friend class Dictionary;
|
||||||
|
class NdbDictObjectImpl & m_impl;
|
||||||
|
};
|
||||||
|
|
||||||
class Table; // forward declaration
|
class Table; // forward declaration
|
||||||
class Tablespace; // forward declaration
|
class Tablespace; // forward declaration
|
||||||
// class NdbEventOperation; // forward declaration
|
// class NdbEventOperation; // forward declaration
|
||||||
@@ -1781,20 +1806,20 @@ public:
|
|||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int createLogfileGroup(const LogfileGroup &);
|
int createLogfileGroup(const LogfileGroup &, ObjectId* = 0);
|
||||||
int dropLogfileGroup(const LogfileGroup&);
|
int dropLogfileGroup(const LogfileGroup&);
|
||||||
LogfileGroup getLogfileGroup(const char * name);
|
LogfileGroup getLogfileGroup(const char * name);
|
||||||
|
|
||||||
int createTablespace(const Tablespace &);
|
int createTablespace(const Tablespace &, ObjectId* = 0);
|
||||||
int dropTablespace(const Tablespace&);
|
int dropTablespace(const Tablespace&);
|
||||||
Tablespace getTablespace(const char * name);
|
Tablespace getTablespace(const char * name);
|
||||||
Tablespace getTablespace(Uint32 tablespaceId);
|
Tablespace getTablespace(Uint32 tablespaceId);
|
||||||
|
|
||||||
int createDatafile(const Datafile &, bool overwrite_existing = false);
|
int createDatafile(const Datafile &, bool overwrite_existing = false, ObjectId* = 0);
|
||||||
int dropDatafile(const Datafile&);
|
int dropDatafile(const Datafile&);
|
||||||
Datafile getDatafile(Uint32 node, const char * path);
|
Datafile getDatafile(Uint32 node, const char * path);
|
||||||
|
|
||||||
int createUndofile(const Undofile &, bool overwrite_existing = false);
|
int createUndofile(const Undofile &, bool overwrite_existing = false, ObjectId * = 0);
|
||||||
int dropUndofile(const Undofile&);
|
int dropUndofile(const Undofile&);
|
||||||
Undofile getUndofile(Uint32 node, const char * path);
|
Undofile getUndofile(Uint32 node, const char * path);
|
||||||
|
|
||||||
|
@@ -13985,7 +13985,8 @@ Dbdict::trans_commit_complete_done(Signal* signal,
|
|||||||
conf->senderRef = reference();
|
conf->senderRef = reference();
|
||||||
conf->senderData = trans_ptr.p->m_senderData;
|
conf->senderData = trans_ptr.p->m_senderData;
|
||||||
conf->fileId = f_ptr.p->key;
|
conf->fileId = f_ptr.p->key;
|
||||||
|
conf->fileVersion = f_ptr.p->m_version;
|
||||||
|
|
||||||
//@todo check api failed
|
//@todo check api failed
|
||||||
sendSignal(trans_ptr.p->m_senderRef, GSN_CREATE_FILE_CONF, signal,
|
sendSignal(trans_ptr.p->m_senderRef, GSN_CREATE_FILE_CONF, signal,
|
||||||
CreateFileConf::SignalLength, JBB);
|
CreateFileConf::SignalLength, JBB);
|
||||||
|
@@ -18,6 +18,32 @@
|
|||||||
#include "NdbDictionaryImpl.hpp"
|
#include "NdbDictionaryImpl.hpp"
|
||||||
#include <NdbOut.hpp>
|
#include <NdbOut.hpp>
|
||||||
|
|
||||||
|
NdbDictionary::ObjectId::ObjectId()
|
||||||
|
: m_impl(* new NdbDictObjectImpl(NdbDictionary::Object::TypeUndefined))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
NdbDictionary::ObjectId::~ObjectId()
|
||||||
|
{
|
||||||
|
NdbDictObjectImpl * tmp = &m_impl;
|
||||||
|
delete tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
NdbDictionary::Object::Status
|
||||||
|
NdbDictionary::ObjectId::getObjectStatus() const {
|
||||||
|
return m_impl.m_status;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
NdbDictionary::ObjectId::getObjectVersion() const {
|
||||||
|
return m_impl.m_version;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
NdbDictionary::ObjectId::getObjectId() const {
|
||||||
|
return m_impl.m_id;
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************
|
/*****************************************************************
|
||||||
* Column facade
|
* Column facade
|
||||||
*/
|
*/
|
||||||
@@ -1799,17 +1825,22 @@ operator<<(NdbOut& out, const NdbDictionary::Column& col)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
NdbDictionary::Dictionary::createLogfileGroup(const LogfileGroup & lg){
|
NdbDictionary::Dictionary::createLogfileGroup(const LogfileGroup & lg,
|
||||||
return m_impl.createLogfileGroup(NdbLogfileGroupImpl::getImpl(lg));
|
ObjectId * obj)
|
||||||
|
{
|
||||||
|
return m_impl.createLogfileGroup(NdbLogfileGroupImpl::getImpl(lg),
|
||||||
|
obj ? &obj->m_impl : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
NdbDictionary::Dictionary::dropLogfileGroup(const LogfileGroup & lg){
|
NdbDictionary::Dictionary::dropLogfileGroup(const LogfileGroup & lg)
|
||||||
|
{
|
||||||
return m_impl.dropLogfileGroup(NdbLogfileGroupImpl::getImpl(lg));
|
return m_impl.dropLogfileGroup(NdbLogfileGroupImpl::getImpl(lg));
|
||||||
}
|
}
|
||||||
|
|
||||||
NdbDictionary::LogfileGroup
|
NdbDictionary::LogfileGroup
|
||||||
NdbDictionary::Dictionary::getLogfileGroup(const char * name){
|
NdbDictionary::Dictionary::getLogfileGroup(const char * name)
|
||||||
|
{
|
||||||
NdbDictionary::LogfileGroup tmp;
|
NdbDictionary::LogfileGroup tmp;
|
||||||
m_impl.m_receiver.get_filegroup(NdbLogfileGroupImpl::getImpl(tmp),
|
m_impl.m_receiver.get_filegroup(NdbLogfileGroupImpl::getImpl(tmp),
|
||||||
NdbDictionary::Object::LogfileGroup, name);
|
NdbDictionary::Object::LogfileGroup, name);
|
||||||
@@ -1817,17 +1848,22 @@ NdbDictionary::Dictionary::getLogfileGroup(const char * name){
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
NdbDictionary::Dictionary::createTablespace(const Tablespace & lg){
|
NdbDictionary::Dictionary::createTablespace(const Tablespace & lg,
|
||||||
return m_impl.createTablespace(NdbTablespaceImpl::getImpl(lg));
|
ObjectId * obj)
|
||||||
|
{
|
||||||
|
return m_impl.createTablespace(NdbTablespaceImpl::getImpl(lg),
|
||||||
|
obj ? &obj->m_impl : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
NdbDictionary::Dictionary::dropTablespace(const Tablespace & lg){
|
NdbDictionary::Dictionary::dropTablespace(const Tablespace & lg)
|
||||||
|
{
|
||||||
return m_impl.dropTablespace(NdbTablespaceImpl::getImpl(lg));
|
return m_impl.dropTablespace(NdbTablespaceImpl::getImpl(lg));
|
||||||
}
|
}
|
||||||
|
|
||||||
NdbDictionary::Tablespace
|
NdbDictionary::Tablespace
|
||||||
NdbDictionary::Dictionary::getTablespace(const char * name){
|
NdbDictionary::Dictionary::getTablespace(const char * name)
|
||||||
|
{
|
||||||
NdbDictionary::Tablespace tmp;
|
NdbDictionary::Tablespace tmp;
|
||||||
m_impl.m_receiver.get_filegroup(NdbTablespaceImpl::getImpl(tmp),
|
m_impl.m_receiver.get_filegroup(NdbTablespaceImpl::getImpl(tmp),
|
||||||
NdbDictionary::Object::Tablespace, name);
|
NdbDictionary::Object::Tablespace, name);
|
||||||
@@ -1835,7 +1871,8 @@ NdbDictionary::Dictionary::getTablespace(const char * name){
|
|||||||
}
|
}
|
||||||
|
|
||||||
NdbDictionary::Tablespace
|
NdbDictionary::Tablespace
|
||||||
NdbDictionary::Dictionary::getTablespace(Uint32 tablespaceId){
|
NdbDictionary::Dictionary::getTablespace(Uint32 tablespaceId)
|
||||||
|
{
|
||||||
NdbDictionary::Tablespace tmp;
|
NdbDictionary::Tablespace tmp;
|
||||||
m_impl.m_receiver.get_filegroup(NdbTablespaceImpl::getImpl(tmp),
|
m_impl.m_receiver.get_filegroup(NdbTablespaceImpl::getImpl(tmp),
|
||||||
NdbDictionary::Object::Tablespace,
|
NdbDictionary::Object::Tablespace,
|
||||||
@@ -1844,17 +1881,24 @@ NdbDictionary::Dictionary::getTablespace(Uint32 tablespaceId){
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
NdbDictionary::Dictionary::createDatafile(const Datafile & df, bool force){
|
NdbDictionary::Dictionary::createDatafile(const Datafile & df,
|
||||||
return m_impl.createDatafile(NdbDatafileImpl::getImpl(df), force);
|
bool force,
|
||||||
|
ObjectId * obj)
|
||||||
|
{
|
||||||
|
return m_impl.createDatafile(NdbDatafileImpl::getImpl(df),
|
||||||
|
force,
|
||||||
|
obj ? &obj->m_impl : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
NdbDictionary::Dictionary::dropDatafile(const Datafile& df){
|
NdbDictionary::Dictionary::dropDatafile(const Datafile& df)
|
||||||
|
{
|
||||||
return m_impl.dropDatafile(NdbDatafileImpl::getImpl(df));
|
return m_impl.dropDatafile(NdbDatafileImpl::getImpl(df));
|
||||||
}
|
}
|
||||||
|
|
||||||
NdbDictionary::Datafile
|
NdbDictionary::Datafile
|
||||||
NdbDictionary::Dictionary::getDatafile(Uint32 node, const char * path){
|
NdbDictionary::Dictionary::getDatafile(Uint32 node, const char * path)
|
||||||
|
{
|
||||||
NdbDictionary::Datafile tmp;
|
NdbDictionary::Datafile tmp;
|
||||||
m_impl.m_receiver.get_file(NdbDatafileImpl::getImpl(tmp),
|
m_impl.m_receiver.get_file(NdbDatafileImpl::getImpl(tmp),
|
||||||
NdbDictionary::Object::Datafile,
|
NdbDictionary::Object::Datafile,
|
||||||
@@ -1863,17 +1907,24 @@ NdbDictionary::Dictionary::getDatafile(Uint32 node, const char * path){
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
NdbDictionary::Dictionary::createUndofile(const Undofile & df, bool force){
|
NdbDictionary::Dictionary::createUndofile(const Undofile & df,
|
||||||
return m_impl.createUndofile(NdbUndofileImpl::getImpl(df), force);
|
bool force,
|
||||||
|
ObjectId * obj)
|
||||||
|
{
|
||||||
|
return m_impl.createUndofile(NdbUndofileImpl::getImpl(df),
|
||||||
|
force,
|
||||||
|
obj ? &obj->m_impl : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
NdbDictionary::Dictionary::dropUndofile(const Undofile& df){
|
NdbDictionary::Dictionary::dropUndofile(const Undofile& df)
|
||||||
|
{
|
||||||
return m_impl.dropUndofile(NdbUndofileImpl::getImpl(df));
|
return m_impl.dropUndofile(NdbUndofileImpl::getImpl(df));
|
||||||
}
|
}
|
||||||
|
|
||||||
NdbDictionary::Undofile
|
NdbDictionary::Undofile
|
||||||
NdbDictionary::Dictionary::getUndofile(Uint32 node, const char * path){
|
NdbDictionary::Dictionary::getUndofile(Uint32 node, const char * path)
|
||||||
|
{
|
||||||
NdbDictionary::Undofile tmp;
|
NdbDictionary::Undofile tmp;
|
||||||
m_impl.m_receiver.get_file(NdbUndofileImpl::getImpl(tmp),
|
m_impl.m_receiver.get_file(NdbUndofileImpl::getImpl(tmp),
|
||||||
NdbDictionary::Object::Undofile,
|
NdbDictionary::Object::Undofile,
|
||||||
|
@@ -4391,19 +4391,23 @@ NdbUndofileImpl::assign(const NdbUndofileImpl& org)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
NdbDictionaryImpl::createDatafile(const NdbDatafileImpl & file, bool force){
|
NdbDictionaryImpl::createDatafile(const NdbDatafileImpl & file,
|
||||||
|
bool force,
|
||||||
|
NdbDictObjectImpl* obj)
|
||||||
|
|
||||||
|
{
|
||||||
DBUG_ENTER("NdbDictionaryImpl::createDatafile");
|
DBUG_ENTER("NdbDictionaryImpl::createDatafile");
|
||||||
NdbFilegroupImpl tmp(NdbDictionary::Object::Tablespace);
|
NdbFilegroupImpl tmp(NdbDictionary::Object::Tablespace);
|
||||||
if(file.m_filegroup_version != ~(Uint32)0){
|
if(file.m_filegroup_version != ~(Uint32)0){
|
||||||
tmp.m_id = file.m_filegroup_id;
|
tmp.m_id = file.m_filegroup_id;
|
||||||
tmp.m_version = file.m_filegroup_version;
|
tmp.m_version = file.m_filegroup_version;
|
||||||
DBUG_RETURN(m_receiver.create_file(file, tmp));
|
DBUG_RETURN(m_receiver.create_file(file, tmp, force, obj));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(m_receiver.get_filegroup(tmp, NdbDictionary::Object::Tablespace,
|
if(m_receiver.get_filegroup(tmp, NdbDictionary::Object::Tablespace,
|
||||||
file.m_filegroup_name.c_str()) == 0){
|
file.m_filegroup_name.c_str()) == 0){
|
||||||
DBUG_RETURN(m_receiver.create_file(file, tmp, force));
|
DBUG_RETURN(m_receiver.create_file(file, tmp, force, obj));
|
||||||
}
|
}
|
||||||
DBUG_RETURN(-1);
|
DBUG_RETURN(-1);
|
||||||
}
|
}
|
||||||
@@ -4414,53 +4418,65 @@ NdbDictionaryImpl::dropDatafile(const NdbDatafileImpl & file){
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
NdbDictionaryImpl::createUndofile(const NdbUndofileImpl & file, bool force){
|
NdbDictionaryImpl::createUndofile(const NdbUndofileImpl & file,
|
||||||
|
bool force,
|
||||||
|
NdbDictObjectImpl* obj)
|
||||||
|
{
|
||||||
DBUG_ENTER("NdbDictionaryImpl::createUndofile");
|
DBUG_ENTER("NdbDictionaryImpl::createUndofile");
|
||||||
NdbFilegroupImpl tmp(NdbDictionary::Object::LogfileGroup);
|
NdbFilegroupImpl tmp(NdbDictionary::Object::LogfileGroup);
|
||||||
if(file.m_filegroup_version != ~(Uint32)0){
|
if(file.m_filegroup_version != ~(Uint32)0){
|
||||||
tmp.m_id = file.m_filegroup_id;
|
tmp.m_id = file.m_filegroup_id;
|
||||||
tmp.m_version = file.m_filegroup_version;
|
tmp.m_version = file.m_filegroup_version;
|
||||||
DBUG_RETURN(m_receiver.create_file(file, tmp));
|
DBUG_RETURN(m_receiver.create_file(file, tmp, force, obj));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(m_receiver.get_filegroup(tmp, NdbDictionary::Object::LogfileGroup,
|
if(m_receiver.get_filegroup(tmp, NdbDictionary::Object::LogfileGroup,
|
||||||
file.m_filegroup_name.c_str()) == 0){
|
file.m_filegroup_name.c_str()) == 0){
|
||||||
DBUG_RETURN(m_receiver.create_file(file, tmp, force));
|
DBUG_RETURN(m_receiver.create_file(file, tmp, force, obj));
|
||||||
}
|
}
|
||||||
DBUG_PRINT("info", ("Failed to find filegroup"));
|
DBUG_PRINT("info", ("Failed to find filegroup"));
|
||||||
DBUG_RETURN(-1);
|
DBUG_RETURN(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
NdbDictionaryImpl::dropUndofile(const NdbUndofileImpl & file){
|
NdbDictionaryImpl::dropUndofile(const NdbUndofileImpl & file)
|
||||||
|
{
|
||||||
return m_receiver.drop_file(file);
|
return m_receiver.drop_file(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
NdbDictionaryImpl::createTablespace(const NdbTablespaceImpl & fg){
|
NdbDictionaryImpl::createTablespace(const NdbTablespaceImpl & fg,
|
||||||
return m_receiver.create_filegroup(fg);
|
NdbDictObjectImpl* obj)
|
||||||
|
{
|
||||||
|
return m_receiver.create_filegroup(fg, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
NdbDictionaryImpl::dropTablespace(const NdbTablespaceImpl & fg){
|
NdbDictionaryImpl::dropTablespace(const NdbTablespaceImpl & fg)
|
||||||
|
{
|
||||||
return m_receiver.drop_filegroup(fg);
|
return m_receiver.drop_filegroup(fg);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
NdbDictionaryImpl::createLogfileGroup(const NdbLogfileGroupImpl & fg){
|
NdbDictionaryImpl::createLogfileGroup(const NdbLogfileGroupImpl & fg,
|
||||||
return m_receiver.create_filegroup(fg);
|
NdbDictObjectImpl* obj)
|
||||||
|
{
|
||||||
|
return m_receiver.create_filegroup(fg, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
NdbDictionaryImpl::dropLogfileGroup(const NdbLogfileGroupImpl & fg){
|
NdbDictionaryImpl::dropLogfileGroup(const NdbLogfileGroupImpl & fg)
|
||||||
|
{
|
||||||
return m_receiver.drop_filegroup(fg);
|
return m_receiver.drop_filegroup(fg);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
NdbDictInterface::create_file(const NdbFileImpl & file,
|
NdbDictInterface::create_file(const NdbFileImpl & file,
|
||||||
const NdbFilegroupImpl & group,
|
const NdbFilegroupImpl & group,
|
||||||
bool overwrite){
|
bool overwrite,
|
||||||
|
NdbDictObjectImpl* obj)
|
||||||
|
{
|
||||||
DBUG_ENTER("NdbDictInterface::create_file");
|
DBUG_ENTER("NdbDictInterface::create_file");
|
||||||
UtilBufferWriter w(m_buffer);
|
UtilBufferWriter w(m_buffer);
|
||||||
DictFilegroupInfo::File f; f.init();
|
DictFilegroupInfo::File f; f.init();
|
||||||
@@ -4503,23 +4519,39 @@ NdbDictInterface::create_file(const NdbFileImpl & file,
|
|||||||
Send signal without time-out since creating files can take a very long
|
Send signal without time-out since creating files can take a very long
|
||||||
time if the file is very big.
|
time if the file is very big.
|
||||||
*/
|
*/
|
||||||
DBUG_RETURN(dictSignal(&tSignal, ptr, 1,
|
int ret = dictSignal(&tSignal, ptr, 1,
|
||||||
0, // master
|
0, // master
|
||||||
WAIT_CREATE_INDX_REQ,
|
WAIT_CREATE_INDX_REQ,
|
||||||
-1, 100,
|
-1, 100,
|
||||||
err));
|
err);
|
||||||
|
|
||||||
|
if (ret == 0 && obj)
|
||||||
|
{
|
||||||
|
Uint32* data = (Uint32*)m_buffer.get_data();
|
||||||
|
obj->m_id = data[0];
|
||||||
|
obj->m_version = data[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
DBUG_RETURN(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
NdbDictInterface::execCREATE_FILE_CONF(NdbApiSignal * signal,
|
NdbDictInterface::execCREATE_FILE_CONF(NdbApiSignal * signal,
|
||||||
LinearSectionPtr ptr[3])
|
LinearSectionPtr ptr[3])
|
||||||
{
|
{
|
||||||
|
const CreateFileConf* conf=
|
||||||
|
CAST_CONSTPTR(CreateFileConf, signal->getDataPtr());
|
||||||
|
m_buffer.grow(4 * 2); // 2 words
|
||||||
|
Uint32* data = (Uint32*)m_buffer.get_data();
|
||||||
|
data[0] = conf->fileId;
|
||||||
|
data[1] = conf->fileVersion;
|
||||||
|
|
||||||
m_waiter.signal(NO_WAIT);
|
m_waiter.signal(NO_WAIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
NdbDictInterface::execCREATE_FILE_REF(NdbApiSignal * signal,
|
NdbDictInterface::execCREATE_FILE_REF(NdbApiSignal * signal,
|
||||||
LinearSectionPtr ptr[3])
|
LinearSectionPtr ptr[3])
|
||||||
{
|
{
|
||||||
const CreateFileRef* ref =
|
const CreateFileRef* ref =
|
||||||
CAST_CONSTPTR(CreateFileRef, signal->getDataPtr());
|
CAST_CONSTPTR(CreateFileRef, signal->getDataPtr());
|
||||||
@@ -4529,7 +4561,8 @@ NdbDictInterface::execCREATE_FILE_REF(NdbApiSignal * signal,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
NdbDictInterface::drop_file(const NdbFileImpl & file){
|
NdbDictInterface::drop_file(const NdbFileImpl & file)
|
||||||
|
{
|
||||||
DBUG_ENTER("NdbDictInterface::drop_file");
|
DBUG_ENTER("NdbDictInterface::drop_file");
|
||||||
NdbApiSignal tSignal(m_reference);
|
NdbApiSignal tSignal(m_reference);
|
||||||
tSignal.theReceiversBlockNumber = DBDICT;
|
tSignal.theReceiversBlockNumber = DBDICT;
|
||||||
@@ -4569,7 +4602,9 @@ NdbDictInterface::execDROP_FILE_REF(NdbApiSignal * signal,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
NdbDictInterface::create_filegroup(const NdbFilegroupImpl & group){
|
NdbDictInterface::create_filegroup(const NdbFilegroupImpl & group,
|
||||||
|
NdbDictObjectImpl* obj)
|
||||||
|
{
|
||||||
DBUG_ENTER("NdbDictInterface::create_filegroup");
|
DBUG_ENTER("NdbDictInterface::create_filegroup");
|
||||||
UtilBufferWriter w(m_buffer);
|
UtilBufferWriter w(m_buffer);
|
||||||
DictFilegroupInfo::Filegroup fg; fg.init();
|
DictFilegroupInfo::Filegroup fg; fg.init();
|
||||||
@@ -4638,17 +4673,32 @@ NdbDictInterface::create_filegroup(const NdbFilegroupImpl & group){
|
|||||||
ptr[0].sz = m_buffer.length() / 4;
|
ptr[0].sz = m_buffer.length() / 4;
|
||||||
|
|
||||||
int err[] = { CreateFilegroupRef::Busy, CreateFilegroupRef::NotMaster, 0};
|
int err[] = { CreateFilegroupRef::Busy, CreateFilegroupRef::NotMaster, 0};
|
||||||
DBUG_RETURN(dictSignal(&tSignal, ptr, 1,
|
int ret = dictSignal(&tSignal, ptr, 1,
|
||||||
0, // master
|
0, // master
|
||||||
WAIT_CREATE_INDX_REQ,
|
WAIT_CREATE_INDX_REQ,
|
||||||
DICT_WAITFOR_TIMEOUT, 100,
|
DICT_WAITFOR_TIMEOUT, 100,
|
||||||
err));
|
err);
|
||||||
|
|
||||||
|
if (ret == 0 && obj)
|
||||||
|
{
|
||||||
|
Uint32* data = (Uint32*)m_buffer.get_data();
|
||||||
|
obj->m_id = data[0];
|
||||||
|
obj->m_version = data[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
DBUG_RETURN(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
NdbDictInterface::execCREATE_FILEGROUP_CONF(NdbApiSignal * signal,
|
NdbDictInterface::execCREATE_FILEGROUP_CONF(NdbApiSignal * signal,
|
||||||
LinearSectionPtr ptr[3])
|
LinearSectionPtr ptr[3])
|
||||||
{
|
{
|
||||||
|
const CreateFilegroupConf* conf=
|
||||||
|
CAST_CONSTPTR(CreateFilegroupConf, signal->getDataPtr());
|
||||||
|
m_buffer.grow(4 * 2); // 2 words
|
||||||
|
Uint32* data = (Uint32*)m_buffer.get_data();
|
||||||
|
data[0] = conf->filegroupId;
|
||||||
|
data[1] = conf->filegroupVersion;
|
||||||
m_waiter.signal(NO_WAIT);
|
m_waiter.signal(NO_WAIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4664,7 +4714,8 @@ NdbDictInterface::execCREATE_FILEGROUP_REF(NdbApiSignal * signal,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
NdbDictInterface::drop_filegroup(const NdbFilegroupImpl & group){
|
NdbDictInterface::drop_filegroup(const NdbFilegroupImpl & group)
|
||||||
|
{
|
||||||
DBUG_ENTER("NdbDictInterface::drop_filegroup");
|
DBUG_ENTER("NdbDictInterface::drop_filegroup");
|
||||||
NdbApiSignal tSignal(m_reference);
|
NdbApiSignal tSignal(m_reference);
|
||||||
tSignal.theReceiversBlockNumber = DBDICT;
|
tSignal.theReceiversBlockNumber = DBDICT;
|
||||||
|
@@ -52,6 +52,8 @@ protected:
|
|||||||
m_status(NdbDictionary::Object::New) {
|
m_status(NdbDictionary::Object::New) {
|
||||||
m_id = -1;
|
m_id = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
friend class NdbDictionary::ObjectId;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -468,9 +470,10 @@ public:
|
|||||||
static int parseFilegroupInfo(NdbFilegroupImpl &dst,
|
static int parseFilegroupInfo(NdbFilegroupImpl &dst,
|
||||||
const Uint32 * data, Uint32 len);
|
const Uint32 * data, Uint32 len);
|
||||||
|
|
||||||
int create_file(const NdbFileImpl &, const NdbFilegroupImpl&, bool overwrite = false);
|
int create_file(const NdbFileImpl &, const NdbFilegroupImpl&,
|
||||||
|
bool overwrite, NdbDictObjectImpl*);
|
||||||
int drop_file(const NdbFileImpl &);
|
int drop_file(const NdbFileImpl &);
|
||||||
int create_filegroup(const NdbFilegroupImpl &);
|
int create_filegroup(const NdbFilegroupImpl &, NdbDictObjectImpl*);
|
||||||
int drop_filegroup(const NdbFilegroupImpl &);
|
int drop_filegroup(const NdbFilegroupImpl &);
|
||||||
|
|
||||||
int get_filegroup(NdbFilegroupImpl&, NdbDictionary::Object::Type, Uint32);
|
int get_filegroup(NdbFilegroupImpl&, NdbDictionary::Object::Type, Uint32);
|
||||||
@@ -622,17 +625,17 @@ public:
|
|||||||
NdbEventImpl * getBlobEvent(const NdbEventImpl& ev, uint col_no);
|
NdbEventImpl * getBlobEvent(const NdbEventImpl& ev, uint col_no);
|
||||||
NdbEventImpl * getEventImpl(const char * internalName);
|
NdbEventImpl * getEventImpl(const char * internalName);
|
||||||
|
|
||||||
int createDatafile(const NdbDatafileImpl &, bool force = false);
|
int createDatafile(const NdbDatafileImpl &, bool force, NdbDictObjectImpl*);
|
||||||
int dropDatafile(const NdbDatafileImpl &);
|
int dropDatafile(const NdbDatafileImpl &);
|
||||||
int createUndofile(const NdbUndofileImpl &, bool force = false);
|
int createUndofile(const NdbUndofileImpl &, bool force, NdbDictObjectImpl*);
|
||||||
int dropUndofile(const NdbUndofileImpl &);
|
int dropUndofile(const NdbUndofileImpl &);
|
||||||
|
|
||||||
int createTablespace(const NdbTablespaceImpl &);
|
int createTablespace(const NdbTablespaceImpl &, NdbDictObjectImpl*);
|
||||||
int dropTablespace(const NdbTablespaceImpl &);
|
int dropTablespace(const NdbTablespaceImpl &);
|
||||||
|
|
||||||
int createLogfileGroup(const NdbLogfileGroupImpl &);
|
int createLogfileGroup(const NdbLogfileGroupImpl &, NdbDictObjectImpl*);
|
||||||
int dropLogfileGroup(const NdbLogfileGroupImpl &);
|
int dropLogfileGroup(const NdbLogfileGroupImpl &);
|
||||||
|
|
||||||
const NdbError & getNdbError() const;
|
const NdbError & getNdbError() const;
|
||||||
NdbError m_error;
|
NdbError m_error;
|
||||||
Uint32 m_local_table_data_size;
|
Uint32 m_local_table_data_size;
|
||||||
|
Reference in New Issue
Block a user