Commit 9fe96d8f authored by unknown's avatar unknown
Browse files

Merge perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new

into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb


sql/ha_ndbcluster.cc:
  Auto merged
storage/ndb/src/kernel/blocks/ERROR_codes.txt:
  Auto merged
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
  Auto merged
support-files/mysql.spec.sh:
  Auto merged
parents 725ab9df 0907b70b
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
#! /bin/sh

path=`dirname $0`
. "$path/SETUP.sh"

extra_flags="$fast_cflags $max_cflags -g"
extra_configs="$max_configs --with-ndb-test --with-ndb-ccflags="-DERROR_INSERT""

. "$path/FINISH.sh"
+37 −21
Original line number Diff line number Diff line
@@ -4,12 +4,12 @@ CREATE DATABASE mysqltest;
**** Begin Duplicate Statement Testing ****
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 16M
INITIAL_SIZE 1M
UNDO_BUFFER_SIZE = 1M
ENGINE=NDB;
CREATE LOGFILE GROUP lg2
ADD UNDOFILE 'undofile2.dat'
INITIAL_SIZE 16M
INITIAL_SIZE 1M
UNDO_BUFFER_SIZE 1M
ENGINE NDB;
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
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 16M
INITIAL_SIZE 1M
UNDO_BUFFER_SIZE = 1M
ENGINE=NDB;
ERROR HY000: Failed to create LOGFILE GROUP
ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE 4M ENGINE NDB;
INITIAL_SIZE 1M ENGINE NDB;
ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE 4M ENGINE=NDB;
INITIAL_SIZE 1M ENGINE=NDB;
ERROR HY000: Failed to alter: CREATE UNDOFILE
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 12M
INITIAL_SIZE 1M
ENGINE NDB;
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 12M
INITIAL_SIZE 1M
ENGINE NDB;
ERROR HY000: Failed to create TABLESPACE
ALTER TABLESPACE ts1
ADD DATAFILE 'datafile2.dat'
INITIAL_SIZE 12M
INITIAL_SIZE 1M
ENGINE=NDB;
ALTER TABLESPACE ts1
ADD DATAFILE 'datafile2.dat'
INITIAL_SIZE 12M
INITIAL_SIZE 1M
ENGINE=NDB;
ERROR HY000: Failed to alter:  CREATE DATAFILE
CREATE TABLE mysqltest.t1
@@ -94,20 +94,20 @@ DROP DATABASE IF EXISTS mysqltest;
**** Begin Statment CaSe Testing ****
creaTE LOgfilE GrOuP lg1
adD undoFILE 'undofile.dat'
initiAL_siZE 16M
initiAL_siZE 1M
UnDo_BuFfEr_SiZe = 1M
ENGInE=NDb;
altER LOgFiLE GrOUp lg1
AdD UnDOfILe 'uNdOfiLe02.daT'
INItIAl_SIzE 4M ENgINE nDB;
INItIAl_SIzE 1M ENgINE nDB;
CrEAtE TABLEspaCE ts1
ADD DATAfilE 'datafile.dat'
UsE LoGFiLE GRoUP lg1
INITiaL_SizE 12M
INITiaL_SizE 1M
ENGiNe NDb;
AlTeR tAbLeSpAcE ts1
AdD DaTaFiLe 'dAtAfiLe2.daT'
InItIaL_SiZe 12M
InItIaL_SiZe 1M
EnGiNe=NDB;
CREATE TABLE t1
(pk1 int not null primary key, b int not null, c int not null)
@@ -129,21 +129,21 @@ EnGiNe=nDb;
**** Begin = And No = Testing ****
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE=16M
INITIAL_SIZE=1M
UNDO_BUFFER_SIZE=1M
ENGINE=NDB;
ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE=4M 
INITIAL_SIZE=1M 
ENGINE=NDB;
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE=12M
INITIAL_SIZE=1M
ENGINE=NDB;
ALTER TABLESPACE ts1
ADD DATAFILE 'datafile2.dat'
INITIAL_SIZE=12M
INITIAL_SIZE=1M
ENGINE=NDB;
CREATE TABLE t1
(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
@@ -165,21 +165,21 @@ ENGINE=NDB;

CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 16M
INITIAL_SIZE 1M
UNDO_BUFFER_SIZE 1M
ENGINE NDB;
ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE 4M
INITIAL_SIZE 1M
ENGINE NDB;
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 12M
INITIAL_SIZE 1M
ENGINE NDB;
ALTER TABLESPACE ts1
ADD DATAFILE 'datafile2.dat'
INITIAL_SIZE 12M
INITIAL_SIZE 1M
ENGINE NDB;
CREATE TABLE t1
(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
@@ -199,3 +199,19 @@ ENGINE NDB;
DROP LOGFILE GROUP lg1
ENGINE NDB;
**** End = And No =  ****
create table t1 (a int primary key) engine = myisam;
create logfile group lg1 add undofile 'MYSQLTEST_VARDIR/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 'MYSQLTEST_VARDIR/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;
+49 −22
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ CREATE DATABASE mysqltest;

CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 16M
INITIAL_SIZE 1M
UNDO_BUFFER_SIZE = 1M
ENGINE=NDB;

@@ -48,7 +48,7 @@ ENGINE=NDB;
--error ER_CREATE_FILEGROUP_FAILED
CREATE LOGFILE GROUP lg2
ADD UNDOFILE 'undofile2.dat'
INITIAL_SIZE 16M
INITIAL_SIZE 1M
UNDO_BUFFER_SIZE 1M
ENGINE NDB;
SHOW WARNINGS;
@@ -56,42 +56,42 @@ SHOW WARNINGS;
--error ER_CREATE_FILEGROUP_FAILED
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 16M
INITIAL_SIZE 1M
UNDO_BUFFER_SIZE = 1M
ENGINE=NDB;

ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE 4M ENGINE NDB;
INITIAL_SIZE 1M ENGINE NDB;

--error ER_ALTER_FILEGROUP_FAILED
ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE 4M ENGINE=NDB;
INITIAL_SIZE 1M ENGINE=NDB;

CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 12M
INITIAL_SIZE 1M
ENGINE NDB;

--error ER_CREATE_FILEGROUP_FAILED
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 12M
INITIAL_SIZE 1M
ENGINE NDB;


ALTER TABLESPACE ts1
ADD DATAFILE 'datafile2.dat'
INITIAL_SIZE 12M
INITIAL_SIZE 1M
ENGINE=NDB;

--error ER_ALTER_FILEGROUP_FAILED
ALTER TABLESPACE ts1
ADD DATAFILE 'datafile2.dat'
INITIAL_SIZE 12M
INITIAL_SIZE 1M
ENGINE=NDB;

CREATE TABLE mysqltest.t1
@@ -155,23 +155,23 @@ DROP DATABASE IF EXISTS mysqltest;

creaTE LOgfilE GrOuP lg1
adD undoFILE 'undofile.dat'
initiAL_siZE 16M
initiAL_siZE 1M
UnDo_BuFfEr_SiZe = 1M
ENGInE=NDb;

altER LOgFiLE GrOUp lg1
AdD UnDOfILe 'uNdOfiLe02.daT'
INItIAl_SIzE 4M ENgINE nDB;
INItIAl_SIzE 1M ENgINE nDB;

CrEAtE TABLEspaCE ts1
ADD DATAfilE 'datafile.dat'
UsE LoGFiLE GRoUP lg1
INITiaL_SizE 12M
INITiaL_SizE 1M
ENGiNe NDb;

AlTeR tAbLeSpAcE ts1
AdD DaTaFiLe 'dAtAfiLe2.daT'
InItIaL_SiZe 12M
InItIaL_SiZe 1M
EnGiNe=NDB;

CREATE TABLE t1
@@ -203,24 +203,24 @@ EnGiNe=nDb;

CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE=16M
INITIAL_SIZE=1M
UNDO_BUFFER_SIZE=1M
ENGINE=NDB;

ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE=4M 
INITIAL_SIZE=1M 
ENGINE=NDB;

CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE=12M
INITIAL_SIZE=1M
ENGINE=NDB;

ALTER TABLESPACE ts1
ADD DATAFILE 'datafile2.dat'
INITIAL_SIZE=12M
INITIAL_SIZE=1M
ENGINE=NDB;

CREATE TABLE t1
@@ -250,24 +250,24 @@ ENGINE=NDB;

CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 16M
INITIAL_SIZE 1M
UNDO_BUFFER_SIZE 1M
ENGINE NDB;

ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE 4M
INITIAL_SIZE 1M
ENGINE NDB;

CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 12M
INITIAL_SIZE 1M
ENGINE NDB;

ALTER TABLESPACE ts1
ADD DATAFILE 'datafile2.dat'
INITIAL_SIZE 12M
INITIAL_SIZE 1M
ENGINE NDB;

CREATE TABLE t1
@@ -297,5 +297,32 @@ ENGINE NDB;
--echo **** End = And No =  ****
############ End = And No = ##################

# End 5.1 test
###
#
# bug#16341
create table t1 (a int primary key) engine = myisam;

--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--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;

--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--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
+27 −6
Original line number Diff line number Diff line
@@ -9983,6 +9983,7 @@ int ndbcluster_alter_tablespace(THD* thd, st_alter_tablespace *info)
    DBUG_RETURN(HA_ERR_NO_CONNECTION);
  }

  NdbError err;
  NDBDICT *dict = ndb->getDictionary();
  int error;
  const char * errmsg;
@@ -9995,6 +9996,7 @@ int ndbcluster_alter_tablespace(THD* thd, st_alter_tablespace *info)
    
    NdbDictionary::Tablespace ndb_ts;
    NdbDictionary::Datafile ndb_df;
    NdbDictionary::ObjectId objid;
    if (set_up_tablespace(info, &ndb_ts))
    {
      DBUG_RETURN(1);
@@ -10004,7 +10006,7 @@ int ndbcluster_alter_tablespace(THD* thd, st_alter_tablespace *info)
      DBUG_RETURN(1);
    }
    errmsg= "TABLESPACE";
    if (dict->createTablespace(ndb_ts))
    if (dict->createTablespace(ndb_ts, &objid))
    {
      DBUG_PRINT("error", ("createTablespace returned %d", error));
      goto ndberror;
@@ -10013,8 +10015,17 @@ int ndbcluster_alter_tablespace(THD* thd, st_alter_tablespace *info)
    errmsg= "DATAFILE";
    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));
      goto ndberror;
      goto ndberror2;
    }
    is_tablespace= 1;
    break;
@@ -10068,6 +10079,7 @@ int ndbcluster_alter_tablespace(THD* thd, st_alter_tablespace *info)
    error= ER_CREATE_FILEGROUP_FAILED;
    NdbDictionary::LogfileGroup ndb_lg;
    NdbDictionary::Undofile ndb_uf;
    NdbDictionary::ObjectId objid;
    if (info->undo_file_name == NULL)
    {
      /*
@@ -10080,7 +10092,7 @@ int ndbcluster_alter_tablespace(THD* thd, st_alter_tablespace *info)
      DBUG_RETURN(1);
    }
    errmsg= "LOGFILE GROUP";
    if (dict->createLogfileGroup(ndb_lg))
    if (dict->createLogfileGroup(ndb_lg, &objid))
    {
      goto ndberror;
    }
@@ -10092,7 +10104,15 @@ int ndbcluster_alter_tablespace(THD* thd, st_alter_tablespace *info)
    errmsg= "UNDOFILE";
    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;
  }
@@ -10169,7 +10189,8 @@ int ndbcluster_alter_tablespace(THD* thd, st_alter_tablespace *info)
  DBUG_RETURN(FALSE);

ndberror:
  const NdbError err= dict->getNdbError();
  err= dict->getNdbError();
ndberror2:
  ERR_PRINT(err);
  ndb_to_mysql_error(&err);
  
+1 −0
Original line number Diff line number Diff line
@@ -193,6 +193,7 @@ struct CreateFileConf {
  Uint32 senderData;
  Uint32 senderRef;
  Uint32 fileId;
  Uint32 fileVersion;
};

#endif
Loading