Repository navigation
fix: add missing space before WHERE in DeviceMapper.update (#2239) - #2241
Merged
648540858 merged 1 commit intoOct 20, 2026
Merged
Conversation
|
@CieveMe is attempting to deploy a commit to the 648540858's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2239
What was wrong
On the
2.7.3branch,DeviceMapper.update()renders the statement with theWHEREkeyword glued to the previous parameter:PostgreSQL rejects it:
This path runs during startup:
SipRunneriterates over every device withon_line = trueand callsdeviceMapper.update(). So any deployment that ever had an online device fails on every restart ("Application run failed"), and withrestart: alwaysit loops forever.Root cause
src/main/java/com/genersoft/iot/vmp/gb28181/dao/DeviceMapper.javaon2.7.3:The two literals are adjacent, so
javacfolds them into one static text node and MyBatis has no<if>boundary where it could insert a separator. There is literally no whitespace in the compiled annotation value.Regression: introduced by
b0b5a0f5(2025-05-22, 国标级联调整注册逻辑), which removed the<if>wrappers from this UPDATE. It was fixed onmasterby3845c032(2025-05-29, 修复 sql 语法错误), but2.7.3HEAD isb1ff1ef(2025-05-26) — three days earlier — so the fix never reached this branch.Change
Add the missing space. The block is now identical to
master. No other change, no formatting noise.How to verify
server_id=#{serverId}WHERE device_id=#{deviceId}server_id=#{serverId} WHERE device_id=#{deviceId}2.7.3against PostgreSQL, let one GB28181 device register successfully (sowvp_device.on_line = true), then restart wvp. Before the patch it fails at startup; after the patch it starts normally.Scope and notes
2.7.3.masteralready contains this fix (3845c032).dev/1400carries the same defect: itsDeviceMapper.java:146-147is identical, and its HEAD3dfea4ed(2025-07-10) is after the master fix, so it simply never received it. Happy to send the same one-line change againstdev/1400if that is the branch you prefer to take patches on.mvn -DskipTests compilesucceeds before and after the change, plus the compiled-annotation comparison in step 2. I did not run a full deployment against a real device.