summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/ndb_dd_ddl.result5
-rw-r--r--mysql-test/t/ndb_dd_ddl.test9
-rw-r--r--sql/ha_ndbcluster.cc10
-rw-r--r--storage/ndb/ndbapi-examples/Makefile2
-rw-r--r--storage/ndb/ndbapi-examples/mgmapi_logevent2/Makefile (renamed from storage/ndb/ndbapi-examples/mgmapi_logevent_dual/Makefile)2
-rw-r--r--storage/ndb/ndbapi-examples/mgmapi_logevent2/mgmapi_logevent2.cpp (renamed from storage/ndb/ndbapi-examples/mgmapi_logevent_dual/mgmapi_logevent_dual.cpp)0
6 files changed, 26 insertions, 2 deletions
diff --git a/mysql-test/r/ndb_dd_ddl.result b/mysql-test/r/ndb_dd_ddl.result
index eea80090768..56119dc5005 100644
--- a/mysql-test/r/ndb_dd_ddl.result
+++ b/mysql-test/r/ndb_dd_ddl.result
@@ -183,6 +183,11 @@ INITIAL_SIZE 1M
ENGINE NDB;
CREATE TABLE t1
(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
+TABLESPACE ts1 STORAGE MEMORY
+ENGINE NDB;
+ERROR HY000: Can't create table 'test.t1' (errno: 138)
+CREATE TABLE t1
+(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
TABLESPACE ts1 STORAGE DISK
ENGINE NDB;
CREATE INDEX b_i on t1(b);
diff --git a/mysql-test/t/ndb_dd_ddl.test b/mysql-test/t/ndb_dd_ddl.test
index 1a470d52c6c..aa692385b07 100644
--- a/mysql-test/t/ndb_dd_ddl.test
+++ b/mysql-test/t/ndb_dd_ddl.test
@@ -270,11 +270,18 @@ ADD DATAFILE 'datafile2.dat'
INITIAL_SIZE 1M
ENGINE NDB;
+--error 1005
+CREATE TABLE t1
+(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
+TABLESPACE ts1 STORAGE MEMORY
+ENGINE NDB;
+
CREATE TABLE t1
(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
TABLESPACE ts1 STORAGE DISK
ENGINE NDB;
+
CREATE INDEX b_i on t1(b);
CREATE INDEX bc_i on t1(b, c);
@@ -351,4 +358,6 @@ engine ndb;
drop table t1;
+
+
# End 5.1 test
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index f83589dd758..a606d7f77d0 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -4836,6 +4836,16 @@ int ha_ndbcluster::create(const char *name,
}
else if (info->tablespace)
{
+ if (info->storage_media == HA_SM_MEMORY)
+ {
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ ER_ILLEGAL_HA_CREATE_OPTION,
+ ER(ER_ILLEGAL_HA_CREATE_OPTION),
+ ndbcluster_hton_name,
+ "TABLESPACE currently only supported for "
+ "STORAGE DISK");
+ DBUG_RETURN(HA_ERR_UNSUPPORTED);
+ }
tab.setTablespace(info->tablespace);
info->storage_media = HA_SM_DISK; //if use tablespace, that also means store on disk
}
diff --git a/storage/ndb/ndbapi-examples/Makefile b/storage/ndb/ndbapi-examples/Makefile
index 2a77cb20afe..6a48afccb48 100644
--- a/storage/ndb/ndbapi-examples/Makefile
+++ b/storage/ndb/ndbapi-examples/Makefile
@@ -7,7 +7,7 @@ BIN_DIRS := ndbapi_simple \
ndbapi_scan \
mgmapi_logevent \
ndbapi_simple_dual \
- mgmapi_logevent_dual
+ mgmapi_logevent2
bins: $(patsubst %, _bins_%, $(BIN_DIRS))
diff --git a/storage/ndb/ndbapi-examples/mgmapi_logevent_dual/Makefile b/storage/ndb/ndbapi-examples/mgmapi_logevent2/Makefile
index 4a80a9fe087..95b43b11f6b 100644
--- a/storage/ndb/ndbapi-examples/mgmapi_logevent_dual/Makefile
+++ b/storage/ndb/ndbapi-examples/mgmapi_logevent2/Makefile
@@ -1,4 +1,4 @@
-TARGET = mgmapi_logevent_dual
+TARGET = mgmapi_logevent2
SRCS = $(TARGET).cpp
OBJS = $(TARGET).o
CXX = g++
diff --git a/storage/ndb/ndbapi-examples/mgmapi_logevent_dual/mgmapi_logevent_dual.cpp b/storage/ndb/ndbapi-examples/mgmapi_logevent2/mgmapi_logevent2.cpp
index 2073ec540d7..2073ec540d7 100644
--- a/storage/ndb/ndbapi-examples/mgmapi_logevent_dual/mgmapi_logevent_dual.cpp
+++ b/storage/ndb/ndbapi-examples/mgmapi_logevent2/mgmapi_logevent2.cpp