-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
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
两张表进行内链查询时,第二张表查询生成的库为默认sys #681
Comments
发下 DemoSQLConfig 的配置,数据库的 dbUri, dbAccount, dbPassword 等敏感信息可以改为 *** 或截屏打马赛克。 |
重写的 APIJSONObjectParser newSQLConfig方法,以下是关键信息:
获取数据源信息后,对APIJSONSQLConfig进行赋值操作。打印是正确的。如果是配置的数据源不对,主表却是正确的。交换主副表后,依旧是主表正常,生成的sql副标的确不是反引号包括的。 |
另外,这是config配置: public class EagleSQLConfig extends APIJSONSQLConfig {
|
设置DEFAULT_SCHEMA 默认为 db_wh_portal_xl 后,生成的sql中副表的确对了,但是别名和参数中都没有用反引号包括,查询依旧错误。 |
DEFAULT_SCHEMA = DATABASE_MYSQL 试试。 APIJSONApplication.DEFAULT_APIJSON_CREATOR = new APIJSONCreator<Long>() {
@Override
public SQLConfig createSQLConfig() {
return new EagleSQLConfig();
}
}; 相关 issue: |
debug 了一下源码发现是重写getSQLDatabase方法的问题,在生成sql时调用了该方法,但是该方法返回了null。删除该方法即可 |
getSQLDatabase 的返回值是最终使用执行 SQL 的数据库类型 |
Description
查询条件:
响应:
生成的sql:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
已生成 1 条 SQL
execute startTime = 1706856326717
database = ; schema = db_wh_portal_xl; sql =
"sys"."Tbl_audit_data" 这里应该为db_wh_portal_xl.Tbl_audit_data才对。
请问是哪里写错了?
The text was updated successfully, but these errors were encountered: