分区表主键不包含分区键报错ERROR 1105 (HY000)

时间:2022-09-09 23:47:49

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)的更多相关文章

  1. 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 ...

  2. mysql-创建用户报错ERROR 1396 &lpar;HY000&rpar;&colon; Operation CREATE USER failed for &&num;39&semi;XXXX&&num;39&semi;&commat;&&num;39&semi;XXXX&&num;39&semi;

    创建用户: create user 'test'@'%' identified by 'test'; 显示ERROR 1396 (HY000): Operation CREATE USER faile ...

  3. MySQL报错ERROR 1558 &lpar;HY000&rpar;&colon; Column count of mysql&period;user is wrong&period;

    MySQL报错ERROR 1558 (HY000): Column count of mysql.user is wrong. 1.今天在使用MySQL创建数据库时出现如下报错: mysql> ...

  4. 解决MySQL报错ERROR 2002 &lpar;HY000&rpar;【转】

    今天在为新的业务线搭架数据库后,在启动的时候报错 root@qsbilldatahis-db01:/usr/local/mysql/bin# ./mysql ERROR 2002 (HY000): C ...

  5. 第一次登录mysql,使用任何命令都报错ERROR 1820 &lpar;HY000&rpar;&colon; You must reset your password using ALTER USER statement before executing this statement&period;

    问题: 使用临时密码登录成功后,使用任何myql命令,例如show databases;都提示下面的报错 ERROR 1820 (HY000): You must reset your passwor ...

  6. mysql-创建用户报错ERROR 1396 &lpar;HY000&rpar;&colon; Operation CREATE USER failed for &&num;39&semi;XXXX&&num;39&semi;&commat;&&num;39&semi;XXXX&&num;39&semi;(转载)

    创建用户: create user ‘test’@’%’ identified by ‘test’; 显示ERROR 1396 (HY000): Operation CREATE USER faile ...

  7. MySQL5&period;7 报错 ERROR 1820 &lpar;HY000&rpar;&colon; 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 ...

  8. mysql-创建用户报错ERROR 1396 &lpar;HY000&rpar;&colon; Operation CREATE USER failed for &&num;39&semi;root&&num;39&semi;&commat;&&num;39&semi;localhost&&num;39&semi;

    创建用户: create user ‘test’@’%’ identified by ‘test’; 显示ERROR 1396 (HY000): Operation CREATE USER faile ...

  9. MySQL报错ERROR 1436 &lpar;HY000&rpar;&colon; Thread stack overrun&colon;

    今天搭私服的时候,卡在角色创建画面,日志报错如上. 这是MySQL报错ERROR 1436 (HY000): Thread stack overrun:   修改方法 vim /etc/my.cnf ...

随机推荐

  1. Android笔记

    SYSTEM_ALERT_WINDOW and WRITE_SETTINGS, 这两个权限比较特殊,不能通过代码申请方式获取,必须得用户打开软件设置页手动打开,才能授权.路径是:Settings-&g ...

  2. 【Android】设置android&colon;maxLines&equals;&quot&semi;1&quot&semi;后,android&colon;imeOptions&equals;&quot&semi;actionSearch&quot&semi;失效

    android:singleLine在API LEVEL 3已经废弃,可以用android:maxLines="1"代替. 但是测试的时候发现设置android:maxLines= ...

  3. js的event&period;srcElement与event&period;target(触发事件对象)

    IE下,event对象有srcElement属性,但是没有target属性; Firefox下,event对象有target属性,但是没有srcElement属性.但他们的作用是相当的,即: fire ...

  4. Unity3d:The requested item has been unloaded

    问题描述:System.Xml类库下实例化的对象所有枚举类的值都显示如标题错误解决方案1:查看所在类是否:MonoBehaviour,如果没继承,添加即可.<ignore_js_op> 

  5. 解决Maven不能下载&OpenCurlyDoubleQuote;oracle、aspectjweaver、com&period;springsource&period;net&period;sf&period;cglib”jar

    鸣谢网址:http://www.cnblogs.com/dongyangbolg/p/3455422.html http://www.cnblogs.com/ysq0908/p/4737977.htm ...

  6. java中的参数传递是按引用传递还是按值传递

    最近去面试,有一个面试官问到java中参数传递的问题,感觉自己对于这一块还是理解的不够深.今天我们就一起来学习一下Java中的接口和抽象类.下面是本文的目录大纲: 一 . 什么是按值传递,什么是按引用 ...

  7. 实验与作业&lpar;Python&rpar;-03 Python程序实例解析

    截止日期: 要求: 下周实验课前上交,做好后在实验课上检查可获取平时分. 做出进阶或选做的的请用清晰的标致标识出来,方便老师批改 本次作业:可提交也可不提交.作业算平时成绩. 本次作业内容量较大,请组 ...

  8. keil5 MDK warning&colon;registered ARM compiler version not found in path

    重装 打开keil5弹出窗口: warning:registered ARM compiler version not found in path... 解决: 增加系统环境变量 ARMCC5LIB ...

  9. AGC005F Many Easy Problems(NTT)

    先只考虑求某个f(k).考虑转换为计算每条边的贡献,也即该边被所选连通块包含的方案数.再考虑转换为计算每条边不被包含的方案数.这仅当所选点都在该边的同一侧.于是可得f(k)=C(n,k)+ΣC(n,k ...

  10. hdu2669-Romantic-(扩展欧几里得定理)

    Romantic Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Su ...