【 TiDB 使用环境】生产环境
【 TiDB 版本】6.1.0
【复现路径】
新增的分区表
CREATE TABLE ic_crawler_tax_ent_list_new
(
united_id
varchar(100) NOT NULL COMMENT ‘统一信用码’,
ent_id
varchar(36) DEFAULT NULL COMMENT ‘企业id’,
ent_name
varchar(300) DEFAULT NULL COMMENT ‘企业名称’,
prov
varchar(100) DEFAULT NULL COMMENT ‘省份’,
city
varchar(100) DEFAULT NULL COMMENT ‘城市’,
data_status
varchar(10) DEFAULT NULL COMMENT ‘数据状态’,
input_time
varchar(32) DEFAULT NULL COMMENT ‘入库时间’,
dw_ins_date
varchar(32) DEFAULT NULL COMMENT ‘入库时间’,
spider_status
varchar(10) DEFAULT ‘init’ COMMENT ‘爬虫状态’,
KEY united_id_index
(united_id
),
KEY union_index_1
(city
,spider_status
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin /*T! SHARD_ROW_ID_BITS=6 PRE_SPLIT_REGIONS=4 */ COMMENT=‘工商爬虫纳税人企业名单’
PARTITION BY LIST COLUMNS(prov
)
(PARTITION pRegion_1
VALUES IN (“浙江省”),
PARTITION pRegion_2
VALUES IN (“云南省”),
PARTITION pRegion_3
VALUES IN (“山东省”),
PARTITION pRegion_4
VALUES IN (“河南省”),
PARTITION pRegion_5
VALUES IN (“四川省”),
PARTITION pRegion_6
VALUES IN (“北京市”),
PARTITION pRegion_7
VALUES IN (“海南省”),
PARTITION pRegion_8
VALUES IN (“黑龙江省”),
PARTITION pRegion_9
VALUES IN (“陕西省”),
PARTITION pRegion_10
VALUES IN (“江苏省”),
PARTITION pRegion_11
VALUES IN (“福建省”),
PARTITION pRegion_12
VALUES IN (“广西壮族自治区”),
PARTITION pRegion_13
VALUES IN (“青海省”),
PARTITION pRegion_14
VALUES IN (“江西省”),
PARTITION pRegion_15
VALUES IN (“河北省”),
PARTITION pRegion_16
VALUES IN (“安徽省”),
PARTITION pRegion_17
VALUES IN (“辽宁省”),
PARTITION pRegion_18
VALUES IN (“广东省”),
PARTITION pRegion_19
VALUES IN (“甘肃省”),
PARTITION pRegion_20
VALUES IN (“贵州省”),
PARTITION pRegion_21
VALUES IN (“山西省”),
PARTITION pRegion_22
VALUES IN (“湖南省”),
PARTITION pRegion_23
VALUES IN (“宁夏回族自治区”),
PARTITION pRegion_24
VALUES IN (“西藏自治区”),
PARTITION pRegion_25
VALUES IN (“吉林省”),
PARTITION pRegion_26
VALUES IN (“上海市”),
PARTITION pRegion_27
VALUES IN (“湖北省”),
PARTITION pRegion_28
VALUES IN (“天津市”),
PARTITION pRegion_29
VALUES IN (“重庆市”),
PARTITION pRegion_30
VALUES IN (“新疆维吾尔自治区”),
PARTITION pRegion_31
VALUES IN (“内蒙古自治区”),
PARTITION pRegion_32
VALUES IN (“香港特别行政区”,“台湾省”,“”))
【遇到的问题:问题现象及影响】
新增值为null的分区,报错ERROR 1495 (HY000): Multiple definition of same constant in list partitioning
执行插入null值sql报错ERROR 1526 (HY000): Table has no partition for value from column_list
这种怎么处理
【资源配置】进入到 TiDB Dashboard -集群信息 (Cluster Info) -主机(Hosts) 截图此页面
【附件:截图/日志/监控】