修复 MySQL 中临时表的 TYPE=HEAP 错误?
TYPE=HEAP 已在较新的 MySQL 版本中弃用。你可以使用 ENGINE=HEAP 代替 TYPE。以下是语法 −
ENGINE=HEAP;
让我们先来创建一个表。在此,我们已设置 Engine=HEAP −
mysql> create TEMPORARY table DemoTable -> ( -> StudentId int, -> StudentName varchar(30) -> )Engine = HEAP; Query OK, 0 rows affected (0.00 sec)
让我们检查表的定义 −
mysql> show create table DemoTable;
输出
它会生成以下输出 −
+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Table | Create Table | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | DemoTable | CREATE TEMPORARY TABLE `DemoTable` (`StudentId` int(11) DEFAULT NULL,`StudentName` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL) ENGINE=MEMORY DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec)
广告