Loading include/my_base.h +8 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,14 @@ enum ha_key_alg { HA_KEY_ALG_FULLTEXT= 4 /* FULLTEXT (MyISAM tables) */ }; /* Storage media types */ enum ha_storage_media { HA_SM_DEFAULT= 0, /* Not specified (engine default) */ HA_SM_DISK= 1, /* DISK storage */ HA_SM_MEMORY= 2 /* MAIN MEMORY storage */ }; /* The following is parameter to ha_extra() */ enum ha_extra_function { Loading mysql-test/r/ndb_dd_disk2memory.result +2 −2 Original line number Diff line number Diff line Loading @@ -237,7 +237,7 @@ t2 CREATE TABLE `t2` ( `c2` int(11) NOT NULL, PRIMARY KEY (`pk2`) ) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 ALTER TABLE test.t1 ENGINE=NDBCLUSTER; ALTER TABLE test.t1 STORAGE MEMORY ENGINE=NDBCLUSTER; SHOW CREATE TABLE test.t1; Table Create Table t1 CREATE TABLE `t1` ( Loading Loading @@ -341,7 +341,7 @@ t1 CREATE TABLE `t1` ( KEY `a2` (`a2`), KEY `a3` (`a3`), KEY `a8` (`a8`) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 ) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 Table Create Table t2 CREATE TABLE `t2` ( `b1` smallint(6) NOT NULL, Loading mysql-test/r/rpl_ndb_dd_advance.result +6 −6 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`c1`), KEY `t1_i` (`c2`,`c3`), KEY `c5` (`c5`) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 ) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 **** Show first set of ALTERs on SLAVE **** SHOW CREATE TABLE t1; Table Create Table Loading @@ -83,7 +83,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`c1`), KEY `t1_i` (`c2`,`c3`), KEY `c5` (`c5`) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 ) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 **** Second set of alters test 1 **** ALTER TABLE t1 RENAME t2; ALTER TABLE t2 DROP INDEX c5; Loading @@ -102,7 +102,7 @@ t1 CREATE TABLE `t1` ( `c5` double DEFAULT NULL, PRIMARY KEY (`c1`), KEY `t1_i` (`c2`,`c3`) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 ) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 **** Show second set of ALTERs on SLAVE **** SHOW CREATE TABLE t1; Table Create Table Loading @@ -114,7 +114,7 @@ t1 CREATE TABLE `t1` ( `c5` double DEFAULT NULL, PRIMARY KEY (`c1`), KEY `t1_i` (`c2`,`c3`) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 ) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 **** Third and last set of alters for test1 **** ALTER TABLE t1 CHANGE c1 c1 DOUBLE; ALTER TABLE t1 CHANGE c2 c2 DECIMAL(10,2); Loading @@ -136,7 +136,7 @@ t1 CREATE TABLE `t1` ( `c5` double DEFAULT NULL, PRIMARY KEY (`c1`), KEY `t1_i` (`c2`) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 ) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 SELECT * FROM t1 ORDER BY c1 LIMIT 5; c1 c2 c3 c5 1 2.00 b1b1b1b1b1b1b1b1b1b1 NULL Loading @@ -154,7 +154,7 @@ t1 CREATE TABLE `t1` ( `c5` double DEFAULT NULL, PRIMARY KEY (`c1`), KEY `t1_i` (`c2`) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 ) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 SELECT * FROM t1 where c1 = 1; c1 c2 c3 c5 1 2.00 b1b1b1b1b1b1b1b1b1b1 NULL Loading mysql-test/t/ndb_dd_disk2memory.test +1 −1 Original line number Diff line number Diff line Loading @@ -111,7 +111,7 @@ SHOW CREATE TABLE test.t1; ALTER TABLE test.t2 TABLESPACE table_space1 STORAGE DISK ENGINE=NDB; SHOW CREATE TABLE test.t2; ALTER TABLE test.t1 ENGINE=NDBCLUSTER; ALTER TABLE test.t1 STORAGE MEMORY ENGINE=NDBCLUSTER; SHOW CREATE TABLE test.t1; --echo ######################### End Test Section 2 ################# Loading sql/ha_ndbcluster.cc +5 −5 Original line number Diff line number Diff line Loading @@ -4807,7 +4807,7 @@ int ha_ndbcluster::create(const char *name, if ((my_errno= create_ndb_column(col, field, info))) DBUG_RETURN(my_errno); if (info->store_on_disk || getenv("NDB_DEFAULT_DISK")) if (info->storage_media == HA_SM_DISK || getenv("NDB_DEFAULT_DISK")) col.setStorageType(NdbDictionary::Column::StorageTypeDisk); else col.setStorageType(NdbDictionary::Column::StorageTypeMemory); Loading @@ -4827,7 +4827,7 @@ int ha_ndbcluster::create(const char *name, NdbDictionary::Column::StorageTypeMemory); } if (info->store_on_disk) if (info->storage_media == HA_SM_DISK) { if (info->tablespace) tab.setTablespace(info->tablespace); Loading @@ -4837,7 +4837,7 @@ int ha_ndbcluster::create(const char *name, else if (info->tablespace) { tab.setTablespace(info->tablespace); info->store_on_disk = true; //if use tablespace, that also means store on disk info->storage_media = HA_SM_DISK; //if use tablespace, that also means store on disk } // No primary key, create shadow key as 64 bit, auto increment Loading Loading @@ -9949,7 +9949,7 @@ int ha_ndbcluster::generate_scan_filter_from_key(NdbScanOperation *op, /* get table space info for SHOW CREATE TABLE */ char* ha_ndbcluster::get_tablespace_name(THD *thd, char* name) char* ha_ndbcluster::get_tablespace_name(THD *thd, char* name, uint name_len) { Ndb *ndb= check_ndb_in_thd(thd); NDBDICT *ndbdict= ndb->getDictionary(); Loading @@ -9969,7 +9969,7 @@ char* ha_ndbcluster::get_tablespace_name(THD *thd, char* name) goto err; if (name) { strxnmov(name, FN_LEN, ts.getName(), NullS); strxnmov(name, name_len, ts.getName(), NullS); return name; } else Loading Loading
include/my_base.h +8 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,14 @@ enum ha_key_alg { HA_KEY_ALG_FULLTEXT= 4 /* FULLTEXT (MyISAM tables) */ }; /* Storage media types */ enum ha_storage_media { HA_SM_DEFAULT= 0, /* Not specified (engine default) */ HA_SM_DISK= 1, /* DISK storage */ HA_SM_MEMORY= 2 /* MAIN MEMORY storage */ }; /* The following is parameter to ha_extra() */ enum ha_extra_function { Loading
mysql-test/r/ndb_dd_disk2memory.result +2 −2 Original line number Diff line number Diff line Loading @@ -237,7 +237,7 @@ t2 CREATE TABLE `t2` ( `c2` int(11) NOT NULL, PRIMARY KEY (`pk2`) ) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 ALTER TABLE test.t1 ENGINE=NDBCLUSTER; ALTER TABLE test.t1 STORAGE MEMORY ENGINE=NDBCLUSTER; SHOW CREATE TABLE test.t1; Table Create Table t1 CREATE TABLE `t1` ( Loading Loading @@ -341,7 +341,7 @@ t1 CREATE TABLE `t1` ( KEY `a2` (`a2`), KEY `a3` (`a3`), KEY `a8` (`a8`) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 ) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 Table Create Table t2 CREATE TABLE `t2` ( `b1` smallint(6) NOT NULL, Loading
mysql-test/r/rpl_ndb_dd_advance.result +6 −6 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`c1`), KEY `t1_i` (`c2`,`c3`), KEY `c5` (`c5`) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 ) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 **** Show first set of ALTERs on SLAVE **** SHOW CREATE TABLE t1; Table Create Table Loading @@ -83,7 +83,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`c1`), KEY `t1_i` (`c2`,`c3`), KEY `c5` (`c5`) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 ) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 **** Second set of alters test 1 **** ALTER TABLE t1 RENAME t2; ALTER TABLE t2 DROP INDEX c5; Loading @@ -102,7 +102,7 @@ t1 CREATE TABLE `t1` ( `c5` double DEFAULT NULL, PRIMARY KEY (`c1`), KEY `t1_i` (`c2`,`c3`) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 ) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 **** Show second set of ALTERs on SLAVE **** SHOW CREATE TABLE t1; Table Create Table Loading @@ -114,7 +114,7 @@ t1 CREATE TABLE `t1` ( `c5` double DEFAULT NULL, PRIMARY KEY (`c1`), KEY `t1_i` (`c2`,`c3`) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 ) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 **** Third and last set of alters for test1 **** ALTER TABLE t1 CHANGE c1 c1 DOUBLE; ALTER TABLE t1 CHANGE c2 c2 DECIMAL(10,2); Loading @@ -136,7 +136,7 @@ t1 CREATE TABLE `t1` ( `c5` double DEFAULT NULL, PRIMARY KEY (`c1`), KEY `t1_i` (`c2`) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 ) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 SELECT * FROM t1 ORDER BY c1 LIMIT 5; c1 c2 c3 c5 1 2.00 b1b1b1b1b1b1b1b1b1b1 NULL Loading @@ -154,7 +154,7 @@ t1 CREATE TABLE `t1` ( `c5` double DEFAULT NULL, PRIMARY KEY (`c1`), KEY `t1_i` (`c2`) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 ) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 SELECT * FROM t1 where c1 = 1; c1 c2 c3 c5 1 2.00 b1b1b1b1b1b1b1b1b1b1 NULL Loading
mysql-test/t/ndb_dd_disk2memory.test +1 −1 Original line number Diff line number Diff line Loading @@ -111,7 +111,7 @@ SHOW CREATE TABLE test.t1; ALTER TABLE test.t2 TABLESPACE table_space1 STORAGE DISK ENGINE=NDB; SHOW CREATE TABLE test.t2; ALTER TABLE test.t1 ENGINE=NDBCLUSTER; ALTER TABLE test.t1 STORAGE MEMORY ENGINE=NDBCLUSTER; SHOW CREATE TABLE test.t1; --echo ######################### End Test Section 2 ################# Loading
sql/ha_ndbcluster.cc +5 −5 Original line number Diff line number Diff line Loading @@ -4807,7 +4807,7 @@ int ha_ndbcluster::create(const char *name, if ((my_errno= create_ndb_column(col, field, info))) DBUG_RETURN(my_errno); if (info->store_on_disk || getenv("NDB_DEFAULT_DISK")) if (info->storage_media == HA_SM_DISK || getenv("NDB_DEFAULT_DISK")) col.setStorageType(NdbDictionary::Column::StorageTypeDisk); else col.setStorageType(NdbDictionary::Column::StorageTypeMemory); Loading @@ -4827,7 +4827,7 @@ int ha_ndbcluster::create(const char *name, NdbDictionary::Column::StorageTypeMemory); } if (info->store_on_disk) if (info->storage_media == HA_SM_DISK) { if (info->tablespace) tab.setTablespace(info->tablespace); Loading @@ -4837,7 +4837,7 @@ int ha_ndbcluster::create(const char *name, else if (info->tablespace) { tab.setTablespace(info->tablespace); info->store_on_disk = true; //if use tablespace, that also means store on disk info->storage_media = HA_SM_DISK; //if use tablespace, that also means store on disk } // No primary key, create shadow key as 64 bit, auto increment Loading Loading @@ -9949,7 +9949,7 @@ int ha_ndbcluster::generate_scan_filter_from_key(NdbScanOperation *op, /* get table space info for SHOW CREATE TABLE */ char* ha_ndbcluster::get_tablespace_name(THD *thd, char* name) char* ha_ndbcluster::get_tablespace_name(THD *thd, char* name, uint name_len) { Ndb *ndb= check_ndb_in_thd(thd); NDBDICT *ndbdict= ndb->getDictionary(); Loading @@ -9969,7 +9969,7 @@ char* ha_ndbcluster::get_tablespace_name(THD *thd, char* name) goto err; if (name) { strxnmov(name, FN_LEN, ts.getName(), NullS); strxnmov(name, name_len, ts.getName(), NullS); return name; } else Loading