Commit 3eb4d961 authored by unknown's avatar unknown

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


mysql-test/r/ndb_dd_alter.result:
  ug #25296  Truncate table converts NDB disk based tables to in-memory tables: implemented ha_ndbcluster::update_create_info
mysql-test/t/ndb_dd_alter.test:
  ug #25296  Truncate table converts NDB disk based tables to in-memory tables: implemented ha_ndbcluster::update_create_info
sql/ha_ndbcluster.cc:
  ug #25296  Truncate table converts NDB disk based tables to in-memory tables: implemented ha_ndbcluster::update_create_info
sql/ha_ndbcluster.h:
  ug #25296  Truncate table converts NDB disk based tables to in-memory tables: implemented ha_ndbcluster::update_create_info
parent 58ae3082
......@@ -419,6 +419,27 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`a1`),
KEY `a3_i` (`a3`)
) /*!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 a13;
ALTER TABLE test.t1 DROP a12;
......@@ -438,7 +459,7 @@ t1 CREATE TABLE `t1` (
`a4` bit(1) DEFAULT NULL,
`a5` tinyint(4) DEFAULT NULL,
KEY `a3_i` (`a3`)
) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
DROP TABLE test.t1;
ALTER TABLESPACE ts
DROP DATAFILE './table_space/datafile.dat'
......
......@@ -221,6 +221,9 @@ ALTER TABLE test.t1 DROP INDEX a2_i;
SHOW CREATE TABLE test.t1;
TRUNCATE TABLE test.t1;
SHOW CREATE TABLE test.t1;
#### Try to ALTER DD Tables and drop columns
......
......@@ -8309,6 +8309,12 @@ ha_ndbcluster::setup_recattr(const NdbRecAttr* curr)
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*
ha_ndbcluster::update_table_comment(
/* out: table comment + additional */
......
......@@ -884,6 +884,7 @@ private:
ulonglong *nb_reserved_values);
bool uses_blob_value();
void update_create_info(HA_CREATE_INFO *create_info);
char *update_table_comment(const char * comment);
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