You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "nkroker (via GitHub)" <gi...@apache.org> on 2026/04/30 14:31:55 UTC

[PR] fix(bitfield): support Redis positional '#N' offset syntax [kvrocks]

nkroker opened a new pull request, #3470:
URL: https://github.com/apache/kvrocks/pull/3470

   ## Problem                                                                                                                                                         
                                                                                                                                                                        
     `BITFIELD` commands with positional offset `#N` syntax failed in kvrocks. Redis supports `#N` as shorthand for `N * bit_width`, so `INCRBY u16 #0 1` means bit     
     offset `0 * 16 = 0`, `#1` means `16`, etc.                                                                                                                         
                                                                                                                                                                        
     Example that worked in Redis but not kvrocks:                                                                                                                  
     BITFIELD mykey OVERFLOW SAT INCRBY u16 #0 1                                                                                                                        
                                                                                                                                                                        
     ## Root Cause                                                                                                                                                      
                                                                                                                                                                        
     `GetBitOffsetFromArgument` called `ParseInt<uint32_t>` directly on offset string. `"#0"` fails integer parsing — `#` prefix was never handled.                     
                                                                                                                                                                        
     ## Fix                                                                                                                                                             
                                                                                                                                                                    
     In `CommandBitfield::Parse()`, after encoding is parsed (bit width known), detect `#` prefix and expand: `offset = N * encoding.Bits()`. Plain integer offsets
     unchanged.
                                                                                                                                                                        
     ## Test                                                                                                                                                            
                                                                                                                                                                        
     Added integration tests in `tests/gocase/unit/type/bitmap/bitmap_test.go` covering:                                                                                
     - `SET`/`GET` with `#N` across multiple positions                                                                                                              
     - `INCRBY` with `#N`                                                                                                                                               
     - `OVERFLOW SAT INCRBY` with `#N` (original failing case)                                                                                                          
     - `BITFIELD_RO GET` with `#N`                      


-- 
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: issues-unsubscribe@kvrocks.apache.org

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


Re: [PR] fix(bitfield): support Redis positional '#N' offset syntax [kvrocks]

Posted by "nkroker (via GitHub)" <gi...@apache.org>.
nkroker commented on code in PR #3470:
URL: https://github.com/apache/kvrocks/pull/3470#discussion_r3171875217


##########
src/VERSION.txt:
##########
@@ -1 +1 @@
-unstable
\ No newline at end of file
+2.15.0

Review Comment:
   Done @PragmaTwice 



-- 
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: issues-unsubscribe@kvrocks.apache.org

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


Re: [PR] fix(bitfield): support Redis positional '#N' offset syntax [kvrocks]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3470:
URL: https://github.com/apache/kvrocks/pull/3470#issuecomment-4362205904

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_kvrocks&pullRequest=3470) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [46.9% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_kvrocks&pullRequest=3470&metric=new_coverage&view=list) (required ≥ 50%)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_kvrocks&pullRequest=3470)
   
   


-- 
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: issues-unsubscribe@kvrocks.apache.org

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


Re: [PR] fix(bitfield): support Redis positional '#N' offset syntax [kvrocks]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3470:
URL: https://github.com/apache/kvrocks/pull/3470#issuecomment-4359813981

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_kvrocks&pullRequest=3470) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [46.9% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_kvrocks&pullRequest=3470&metric=new_coverage&view=list) (required ≥ 50%)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_kvrocks&pullRequest=3470)
   
   


-- 
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: issues-unsubscribe@kvrocks.apache.org

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


Re: [PR] fix(bitfield): support Redis positional '#N' offset syntax [kvrocks]

Posted by "PragmaTwice (via GitHub)" <gi...@apache.org>.
PragmaTwice commented on code in PR #3470:
URL: https://github.com/apache/kvrocks/pull/3470#discussion_r3171839217


##########
src/VERSION.txt:
##########
@@ -1 +1 @@
-unstable
\ No newline at end of file
+2.15.0

Review Comment:
   Please revert this.



-- 
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: issues-unsubscribe@kvrocks.apache.org

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


Re: [PR] fix(bitfield): support Redis positional '#N' offset syntax [kvrocks]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3470:
URL: https://github.com/apache/kvrocks/pull/3470#issuecomment-4370194702

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_kvrocks&pullRequest=3470) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [46.2% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_kvrocks&pullRequest=3470&metric=new_coverage&view=list) (required ≥ 50%)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_kvrocks&pullRequest=3470)
   
   


-- 
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: issues-unsubscribe@kvrocks.apache.org

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


Re: [PR] fix(bitfield): support Redis positional '#N' offset syntax [kvrocks]

Posted by "nkroker (via GitHub)" <gi...@apache.org>.
nkroker commented on code in PR #3470:
URL: https://github.com/apache/kvrocks/pull/3470#discussion_r3171875217


##########
src/VERSION.txt:
##########
@@ -1 +1 @@
-unstable
\ No newline at end of file
+2.15.0

Review Comment:
   Done



-- 
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: issues-unsubscribe@kvrocks.apache.org

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


Re: [PR] fix(bitfield): support Redis positional '#N' offset syntax [kvrocks]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3470:
URL: https://github.com/apache/kvrocks/pull/3470#issuecomment-4357778810

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_kvrocks&pullRequest=3470) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [46.9% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_kvrocks&pullRequest=3470&metric=new_coverage&view=list) (required ≥ 50%)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_kvrocks&pullRequest=3470)
   
   


-- 
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: issues-unsubscribe@kvrocks.apache.org

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


Re: [PR] fix(bitfield): support Redis positional '#N' offset syntax [kvrocks]

Posted by "git-hulk (via GitHub)" <gi...@apache.org>.
git-hulk merged PR #3470:
URL: https://github.com/apache/kvrocks/pull/3470


-- 
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: issues-unsubscribe@kvrocks.apache.org

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