You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/10/22 11:16:40 UTC

[GitHub] [ignite-3] AMashenkov opened a new pull request #409: IGNITE-15744: Fix vartable size overflow

AMashenkov opened a new pull request #409:
URL: https://github.com/apache/ignite-3/pull/409


   https://issues.apache.org/jira/browse/IGNITE-15744


-- 
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@ignite.apache.org

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



[GitHub] [ignite-3] AMashenkov merged pull request #409: IGNITE-15744: Fix vartable size overflow

Posted by GitBox <gi...@apache.org>.
AMashenkov merged pull request #409:
URL: https://github.com/apache/ignite-3/pull/409


   


-- 
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@ignite.apache.org

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



[GitHub] [ignite-3] Berkof commented on a change in pull request #409: IGNITE-15744: Fix vartable size overflow

Posted by GitBox <gi...@apache.org>.
Berkof commented on a change in pull request #409:
URL: https://github.com/apache/ignite-3/pull/409#discussion_r738117092



##########
File path: modules/schema/src/main/java/org/apache/ignite/internal/schema/row/VarTableFormat.java
##########
@@ -169,26 +170,21 @@ int vartableEntryOffset(int idx) {
          * Creates chunk format.
          */
         TinyFormat() {
-            super(Byte.BYTES, Byte.BYTES, (byte)1);
+            super(Byte.BYTES, (byte)1);

Review comment:
       MAGIC_NUMBERS (flags)

##########
File path: modules/schema/src/main/java/org/apache/ignite/internal/schema/row/VarTableFormat.java
##########
@@ -208,7 +204,7 @@ int vartableEntryOffset(int idx) {
          * Creates chunk format.
          */
         MediumFormat() {
-            super(Short.BYTES, Short.BYTES, (byte)2);
+            super(Short.BYTES, (byte)2);

Review comment:
       MAGIC_NUMBER (flags)

##########
File path: modules/schema/src/main/java/org/apache/ignite/internal/schema/row/VarTableFormat.java
##########
@@ -169,26 +170,21 @@ int vartableEntryOffset(int idx) {
          * Creates chunk format.
          */
         TinyFormat() {
-            super(Byte.BYTES, Byte.BYTES, (byte)1);
+            super(Byte.BYTES, (byte)1);
         }
 
         /** {@inheritDoc} */
         @Override int readVarlenOffset(BinaryRow row, int vartblOff, int entryIdx) {
             return Byte.toUnsignedInt(row.readByte(vartblOff + vartableEntryOffset(entryIdx)));
         }
 
-        /** {@inheritDoc} */
-        @Override int readVartableSize(BinaryRow row, int vartblOff) {
-            return Byte.toUnsignedInt(row.readByte(vartblOff));
-        }
-
         /** {@inheritDoc} */
         @Override public int compactVarTable(ExpandableByteBuf buf, int vartblOff, int entres) {
-            assert entres > 0;
+            assert entres > 0 && entres < 0xFFFF;
 
-            buf.put(vartblOff, (byte)entres);
+            buf.putShort(vartblOff, (short)entres);
 
-            int dstOff = vartblOff + 1;
+            int dstOff = vartblOff + 2;

Review comment:
       MAGIC_NUMBERS




-- 
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@ignite.apache.org

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