MYSQL分区表功能测试简析

发表于:2014-11-18 10:47  作者:杨桃   来源:51Testing软件测试网采编

字体: | 上一篇 | 下一篇 |我要投稿 | 推荐标签: 软件测试技术 MySQL 功能测试

  1.查看Mysql版本是否支持分区
  SHOW VARIABLES LIKE '%partition%';
  +-------------------+-------+
  | Variable_name     | Value |
  +-------------------+-------+
  | have_partitioning | YES   |
  +-------------------+-------+
  如果VALUE 为YES 则支持分区,
  2.测试那种存储引擎支持分区
INOODB引擎
mysql> Create table engine1(id int) engine=innodb partition by range(id)(partition po values less than(10));
Query OK, 0 rows affected (0.01 sec)
MRG_MYISAM引擎
mysql> Create table engine2(id int) engine=MRG_MYISAM partition by range(id)(partition po values less than(10));
ERROR 1572 (HY000): Engine cannot be used in partitioned tables
blackhole引擎
mysql> Create table engine3(id int) engine=blackhole partition by range(id)(partition po values less than(10));
Query OK, 0 rows affected (0.01 sec)
CSV引擎
mysql> Create table engine4(id int) engine=csv partition by range(id)(partition po values less than(10));
ERROR 1572 (HY000): Engine cannot be used in partitioned tables
Memory引擎
mysql> Create table engine5(id int) engine=memory partition by range(id)(partition po values less than(10));
Query OK, 0 rows affected (0.01 sec)
federated引擎
mysql> Create table engine6(id int) engine=federated partition by range(id)(partition po values less than(10));
Query OK, 0 rows affected (0.01 sec)
archive引擎
mysql> Create table engine7(id int) engine=archive partition by range(id)(partition po values less than(10));
Query OK, 0 rows affected (0.01 sec)
myisam 引擎
mysql> Create table engine8(id int) engine=myisam partition by range(id)(partition po values less than(10));
Query OK, 0 rows affected (0.01 sec)
  3.Mysql分区表,分区引擎测试
  表分区的存储引擎相同
  mysql> Create table pengine1(id int) engine=myisam partition by range(id)(partition po values less than(10) engine=myisam, partition p1 values less than(20) engine=myisam);
  Query OK, 0 rows affected (0.05 sec)
  表分区的存储引擎不同
  mysql> Create table pengine2(id int) engine=myisam partition by range(id)(partition po values less than(10) engine=myisam, partition p1 values less than(20) engine=innodb);
  ERROR 1497 (HY000): The mix of handlers in the partitions is not allowed in this version of MySQL
  同一个分区表中的所有分区必须使用同一个存储引擎,并且存储引擎要和主表的保持一致。

【福利】填问卷 送2019精选测试大礼包+接口测试实战课程!
31/3123>

评 论

论坛新帖

顶部 底部


建议使用IE 6.0以上浏览器,800×600以上分辨率,法律顾问:上海瀛东律师事务所 张楠律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2019, 沪ICP备05003035号
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪公网安备 31010102002173号

51Testing官方微信

51Testing官方微博

扫一扫 测试知识全知道