mysql存储过程中需要添加新的分区调用不到函数便俩个
为什么调用不到这个变量,急!
你确信这里User是另外一张表,而不是testyjs?
CREATE DEFINER=`wenxin`@`%` PROCEDURE `yearsMonthPartition`()
BEGIN
DECLARE a INTEGER;
#Routine body goes here...
set a = 132543;
set @b = 132;
-- set @b = 2;
drop table if EXISTS testyjs;
create table if not EXISTS testyjs(
id BIGINT,
createed VARCHAR(200),
PRIMARY KEY (`id`,createed) USING BTREE
)
PARTITION by range (id)
(
partition p11 values less than (55)
-- partition p12 values less than (a)
);
alter table testyjs add partition(partition p3 values less than (a));
END