Skip to content

Commit

Permalink
upgrade fastjson 1.2.58
Browse files Browse the repository at this point in the history
  • Loading branch information
agapple committed Aug 22, 2019
1 parent 86cd805 commit bd974e3
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ public class JsonUtils {
SerializeConfig.getGlobalInstance().put(InetAddress.class, InetAddressSerializer.instance);
SerializeConfig.getGlobalInstance().put(Inet4Address.class, InetAddressSerializer.instance);
SerializeConfig.getGlobalInstance().put(Inet6Address.class, InetAddressSerializer.instance);
ParserConfig.getGlobalInstance().setAutoTypeSupport(true);
// ParserConfig.getGlobalInstance().setAutoTypeSupport(true);

ParserConfig.getGlobalInstance().addAccept("com.alibaba.otter.");
ParserConfig.getGlobalInstance().addAccept("com.taobao.tddl.dbsync.");
}

public static <T> T unmarshalFromByte(byte[] bytes, Class<T> targetClass) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.io.File;
import java.io.FileInputStream;
import java.net.URL;
import java.util.List;

import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
Expand All @@ -12,7 +13,9 @@
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.alibaba.fastsql.sql.repository.Schema;
import com.alibaba.otter.canal.parse.inbound.TableMeta;
import com.google.common.collect.Lists;

/**
* @author agapple 2017年8月1日 下午7:15:54
Expand Down Expand Up @@ -66,4 +69,24 @@ public void test3() throws Throwable {
System.out.println(meta);
Assert.assertTrue(meta.getFields().get(0).getColumnName().equalsIgnoreCase("id"));
}

@Test
public void test_any() throws Throwable {
MemoryTableMeta memoryTableMeta = new MemoryTableMeta();
URL url = Thread.currentThread().getContextClassLoader().getResource("dummy.txt");
File dummyFile = new File(url.getFile());
File create = new File(dummyFile.getParent() + "/ddl", "ddl_any.sql");
String sql = StringUtils.join(IOUtils.readLines(new FileInputStream(create)), "\n");
memoryTableMeta.apply(null, "test", sql, null);

List<String> tableNames = Lists.newArrayList();
for (Schema schema : memoryTableMeta.getRepository().getSchemas()) {
tableNames.addAll(schema.showTables());
}

for (String table : tableNames) {
TableMeta sourceMeta = memoryTableMeta.find("test", table);
System.out.println(sourceMeta.toString());
}
}
}
12 changes: 12 additions & 0 deletions parse/src/test/resources/ddl/ddl_any.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CREATE TABLE procs_priv (
Host char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
Db char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
User char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
Routine_name char(64) CHARACTER SET utf8 NOT NULL DEFAULT '',
Routine_type enum('FUNCTION','PROCEDURE') COLLATE utf8_bin NOT NULL,
Grantor char(77) COLLATE utf8_bin NOT NULL DEFAULT '',
Proc_priv set('Execute','Alter Routine','Grant') CHARACTER SET utf8 NOT NULL DEFAULT '',
Timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (Host,Db,User,Routine_name,Routine_type),
KEY Grantor (Grantor)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Procedure privileges'
4 changes: 3 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
<java_source_version>1.8</java_source_version>
<java_target_version>1.8</java_target_version>
<file_encoding>UTF-8</file_encoding>
<javadoc_skip>true</javadoc_skip>
<spring_version>3.2.18.RELEASE</spring_version>
<rocketmq_version>4.5.2</rocketmq_version>
<maven-jacoco-plugin.version>0.8.3</maven-jacoco-plugin.version>
Expand Down Expand Up @@ -221,7 +222,7 @@
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.28</version>
<version>1.2.58</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
Expand Down Expand Up @@ -417,6 +418,7 @@
</execution>
</executions>
<configuration>
<skip>${javadoc_skip}</skip>
<!-- workaround for https://bugs.openjdk.java.net/browse/JDK-8212233 -->
<javaApiLinks>
<property>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.alibaba.otter.cancel.store.memory.buffer;
package com.alibaba.otter.canal.store.memory.buffer;

import java.net.InetSocketAddress;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.alibaba.otter.cancel.store.memory.buffer;
package com.alibaba.otter.canal.store.memory.buffer;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.alibaba.otter.cancel.store.memory.buffer;
package com.alibaba.otter.canal.store.memory.buffer;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.alibaba.otter.cancel.store.memory.buffer;
package com.alibaba.otter.canal.store.memory.buffer;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.alibaba.otter.cancel.store.memory.buffer;
package com.alibaba.otter.canal.store.memory.buffer;

import java.util.ArrayList;
import java.util.List;
Expand Down

0 comments on commit bd974e3

Please sign in to comment.