You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by "wangzhigang1999 (via GitHub)" <gi...@apache.org> on 2026/04/07 13:40:51 UTC
[PR] [KYUUBI #7389] Fix wrong parameter binding order in JDBCMetadataStore#transformMetadataState [kyuubi]
wangzhigang1999 opened a new pull request, #7390:
URL: https://github.com/apache/kyuubi/pull/7390
The SQL placeholders expect (targetState, identifier, fromState) but the code passed (fromState, identifier, targetState), causing the UPDATE to set state back to fromState and match on targetState instead. This made cancelUnscheduledBatch silently fail.
### Why are the changes needed?
In `JDBCMetadataStore#transformMetadataState`, the SQL is:
```sql
UPDATE metadata SET state = ? WHERE identifier = ? AND state = ?
```
The placeholders expect `(targetState, identifier, fromState)`, but the code passes `(fromState, identifier, targetState)`:
```scala
withUpdateCount(connection, query, fromState, identifier, targetState)
```
This causes `cancelUnscheduledBatch("INITIALIZED" -> "CANCELED")` to execute:
```sql
UPDATE metadata SET state = 'INITIALIZED' WHERE identifier = ? AND state = 'CANCELED'
```
Which matches no rows and silently returns `false`. The bug has existed since v1.8.0 ([KYUUBI #4790]).
### How was this patch tested?
Added a unit test `transformMetadataState should transition state correctly` in `JDBCMetadataStoreSuite` that:
1. Inserts a metadata record with `state = "INITIALIZED"`
2. Calls `transformMetadataState(id, "INITIALIZED", "CANCELED")`
3. Asserts the method returns `true`
4. Asserts the persisted state is `"CANCELED"`
### Was this patch authored or co-authored using generative AI tooling?
No.
--
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@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
Re: [PR] [KYUUBI #7389] Fix wrong parameter binding order in JDBCMetadataStore#transformMetadataState [kyuubi]
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 closed pull request #7390: [KYUUBI #7389] Fix wrong parameter binding order in JDBCMetadataStore#transformMetadataState
URL: https://github.com/apache/kyuubi/pull/7390
--
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@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
Re: [PR] [KYUUBI #7389] Fix wrong parameter binding order in JDBCMetadataStore#transformMetadataState [kyuubi]
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on PR #7390:
URL: https://github.com/apache/kyuubi/pull/7390#issuecomment-4213308207
a stupid mistake ... thanks for fixing
--
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@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
Re: [PR] [KYUUBI #7389] Fix wrong parameter binding order in JDBCMetadataStore#transformMetadataState [kyuubi]
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on PR #7390:
URL: https://github.com/apache/kyuubi/pull/7390#issuecomment-4213357801
thanks, merged to master/1.11.2/1.10.4
--
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@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org