-
Notifications
You must be signed in to change notification settings - Fork 503
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support Clickhouse UnsignedLong, for issue #2952
- Loading branch information
Showing
3 changed files
with
29 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
extension/src/test/java/com/alibaba/fastjson2/issues/Issue2958.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.alibaba.fastjson2.issues; | ||
|
||
import com.alibaba.fastjson2.JSON; | ||
import com.clickhouse.data.value.UnsignedLong; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.math.BigInteger; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class Issue2958 { | ||
@Test | ||
public void test() throws Exception { | ||
String str = "9223372036854775808"; | ||
UnsignedLong unsignedLong = UnsignedLong.valueOf(new BigInteger(str)); | ||
String json = JSON.toJSONString(unsignedLong); | ||
assertEquals(str, json); | ||
} | ||
} |