You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/05/22 06:21:22 UTC

[GitHub] [shardingsphere] Lucas-307 opened a new pull request #5747: Supported mysql BIT data type.

Lucas-307 opened a new pull request #5747:
URL: https://github.com/apache/shardingsphere/pull/5747


   Fixes part of #4795.
   Supported mysql BIT data type.


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] codecov-commenter commented on pull request #5747: Supported mysql BIT data type.

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #5747:
URL: https://github.com/apache/shardingsphere/pull/5747#issuecomment-632530237


   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/5747?src=pr&el=h1) Report
   > Merging [#5747](https://codecov.io/gh/apache/shardingsphere/pull/5747?src=pr&el=desc) into [master](https://codecov.io/gh/apache/shardingsphere/commit/8e778cf602e03a7f8f5c87a58a178ddbfc7a6c53&el=desc) will **decrease** coverage by `0.14%`.
   > The diff coverage is `24.41%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/5747/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so)](https://codecov.io/gh/apache/shardingsphere/pull/5747?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #5747      +/-   ##
   ============================================
   - Coverage     53.34%   53.20%   -0.15%     
   - Complexity      428      432       +4     
   ============================================
     Files          1160     1169       +9     
     Lines         20485    20581      +96     
     Branches       3685     3709      +24     
   ============================================
   + Hits          10928    10950      +22     
   - Misses         8893     8962      +69     
   - Partials        664      669       +5     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/5747?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [.../db/protocol/mysql/payload/MySQLPacketPayload.java](https://codecov.io/gh/apache/shardingsphere/pull/5747/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtZGItcHJvdG9jb2wvc2hhcmRpbmdzcGhlcmUtZGItcHJvdG9jb2wtbXlzcWwvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2RiL3Byb3RvY29sL215c3FsL3BheWxvYWQvTXlTUUxQYWNrZXRQYXlsb2FkLmphdmE=) | `93.39% <0.00%> (-3.67%)` | `0.00 <0.00> (ø)` | |
   | [...ocol/postgresql/constant/PostgreSQLColumnType.java](https://codecov.io/gh/apache/shardingsphere/pull/5747/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtZGItcHJvdG9jb2wvc2hhcmRpbmdzcGhlcmUtZGItcHJvdG9jb2wtcG9zdGdyZXNxbC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvZGIvcHJvdG9jb2wvcG9zdGdyZXNxbC9jb25zdGFudC9Qb3N0Z3JlU1FMQ29sdW1uVHlwZS5qYXZh) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...et/command/query/text/PostgreSQLDataRowPacket.java](https://codecov.io/gh/apache/shardingsphere/pull/5747/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtZGItcHJvdG9jb2wvc2hhcmRpbmdzcGhlcmUtZGItcHJvdG9jb2wtcG9zdGdyZXNxbC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvZGIvcHJvdG9jb2wvcG9zdGdyZXNxbC9wYWNrZXQvY29tbWFuZC9xdWVyeS90ZXh0L1Bvc3RncmVTUUxEYXRhUm93UGFja2V0LmphdmE=) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [.../shardingsphere/kernal/context/SchemaContexts.java](https://codecov.io/gh/apache/shardingsphere/pull/5747/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUta2VybmFsL3NoYXJkaW5nc3BoZXJlLWtlcm5hbC1jb250ZXh0L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9rZXJuYWwvY29udGV4dC9TY2hlbWFDb250ZXh0cy5qYXZh) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...ava/org/apache/shardingsphere/proxy/Bootstrap.java](https://codecov.io/gh/apache/shardingsphere/pull/5747/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYm9vdHN0cmFwL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9wcm94eS9Cb290c3RyYXAuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...ere/proxy/config/yaml/YamlDataSourceParameter.java](https://codecov.io/gh/apache/shardingsphere/pull/5747/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9wcm94eS9jb25maWcveWFtbC9ZYW1sRGF0YVNvdXJjZVBhcmFtZXRlci5qYXZh) | `100.00% <ø> (ø)` | `1.00 <0.00> (+1.00)` | |
   | [...l/command/admin/initdb/MySQLComInitDbExecutor.java](https://codecov.io/gh/apache/shardingsphere/pull/5747/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktZnJvbnRlbmQvc2hhcmRpbmdzcGhlcmUtcHJveHktZnJvbnRlbmQtbXlzcWwvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3Byb3h5L2Zyb250ZW5kL215c3FsL2NvbW1hbmQvYWRtaW4vaW5pdGRiL015U1FMQ29tSW5pdERiRXhlY3V0b3IuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...ostgresql/auth/PostgreSQLAuthenticationEngine.java](https://codecov.io/gh/apache/shardingsphere/pull/5747/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktZnJvbnRlbmQvc2hhcmRpbmdzcGhlcmUtcHJveHktZnJvbnRlbmQtcG9zdGdyZXNxbC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvZnJvbnRlbmQvcG9zdGdyZXNxbC9hdXRoL1Bvc3RncmVTUUxBdXRoZW50aWNhdGlvbkVuZ2luZS5qYXZh) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...oxy/config/yaml/YamlDataSourceParameterMerger.java](https://codecov.io/gh/apache/shardingsphere/pull/5747/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9wcm94eS9jb25maWcveWFtbC9ZYW1sRGF0YVNvdXJjZVBhcmFtZXRlck1lcmdlci5qYXZh) | `17.02% <17.39%> (ø)` | `0.00 <0.00> (?)` | |
   | [...here/proxy/backend/schema/ProxySchemaContexts.java](https://codecov.io/gh/apache/shardingsphere/pull/5747/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC9zY2hlbWEvUHJveHlTY2hlbWFDb250ZXh0cy5qYXZh) | `7.86% <50.00%> (+7.86%)` | `0.00 <0.00> (ø)` | |
   | ... and [22 more](https://codecov.io/gh/apache/shardingsphere/pull/5747/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/5747?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/5747?src=pr&el=footer). Last update [38e1352...79bab12](https://codecov.io/gh/apache/shardingsphere/pull/5747?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] tuohai666 commented on a change in pull request #5747: Supported mysql BIT data type.

Posted by GitBox <gi...@apache.org>.
tuohai666 commented on a change in pull request #5747:
URL: https://github.com/apache/shardingsphere/pull/5747#discussion_r429093360



##########
File path: shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/packet/binlog/row/column/value/integer/MySQLBitBinlogProtocolValue.java
##########
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.db.protocol.mysql.packet.binlog.row.column.value.integer;
+
+import org.apache.shardingsphere.db.protocol.mysql.packet.binlog.row.column.MySQLBinlogColumnDef;
+import org.apache.shardingsphere.db.protocol.mysql.packet.binlog.row.column.value.MySQLBinlogProtocolValue;
+import org.apache.shardingsphere.db.protocol.mysql.payload.MySQLPacketPayload;
+
+import java.io.Serializable;
+
+/**
+ * BIT type value of MySQL binlog protocol.
+ */
+public class MySQLBitBinlogProtocolValue implements MySQLBinlogProtocolValue {
+    
+    @Override
+    public Serializable read(final MySQLBinlogColumnDef columnDef, final MySQLPacketPayload payload) {
+        return payload.readLong(getLength(columnDef.getColumnMeta()));
+    }
+    
+    private int getLength(final int meta) {
+        int nbits = ((meta >> 8) * 8) + (meta & 0xff);
+        return (nbits + 7) / 8;
+    }
+}

Review comment:
       I have discuss with Lucas. I think we can't resule MySQLNullBitmap, they are different.




----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] tuohai666 commented on a change in pull request #5747: Supported mysql BIT data type.

Posted by GitBox <gi...@apache.org>.
tuohai666 commented on a change in pull request #5747:
URL: https://github.com/apache/shardingsphere/pull/5747#discussion_r429093360



##########
File path: shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/packet/binlog/row/column/value/integer/MySQLBitBinlogProtocolValue.java
##########
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.db.protocol.mysql.packet.binlog.row.column.value.integer;
+
+import org.apache.shardingsphere.db.protocol.mysql.packet.binlog.row.column.MySQLBinlogColumnDef;
+import org.apache.shardingsphere.db.protocol.mysql.packet.binlog.row.column.value.MySQLBinlogProtocolValue;
+import org.apache.shardingsphere.db.protocol.mysql.payload.MySQLPacketPayload;
+
+import java.io.Serializable;
+
+/**
+ * BIT type value of MySQL binlog protocol.
+ */
+public class MySQLBitBinlogProtocolValue implements MySQLBinlogProtocolValue {
+    
+    @Override
+    public Serializable read(final MySQLBinlogColumnDef columnDef, final MySQLPacketPayload payload) {
+        return payload.readLong(getLength(columnDef.getColumnMeta()));
+    }
+    
+    private int getLength(final int meta) {
+        int nbits = ((meta >> 8) * 8) + (meta & 0xff);
+        return (nbits + 7) / 8;
+    }
+}

Review comment:
       I have discussed with Lucas. I think we can't reuse the MySQLNullBitmap, they are different.




----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] terrymanu merged pull request #5747: Supported mysql BIT data type.

Posted by GitBox <gi...@apache.org>.
terrymanu merged pull request #5747:
URL: https://github.com/apache/shardingsphere/pull/5747


   


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] codecov-commenter edited a comment on pull request #5747: Supported mysql BIT data type.

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #5747:
URL: https://github.com/apache/shardingsphere/pull/5747#issuecomment-632530237


   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/5747?src=pr&el=h1) Report
   > Merging [#5747](https://codecov.io/gh/apache/shardingsphere/pull/5747?src=pr&el=desc) into [master](https://codecov.io/gh/apache/shardingsphere/commit/8e778cf602e03a7f8f5c87a58a178ddbfc7a6c53&el=desc) will **decrease** coverage by `0.19%`.
   > The diff coverage is `24.70%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/5747/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so)](https://codecov.io/gh/apache/shardingsphere/pull/5747?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #5747      +/-   ##
   ============================================
   - Coverage     53.34%   53.14%   -0.20%     
   - Complexity      428      432       +4     
   ============================================
     Files          1160     1169       +9     
     Lines         20485    20588     +103     
     Branches       3685     3709      +24     
   ============================================
   + Hits          10928    10942      +14     
   - Misses         8893     8977      +84     
   - Partials        664      669       +5     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/5747?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [.../db/protocol/mysql/payload/MySQLPacketPayload.java](https://codecov.io/gh/apache/shardingsphere/pull/5747/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtZGItcHJvdG9jb2wvc2hhcmRpbmdzcGhlcmUtZGItcHJvdG9jb2wtbXlzcWwvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2RiL3Byb3RvY29sL215c3FsL3BheWxvYWQvTXlTUUxQYWNrZXRQYXlsb2FkLmphdmE=) | `93.39% <0.00%> (-3.67%)` | `0.00 <0.00> (ø)` | |
   | [...ocol/postgresql/constant/PostgreSQLColumnType.java](https://codecov.io/gh/apache/shardingsphere/pull/5747/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtZGItcHJvdG9jb2wvc2hhcmRpbmdzcGhlcmUtZGItcHJvdG9jb2wtcG9zdGdyZXNxbC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvZGIvcHJvdG9jb2wvcG9zdGdyZXNxbC9jb25zdGFudC9Qb3N0Z3JlU1FMQ29sdW1uVHlwZS5qYXZh) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...et/command/query/text/PostgreSQLDataRowPacket.java](https://codecov.io/gh/apache/shardingsphere/pull/5747/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtZGItcHJvdG9jb2wvc2hhcmRpbmdzcGhlcmUtZGItcHJvdG9jb2wtcG9zdGdyZXNxbC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvZGIvcHJvdG9jb2wvcG9zdGdyZXNxbC9wYWNrZXQvY29tbWFuZC9xdWVyeS90ZXh0L1Bvc3RncmVTUUxEYXRhUm93UGFja2V0LmphdmE=) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [.../shardingsphere/kernal/context/SchemaContexts.java](https://codecov.io/gh/apache/shardingsphere/pull/5747/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUta2VybmFsL3NoYXJkaW5nc3BoZXJlLWtlcm5hbC1jb250ZXh0L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9rZXJuYWwvY29udGV4dC9TY2hlbWFDb250ZXh0cy5qYXZh) | `0.00% <ø> (ø)` | `0.00 <0.00> (ø)` | |
   | [...ava/org/apache/shardingsphere/proxy/Bootstrap.java](https://codecov.io/gh/apache/shardingsphere/pull/5747/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYm9vdHN0cmFwL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9wcm94eS9Cb290c3RyYXAuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...ere/proxy/config/yaml/YamlDataSourceParameter.java](https://codecov.io/gh/apache/shardingsphere/pull/5747/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9wcm94eS9jb25maWcveWFtbC9ZYW1sRGF0YVNvdXJjZVBhcmFtZXRlci5qYXZh) | `100.00% <ø> (ø)` | `1.00 <0.00> (+1.00)` | |
   | [...l/command/admin/initdb/MySQLComInitDbExecutor.java](https://codecov.io/gh/apache/shardingsphere/pull/5747/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktZnJvbnRlbmQvc2hhcmRpbmdzcGhlcmUtcHJveHktZnJvbnRlbmQtbXlzcWwvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3Byb3h5L2Zyb250ZW5kL215c3FsL2NvbW1hbmQvYWRtaW4vaW5pdGRiL015U1FMQ29tSW5pdERiRXhlY3V0b3IuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...ostgresql/auth/PostgreSQLAuthenticationEngine.java](https://codecov.io/gh/apache/shardingsphere/pull/5747/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktZnJvbnRlbmQvc2hhcmRpbmdzcGhlcmUtcHJveHktZnJvbnRlbmQtcG9zdGdyZXNxbC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvZnJvbnRlbmQvcG9zdGdyZXNxbC9hdXRoL1Bvc3RncmVTUUxBdXRoZW50aWNhdGlvbkVuZ2luZS5qYXZh) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...oxy/config/yaml/YamlDataSourceParameterMerger.java](https://codecov.io/gh/apache/shardingsphere/pull/5747/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9wcm94eS9jb25maWcveWFtbC9ZYW1sRGF0YVNvdXJjZVBhcmFtZXRlck1lcmdlci5qYXZh) | `17.02% <17.39%> (ø)` | `0.00 <0.00> (?)` | |
   | [...here/proxy/backend/schema/ProxySchemaContexts.java](https://codecov.io/gh/apache/shardingsphere/pull/5747/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC9zY2hlbWEvUHJveHlTY2hlbWFDb250ZXh0cy5qYXZh) | `17.77% <50.00%> (+17.77%)` | `0.00 <0.00> (ø)` | |
   | ... and [28 more](https://codecov.io/gh/apache/shardingsphere/pull/5747/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/5747?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/5747?src=pr&el=footer). Last update [38e1352...8440fa8](https://codecov.io/gh/apache/shardingsphere/pull/5747?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] terrymanu commented on a change in pull request #5747: Supported mysql BIT data type.

Posted by GitBox <gi...@apache.org>.
terrymanu commented on a change in pull request #5747:
URL: https://github.com/apache/shardingsphere/pull/5747#discussion_r429064272



##########
File path: shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/packet/binlog/row/column/value/integer/MySQLBitBinlogProtocolValue.java
##########
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.db.protocol.mysql.packet.binlog.row.column.value.integer;
+
+import org.apache.shardingsphere.db.protocol.mysql.packet.binlog.row.column.MySQLBinlogColumnDef;
+import org.apache.shardingsphere.db.protocol.mysql.packet.binlog.row.column.value.MySQLBinlogProtocolValue;
+import org.apache.shardingsphere.db.protocol.mysql.payload.MySQLPacketPayload;
+
+import java.io.Serializable;
+
+/**
+ * BIT type value of MySQL binlog protocol.
+ */
+public class MySQLBitBinlogProtocolValue implements MySQLBinlogProtocolValue {

Review comment:
       It is better to add final if the class is not for extended

##########
File path: shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/packet/binlog/row/column/value/integer/MySQLBitBinlogProtocolValue.java
##########
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.db.protocol.mysql.packet.binlog.row.column.value.integer;
+
+import org.apache.shardingsphere.db.protocol.mysql.packet.binlog.row.column.MySQLBinlogColumnDef;
+import org.apache.shardingsphere.db.protocol.mysql.packet.binlog.row.column.value.MySQLBinlogProtocolValue;
+import org.apache.shardingsphere.db.protocol.mysql.payload.MySQLPacketPayload;
+
+import java.io.Serializable;
+
+/**
+ * BIT type value of MySQL binlog protocol.
+ */
+public class MySQLBitBinlogProtocolValue implements MySQLBinlogProtocolValue {
+    
+    @Override
+    public Serializable read(final MySQLBinlogColumnDef columnDef, final MySQLPacketPayload payload) {
+        return payload.readLong(getLength(columnDef.getColumnMeta()));
+    }
+    
+    private int getLength(final int meta) {
+        int nbits = ((meta >> 8) * 8) + (meta & 0xff);
+        return (nbits + 7) / 8;
+    }
+}

Review comment:
       Can we consider about reuse with MySQLNullBitmap?

##########
File path: shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/payload/MySQLPacketPayload.java
##########
@@ -222,6 +222,19 @@ public void writeIntLenenc(final long value) {
         byteBuf.writeLongLE(value);
     }
     
+    /**
+     * Read fixed length long from byte buffers.
+     * @param length length read from byte buffers

Review comment:
       Please leave a blank line between java doc tile and `@param`

##########
File path: shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/binlog/row/column/value/integer/MySQLBitBinlogProtocolValueTest.java
##########
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.db.protocol.mysql.packet.binlog.row.column.value.integer;
+
+import org.apache.shardingsphere.db.protocol.mysql.packet.binlog.row.column.MySQLBinlogColumnDef;
+import org.apache.shardingsphere.db.protocol.mysql.payload.MySQLPacketPayload;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.when;
+
+@RunWith(MockitoJUnitRunner.class)
+public class MySQLBitBinlogProtocolValueTest {

Review comment:
       It is better to add final if the class is not for extended




----------------------------------------------------------------
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.

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