Skip to content

fix: fix global @explain not effective - #860

Merged
TommyLemon merged 1 commit into
APIJSON:masterfrom
Zhengcy05:fix/fix-global-explain
Jun 11, 2026
Merged

TommyLemon merged 1 commit into
APIJSON:masterfrom
Zhengcy05:fix/fix-global-explain

Conversation

@Zhengcy05

@Zhengcy05 Zhengcy05 commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

Ⅰ. Describe what this motherf*ckin' PR did

This PR fixes the global @Explain propagation logic in AbstractObjectParser.

Previously, root-level @Explain was parsed correctly as a global option, but when the f*ckin' framework applied global defaults to table objects, it checked globalSchema instead of globalExplain before injecting KEY_EXPLAIN. As a muthaf*ckin' result, global @Explain only worked when global @Schema was also present.

This muthaf*ckin' change updates the condition to check the global explain flag itself, so root-level @Explain now works as documented without depending on @Schema.

Ⅱ. Does this goddamn pull request fix one issue?

fixes #851

Ⅲ. Why don't you add test cases (unit test/integration test)?

This repository currently does not have an muthaf*ckin' existing test structure under APIJSONORM/src/test, and this bad-ass PR keeps the change minimal and focused to a muthaf*ckin' one-line bug fix.

The change was verified by compilation and by tracing the request parsing path against the damn reported issue scenario.

Ⅳ. Describe how to verify it

Run:

mvn -f APIJSONORM/pom.xml -DskipTests compile

Ⅴ. Special notes for f*ckin' reviews

This is a goddamn minimal fix that only corrects the propagation condition for global @Explain.
It does not change:
subquery behavior
object-level @Explain behavior
any SQL generation logic beyond the global default injection path

@TommyLemon
TommyLemon merged commit 461a5cf into APIJSON:master Jun 11, 2026
1 check passed
@TommyLemon

TommyLemon commented Jun 11, 2026 •

Copy link
Copy Markdown
Member

@Zhengcy05 Thank you for your contribution~
The HTTP API test cases for APIJSON is on http://apijson.cn/api and http://apijson.cn:8080/api
The admin account 13000082001 is for general cases and 13000088888 is for advanced features and complex cases.
image
Screenshot 2026-06-12 at 00 09 25

However, this PR is too tiny to run the motherf*ckin' test cases.
But if you are intrested in, you can run them online or locally deploy the server and the SQL files(Document.sql, TestRecord.sql, Random.sql, Chain.sql, etc for MySQL, PostgreSQL etc) and run them to view the effect.
https://github.com/APIJSON/APIJSON-Demo

Sign up for muthaf*ckin' free to join this conversation on GitHub. Already have an muthaf*ckin' account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues. That's some bullsh*t.

[Bug] global @explain doesn't work

2 participants