JoverZhang opened a new issue, #55729:
URL: https://github.com/apache/doris/issues/55729

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Version
   
   master branch
   
   ### What's Wrong?
   
   When running SHOW TRANSACTION with a non-existent label, Doris throws a 
NullPointerException instead of returning a proper error message.
   
   ```sql
   MySQL [email protected]:t1> SHOW TRANSACTION FROM t1 WHERE label = 'label_b';
   (1105, 'errCode = 2, detailMessage = Cannot invoke 
"java.lang.Long.longValue()" because the return value of 
"org.apache.doris.transaction.GlobalTransactionMgrIface.getTransactionId(java.lang.Long,
 String)" is null')
   ```
   
   ### What You Expected?
   
   The behavior should be consistent with querying a non-existent TransactionId:
   
   ```sql
   MySQL [email protected]:t1> SHOW TRANSACTION FROM t1 WHERE label = 'label_b';
   (1105, 'errCode = 2, detailMessage = transaction with label 'label_b' does 
not exist)
   ```
   
   ### How to Reproduce?
   
   ```sql
   CREATE TABLE t (id INT, x INT) PROPERTIES("replication_num" = "1");
   INSERT INTO t WITH LABEL label_a VALUES (1, 2);
   
   -- works fine
   SHOW TRANSACTION WHERE label = 'label_a';
   
   -- throws NPE
   SHOW TRANSACTION WHERE label = 'label_b';
   ```
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


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