分区表主键不包含分区键报错ERROR 1105 (HY000)
ERROR 1105 (HY000): A PRIMARY KEY must include all columns in the table's partitioning function
MySQL里面主键及唯一索引都需要包含分区键,否则均会报错
CREATE TABLE `sample` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`trade_no` varchar(32) NOT NULL COMMENT 'xxx',
`trade_type` varchar(32) DEFAULT NULL COMMENT 'xxx',
`sub_trade_type` varchar(32) DEFAULT NULL COMMENT 'xxx',
`request_no` varchar(64) NOT NULL COMMENT 'xxx',
`request_date` date not null DEFAULT '2000-01-01' COMMENT 'xxx',
`product_code` varchar(32) DEFAULT NULL COMMENT 'xxx',
`trade_channel` varchar(16) DEFAULT NULL COMMENT 'xxx',
`trade_status` varchar(32) NOT NULL COMMENT 'xxx',
`revoke_flag` varchar(8) DEFAULT NULL COMMENT 'xxx',
`cancel_flag` varchar(8) DEFAULT NULL COMMENT 'xxx',
`original_trade_no` varchar(32) DEFAULT NULL COMMENT 'xxx',
`trade_finished_date` date DEFAULT NULL COMMENT 'xxx',
`pay_finish_date` date DEFAULT NULL COMMENT 'xxx',
`ccy` varchar(3) NOT NULL COMMENT 'xxx',
`trade_amt` bigint(16) NOT NULL COMMENT 'xxx',
`discount_amt` bigint(16) DEFAULT NULL COMMENT 'xxx',
`discount_info` varchar(256) DEFAULT NULL COMMENT 'xxx',
`pay_amt` bigint(16) DEFAULT NULL COMMENT 'xxx',
`billing_contract_no` bigint(20) not null DEFAULT 0 COMMENT 'xxx',
`billing_login_name` varchar(32) DEFAULT NULL COMMENT 'xxx',
`transfer_contract_no` varchar(16) DEFAULT NULL COMMENT 'xxx',
`transfer_login_name` varchar(32) DEFAULT NULL COMMENT 'xxx',
`transfer_flag` varchar(16) DEFAULT NULL COMMENT 'xxx',
`merchant_no` varchar(32) DEFAULT NULL COMMENT 'xxx',
`merchant_trade_no` varchar(32) DEFAULT NULL COMMENT 'xxx',
`merchant_name` varchar(256) DEFAULT NULL COMMENT 'xxx',
`goods_info` varchar(32) DEFAULT NULL COMMENT 'xxx',
`memo` varchar(256) DEFAULT NULL COMMENT 'xxx',
`created_at` date NOT NULL COMMENT 'xxx',
`created_by` varchar(32) NOT NULL COMMENT 'xxx',
`updated_at` date NOT NULL COMMENT 'xxx',
`updated_by` varchar(32) NOT NULL COMMENT 'xxx',
PRIMARY KEY (id,request_date)
) ENGINE=InnoDB AUTO_INCREMENT=5731 DEFAULT CHARSET=utf8 COMMENT='xxx'
partition by range (year(request_date)*100+month(request_date)) (
partition p201604 values less than (201604),
partition p201605 values less than (201605),
partition p201606 values less than (201606),
partition p201607 values less than (201607),
partition p201608 values less than (201608),
partition p201609 values less than (201609),
partition p201610 values less than (201610),
partition p201611 values less than (201611),
partition p201612 values less than (201612),
partition p201701 values less than (201701),
partition p201702 values less than (201702),
partition p201703 values less than (201703),
partition p201704 values less than (201704),
partition p201705 values less than (201705),
partition p201706 values less than (201706),
partition p201707 values less than (201707),
partition p201708 values less than (201708),
partition p201709 values less than (201709),
partition p201710 values less than (201710),
partition p201711 values less than (201711),
partition p201712 values less than (201712),
partition p201801 values less than (201801),
partition p201802 values less than (201802),
partition p201803 values less than (201803),
partition p201804 values less than (201804),
partition p201805 values less than (201805),
partition p201806 values less than (201806),
partition p201807 values less than (201807),
partition p201808 values less than (201808),
partition p201809 values less than (201809),
partition p201810 values less than (201810),
partition p201811 values less than (201811),
partition p201812 values less than (201812));
分区表主键不包含分区键报错ERROR 1105 (HY000)的更多相关文章
- mysql5.7设置简单密码报错ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
注:本文来源于< mysql5.7设置简单密码报错ERROR 1819 (HY000): Your password does not satisfy the current policy r ...
- mysql-创建用户报错ERROR 1396 (HY000): Operation CREATE USER failed for 'XXXX'@'XXXX'
创建用户: create user 'test'@'%' identified by 'test'; 显示ERROR 1396 (HY000): Operation CREATE USER faile ...
- MySQL报错ERROR 1558 (HY000): Column count of mysql.user is wrong.
MySQL报错ERROR 1558 (HY000): Column count of mysql.user is wrong. 1.今天在使用MySQL创建数据库时出现如下报错: mysql> ...
- 解决MySQL报错ERROR 2002 (HY000)【转】
今天在为新的业务线搭架数据库后,在启动的时候报错 root@qsbilldatahis-db01:/usr/local/mysql/bin# ./mysql ERROR 2002 (HY000): C ...
- 第一次登录mysql,使用任何命令都报错ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
问题: 使用临时密码登录成功后,使用任何myql命令,例如show databases;都提示下面的报错 ERROR 1820 (HY000): You must reset your passwor ...
- mysql-创建用户报错ERROR 1396 (HY000): Operation CREATE USER failed for 'XXXX'@'XXXX'(转载)
创建用户: create user ‘test’@’%’ identified by ‘test’; 显示ERROR 1396 (HY000): Operation CREATE USER faile ...
- MySQL5.7 报错 ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement
MySQL5.7 报错 : ERROR 1820 (HY000): You must reset your password using ALTER USER statement before exe ...
- mysql-创建用户报错ERROR 1396 (HY000): Operation CREATE USER failed for 'root'@'localhost'
创建用户: create user ‘test’@’%’ identified by ‘test’; 显示ERROR 1396 (HY000): Operation CREATE USER faile ...
- MySQL报错ERROR 1436 (HY000): Thread stack overrun:
今天搭私服的时候,卡在角色创建画面,日志报错如上. 这是MySQL报错ERROR 1436 (HY000): Thread stack overrun: 修改方法 vim /etc/my.cnf ...
随机推荐
- hadoop fs 命令使用
参考:https://segmentfault.com/a/1190000002672666 命令基本格式: hadoop fs -cmd < args > 1.ls hadoop fs ...
- DataInputStream FileInputStream 区别
DataInputStream是数据输入流,读取的是java的基本数据类型. FileInputStream是从文件系统中,读取的单位是字节. FileReader 是从文件中,读取的单位是字符
- Android View 深度分析requestLayout、invalidate与postInvalidate
前言 前几篇文章中,笔者对View的三大工作流程进行了详细分析,而这篇文章则详细讲述与三大工作流程密切相关的两个方法,分别是requestLayout和invalidate,如果对Viwe的三个工作流 ...
- 在textarea中鼠标指定的位置插入字符或表情
有些时候我们已经在textarea中输入了一些字符,然后想在鼠标指定的位置插入表情或者字符,这就需要用到jquery的一个小插件了. 代码如下: (function ($) { $.fn.extend ...
- EF语句拦截器-匹配当前的Controller,Action,User
示例代码,ps:一切都能实现,关键是你尝试的方向,别把简单问题复杂化导致进入死胡同出不来. using Mobile360.Core.Interfaces; using Mobile360.Core. ...
- ABP框架使用Swagger
参考文档:https://www.cnblogs.com/xcsn/p/7910890.html 步骤1:Nuget安装Swashbuckle到*.WebApi项目 步骤2:在*.WebApi> ...
- vs调试的时候出错:无法启动程序,操作在当前状态中是非法的
工具--选项--调试--常规--启用asp.net的JavaScript调试(chrome和ie)去掉勾选
- JAVA 8.20 游戏:四子连(Java&C++)
(游戏:四子连 )四子连是一个两个人玩的棋盘游戏,在游戏中,玩家轮流将有颜色的棋子放在一个六行七列的垂直悬挂的网格中: 这个游戏的目的是在对手实现一行.一列或者一条对角线上有四个相同颜 ...
- eclipse手动安装alibaba代码规范插件
如果你的开发环境无法访问外网,那么手动安装阿里巴巴的代码规范插件是一个不错的选择.另外,很多教程说该插件需要jdk1.8以上,我试了一下jdk1.7也是可以运行的,更低的版本就不知道了,貌似jdk1. ...
- 多字节字符集与Unicode字符集
在计算机中字符通常并不是保存为图像,每个字符都是使用一个编码来表示的,而每个字符究竟使用哪个编码代表,要取决于使用哪个字符集(charset). 多字节字符集: 在最初的时候,Internet上只有一 ...