bug #25296 Truncate table converts NDB disk based tables to in-memory tables:...

bug #25296  Truncate table converts NDB disk based tables to in-memory tables: implemented ha_ndbcluster::update_create_info
parent 790fdad1
...@@ -419,6 +419,27 @@ t1 CREATE TABLE `t1` ( ...@@ -419,6 +419,27 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`a1`), PRIMARY KEY (`a1`),
KEY `a3_i` (`a3`) KEY `a3_i` (`a3`)
) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 ) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
TRUNCATE TABLE test.t1;
SHOW CREATE TABLE test.t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a1` int(11) NOT NULL,
`a2` float DEFAULT NULL,
`a3` double DEFAULT NULL,
`a4` bit(1) DEFAULT NULL,
`a5` tinyint(4) DEFAULT NULL,
`a6` bigint(20) DEFAULT NULL,
`a7` date DEFAULT NULL,
`a8` time DEFAULT NULL,
`a9` datetime DEFAULT NULL,
`a10` tinytext,
`a11` mediumtext,
`a12` longtext,
`a13` text,
`a14` blob,
PRIMARY KEY (`a1`),
KEY `a3_i` (`a3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
ALTER TABLE test.t1 DROP a14; ALTER TABLE test.t1 DROP a14;
ALTER TABLE test.t1 DROP a13; ALTER TABLE test.t1 DROP a13;
ALTER TABLE test.t1 DROP a12; ALTER TABLE test.t1 DROP a12;
...@@ -438,7 +459,7 @@ t1 CREATE TABLE `t1` ( ...@@ -438,7 +459,7 @@ t1 CREATE TABLE `t1` (
`a4` bit(1) DEFAULT NULL, `a4` bit(1) DEFAULT NULL,
`a5` tinyint(4) DEFAULT NULL, `a5` tinyint(4) DEFAULT NULL,
KEY `a3_i` (`a3`) KEY `a3_i` (`a3`)
) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
DROP TABLE test.t1; DROP TABLE test.t1;
ALTER TABLESPACE ts ALTER TABLESPACE ts
DROP DATAFILE './table_space/datafile.dat' DROP DATAFILE './table_space/datafile.dat'
......
...@@ -221,6 +221,9 @@ ALTER TABLE test.t1 DROP INDEX a2_i; ...@@ -221,6 +221,9 @@ ALTER TABLE test.t1 DROP INDEX a2_i;
SHOW CREATE TABLE test.t1; SHOW CREATE TABLE test.t1;
TRUNCATE TABLE test.t1;
SHOW CREATE TABLE test.t1;
#### Try to ALTER DD Tables and drop columns #### Try to ALTER DD Tables and drop columns
......
...@@ -8309,6 +8309,12 @@ ha_ndbcluster::setup_recattr(const NdbRecAttr* curr) ...@@ -8309,6 +8309,12 @@ ha_ndbcluster::setup_recattr(const NdbRecAttr* curr)
DBUG_RETURN(0); DBUG_RETURN(0);
} }
void ha_ndbcluster::update_create_info(HA_CREATE_INFO *create_info)
{
if (get_tablespace_name(current_thd,0,0))
create_info->storage_media= HA_SM_DISK;
}
char* char*
ha_ndbcluster::update_table_comment( ha_ndbcluster::update_table_comment(
/* out: table comment + additional */ /* out: table comment + additional */
......
...@@ -884,6 +884,7 @@ static void set_tabname(const char *pathname, char *tabname); ...@@ -884,6 +884,7 @@ static void set_tabname(const char *pathname, char *tabname);
ulonglong *nb_reserved_values); ulonglong *nb_reserved_values);
bool uses_blob_value(); bool uses_blob_value();
void update_create_info(HA_CREATE_INFO *create_info);
char *update_table_comment(const char * comment); char *update_table_comment(const char * comment);
int write_ndb_file(const char *name); int write_ndb_file(const char *name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment