You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "azexcy (via GitHub)" <gi...@apache.org> on 2023/02/09 12:45:03 UTC

[GitHub] [shardingsphere] azexcy commented on a diff in pull request #24049: Fix unicode cannot be decoded correctly at TestDecodingPlugin

azexcy commented on code in PR #24049:
URL: https://github.com/apache/shardingsphere/pull/24049#discussion_r1101416212


##########
kernel/data-pipeline/dialect/postgresql/src/main/java/org/apache/shardingsphere/data/pipeline/postgresql/ingest/wal/decode/TestDecodingPlugin.java:
##########
@@ -208,26 +211,60 @@ private String readNextSegment(final ByteBuffer data) {
         return eventType.toString();
     }
     
+    private String readNextJson(final ByteBuffer data) {
+        data.get();
+        int offset = 0;
+        int startPosition = data.position();
+        while (data.hasRemaining()) {
+            char c = (char) data.get();
+            if ('}' != c) {
+                offset++;
+                continue;
+            }
+            char c2 = (char) data.get();
+            if ('\'' != c2) {
+                offset++;
+                continue;
+            }
+            char c3 = (char) data.get();
+            if (' ' == c3) {

Review Comment:
   I improved json parse



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org