text: USE db_mall1;
  DROP TABLE IF EXISTS MYCAT_SEQUENCE;
  
  CREATE TABLE MYCAT_SEQUENCE ( NAME VARCHAR(50) NOT NULL, current_value INT NOT NULL, increment INT NOT NULL DEFAULT 100, PRIMARY KEY (NAME) ) ENGINE=INNODB;
  
  -- ----------------------------
  -- Function structure for `mycat_seq_currval`
  -- ----------------------------
  DROP FUNCTION IF EXISTS `mycat_seq_currval`;
  DELIMITER ;;
  CREATE DEFINER=`root`@`%` FUNCTION `mycat_seq_currval`(seq_name VARCHAR(50)) RETURNS VARCHAR(64) CHARSET utf8
  DETERMINISTIC
  BEGIN
  DECLARE retval VARCHAR(64);
  SET retval="-999999999,null";
  SELECT CONCAT(CAST(current_value AS CHAR),",",CAST(increment AS CHAR) ) INTO retval FROM MYCAT_SEQUENCE WHERE NAME = seq_name;
  RETURN retval ;
  END
  ;;
  DELIMITER ;
  -- ----------------------------
  -- Function structure for `mycat_seq_nextval`
  -- ----------------------------
  DROP FUNCTION IF EXISTS `mycat_seq_nextval`;
  DELIMITER ;;
  CREATE DEFINER=`root`@`%` FUNCTION `mycat_seq_nextval`(seq_name VARCHAR(50)) RETURNS VARCHAR(64) CHARSET utf8
  DETERMINISTIC
  BEGIN
  UPDATE MYCAT_SEQUENCE
  SET current_value = current_value + increment WHERE NAME = seq_name;
  RETURN mycat_seq_currval(seq_name);
  END
  ;;
  DELIMITER ;
  -- ----------------------------
  -- Function structure for `mycat_seq_setval`
  -- ----------------------------
  DROP FUNCTION IF EXISTS `mycat_seq_setval`;
  DELIMITER ;;
  CREATE DEFINER=`root`@`%` FUNCTION `mycat_seq_setval`(seq_name VARCHAR(50), VALUE INTEGER) RETURNS VARCHAR(64) CHARSET utf8
  DETERMINISTIC
  BEGIN
  UPDATE MYCAT_SEQUENCE
  SET current_value = VALUE
  WHERE NAME = seq_name;
  RETURN mycat_seq_currval(seq_name);
  END
  ;;
  DELIMITER ;
  