We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
版本:v4.6.7 1)执行http://localhost:8080/post { "Moment":{ "content":"adsfasdfasdfasdf" }, "tag":"Moment" } 可以成功执行 2)但如果我需要看执行性能 { "Moment":{ "content":"adsfasdfasdfasdf" }, "tag":"Moment", "@Explain":true } 就会报异常。
异常代码: `boolean explain = config.isExplain(); if (explain) { //如果先执行 explain,则 execute 会死循环,所以只能先执行非 explain config.setExplain(false); //对下面 config.getSQL(false); 生效 JSONObject res = getSQLExecutor().execute(config, false);
//执行了第二次导致的错误 config.setExplain(explain); JSONObject explainResult = config.isMain() && config.getPosition() != 0 ? null : getSQLExecutor().execute(config, false); if (explainResult == null) { result = res; } else { result = new JSONObject(true); result.put(KEY_EXPLAIN, explainResult); result.putAll(res); } }`
The text was updated successfully, but these errors were encountered:
SQL 对 SELECT 外的操作不支持 EXPLAIN。这里应该只对 RequestMethod.isQueryMethod(config.getMethod, true) 执行 EXPLAIN SQL,其它的操作直接 return 一个只有 "sql": config.getSQL(false) 这个键值对的 JSONObject。
感谢反馈,可以提个 Pull Request,会把你加到贡献者列表里哦 https://github.com/Tencent/APIJSON/blob/master/CONTRIBUTING.md
Sorry, something went wrong.
fix: @Explain在更新方法应用的错误
838b3b0
explain只应用在select请求中,如果是更新请求 不需要执行explain,但可以返回sql语句 issue Tencent#218 closes Tencent#218
Successfully merging a pull request may close this issue.
版本:v4.6.7
1)执行http://localhost:8080/post
{
"Moment":{
"content":"adsfasdfasdfasdf"
},
"tag":"Moment"
}
可以成功执行
2)但如果我需要看执行性能
{
"Moment":{
"content":"adsfasdfasdfasdf"
},
"tag":"Moment",
"@Explain":true
}
就会报异常。
异常代码:
`boolean explain = config.isExplain();
if (explain) { //如果先执行 explain,则 execute 会死循环,所以只能先执行非 explain
config.setExplain(false); //对下面 config.getSQL(false); 生效
JSONObject res = getSQLExecutor().execute(config, false);
The text was updated successfully, but these errors were encountered: