2019-03-03 02:24:47.793 [destination = mavericks , address = rds9bqff31333g29hfr9o.mysql.rds.aliyuncs.com/123.56.209.14:3306 , EventParser] WARN c.a.otter.canal.parse.inbound.mysql.tsdb.MemoryTableMeta - parse faield : CREATE DEFINER=mavericks@% FUNCTION remove_duplicate_str(in_str varchar(1000),spliter varchar(10)) RETURNS varchar(1000) CHARSET utf8mb4 BEGIN DECLARE v_result VARCHAR(1000); DECLARE v_strs VARCHAR(1000); DECLARE v_obj VARCHAR(100);
IF (in_str is not null and in_str <> '') THEN SET v_strs = in_str; if instr(v_strs, spliter) = 0 then -- 如果没有分隔符,则直接赋值输出变量为输入变量 set v_result = v_strs; else -- 开始循环输入字符串,按spliter字符分隔 while INSTR(v_strs, spliter) > 0 do SET v_obj = SUBSTR(v_strs, 1, INSTR(v_strs, spliter) - 1); SET v_strs = SUBSTR(v_strs, INSTR(v_strs, spliter) + 1);
if(v_result is null) THEN
SET v_result = v_obj;
else
if(INSTR(v_result, v_obj) = 0) THEN
-- 如果在v_result中没找到v_obj,则拼接该字符串
-- 反之如果找到了,就跳过
SET v_result = CONCAT(v_result, spliter, v_obj);
end if;
end if;
end while;
-- 因最后一个字符串中肯定不包含spiliter的字符,
-- 因此退出循环后需要拼接最后一个字符串
if(INSTR(v_result, v_strs) = 0) THEN
SET v_result = CONCAT(v_result, spliter, v_strs);
end if;
end if;
ELSE SET v_result = in_str; END IF ;
RETURN v_result; END com.alibaba.fastsql.sql.parser.ParserException: syntax error, error in :'if; end if; end while; -- 因最后一', expect WHILE, actual IF, pos 897, line 26, column 10, token IF at com.alibaba.fastsql.sql.parser.SQLParser.printError(SQLParser.java:363) ~[fastsql-2.0.0_preview_644.jar:2.0.0_preview_644] at com.alibaba.fastsql.sql.parser.SQLParser.accept(SQLParser.java:371) ~[fastsql-2.0.0_preview_644.jar:2.0.0_preview_644] at com.alibaba.fastsql.sql.dialect.mysql.parser.MySqlStatementParser.parseWhile(MySqlStatementParser.java:6412) ~[fastsql-2.0.0_preview_644.jar:2.0.0_preview_644] at com.alibaba.fastsql.sql.dialect.mysql.parser.MySqlStatementParser.parseWhile(MySqlStatementParser.java:41) ~[fastsql-2.0.0_preview_644.jar:2.0.0_preview_644] at com.alibaba.fastsql.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:325) ~[fastsql-2.0.0_preview_644.jar:2.0.0_preview_644] at com.alibaba.fastsql.sql.dialect.mysql.parser.MySqlStatementParser.parseIf(MySqlStatementParser.java:6381) ~[fastsql-2.0.0_preview_644.jar:2.0.0_preview_644] at com.alibaba.fastsql.sql.dialect.mysql.parser.MySqlStatementParser.parseIf(MySqlStatementParser.java:41) ~[fastsql-2.0.0_preview_644.jar:2.0.0_preview_644] at com.alibaba.fastsql.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:331) ~[fastsql-2.0.0_preview_644.jar:2.0.0_preview_644] at com.alibaba.fastsql.sql.dialect.mysql.parser.MySqlStatementParser.parseIf(MySqlStatementParser.java:6361) ~[fastsql-2.0.0_preview_644.jar:2.0.0_preview_644] at com.alibaba.fastsql.sql.dialect.mysql.parser.MySqlStatementParser.parseIf(MySqlStatementParser.java:41) ~[fastsql-2.0.0_preview_644.jar:2.0.0_preview_644] at com.alibaba.fastsql.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:331) ~[fastsql-2.0.0_preview_644.jar:2.0.0_preview_644] at com.alibaba.fastsql.sql.dialect.mysql.parser.MySqlStatementParser.parseBlock(MySqlStatementParser.java:1508) ~[fastsql-2.0.0_preview_644.jar:2.0.0_preview_644] at com.alibaba.fastsql.sql.dialect.mysql.parser.MySqlStatementParser.parseCreateFunction(MySqlStatementParser.java:5949) ~[fastsql-2.0.0_preview_644.jar:2.0.0_preview_644] at com.alibaba.fastsql.sql.dialect.mysql.parser.MySqlStatementParser.parseCreate(MySqlStatementParser.java:359) ~[fastsql-2.0.0_preview_644.jar:2.0.0_preview_644] at com.alibaba.fastsql.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:224) ~[fastsql-2.0.0_preview_644.jar:2.0.0_preview_644] at com.alibaba.fastsql.sql.SQLUtils.parseStatements(SQLUtils.java:525) ~[fastsql-2.0.0_preview_644.jar:2.0.0_preview_644] at com.alibaba.fastsql.sql.repository.SchemaRepository.console(SchemaRepository.java:439) ~[fastsql-2.0.0_preview_644.jar:2.0.0_preview_644] at com.alibaba.otter.canal.parse.inbound.mysql.tsdb.MemoryTableMeta.apply(MemoryTableMeta.java:78) ~[canal.parse-1.1.2.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta.applyHistoryOnMemory(DatabaseTableMeta.java:463) [canal.parse-1.1.2.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta.rollback(DatabaseTableMeta.java:174) [canal.parse-1.1.2.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.AbstractMysqlEventParser.processTableMeta(AbstractMysqlEventParser.java:84) [canal.parse-1.1.2.jar:na] at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$3.run(AbstractEventParser.java:192) [canal.parse-1.1.2.jar:na] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60]
原提问者GitHub用户
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。