arvindKandpal-ksolves opened a new pull request, #7971:
URL: https://github.com/apache/hbase/pull/7971

   ### Why are the changes needed?
   This is a backport of the fix for HBASE-28660 to `branch-2`.
   When a user enters an incorrect command like `list_namespace, 'ns.*'`, the 
JRuby parser mistakenly creates a local variable initialized to `nil` before 
throwing a SyntaxError. Because Ruby prioritizes local variables over method 
calls, subsequent valid commands return empty/nil instead of executing the 
actual shell command.
   
   ### How does this PR fix the problem?
   - Added the same cleanup mechanism inside `hirb.rb`'s `eval_input` loop that 
was merged into the `master` branch.
   - Checks for collisions (shadowing) with registered HBase shell commands.
   - Warns the user via `stderr` and safely discards the polluted binding.
   - Includes the updated comprehensive test cases in `general_test_cluster.rb` 
covering all 5 affected commands (`list`, `list_namespace`, `list_snapshots`, 
`scan`, `processlist`).
   
   ### Tests run
   Ran the shell tests locally on `branch-2` with the Hadoop 3 profile and 
verified that all tests pass without regressions.
   `mvn test -Dtest=TestShell -pl hbase-shell -Dhadoop.profile=3.0`


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

Reply via email to