gfphoenix78 commented on code in PR #1257:
URL: https://github.com/apache/cloudberry/pull/1257#discussion_r2231011552


##########
src/backend/executor/nodeModifyTable.c:
##########
@@ -99,8 +101,43 @@ static TupleTableSlot 
*ExecPrepareTupleRouting(ModifyTableState *mtstate,
                                                                                
           TupleTableSlot *slot,
                                                                                
           ResultRelInfo **partRelInfo);
 
+typedef struct ModifiedLeafRelidsKey
+{
+       CmdType cmd;
+       Oid             relid;
+
+} ModifiedLeafRelidsKey;
+
+typedef struct ModifiedLeafRelidsData
+{
+       ModifiedLeafRelidsKey   key;
+} ModifiedLeafRelidsData;
+
+static uint32
+modified_leaf_hash(const void *key, Size keysize)
+{
+       Assert(keysize == sizeof(ModifiedLeafRelidsKey));
+       return DatumGetUInt32(hash_any((const unsigned char*) key,

Review Comment:
   keysize is not used in static assert. static assert like
   
   ```c
   StaticAssertDecl(sizeof(Oid) + sizeof(CmdType) == 
sizeof(ModifiedLeafRelidsKey));
   ```
   
   to make sure there is no padding in the struct, or the hash/compare 
functions should take care of the it.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to