36 Star 99 Fork 102

openGauss / openGauss-connector-jdbc

 / 详情

JDBC执行SQL语句会自动截取SQL语句前的注释

待办的
咨询 成员
创建于  
2022-07-11 10:33

Is this a BUG REPORT or FEATURE REQUEST?:

  • bug

What happened:

         Statement  s = conn.createStatement();
         s.execute("/*\n" +
                 "aaaaa\n" +
                 "aaaaa;\n" +
                 "aaaaa\n" +
                 "aaa\n" +
                 "*/\n" +
                 "select 1 from xxxx");
7月 11, 2022 10:08:52 上午 org.opengauss.jdbc.PgResultSet getInt
非常详细:   getInt columnIndex: 1
7月 11, 2022 10:08:52 上午 org.opengauss.jdbc.PgConnection initClientLogic
非常详细: Client logic is off
7月 11, 2022 10:08:52 上午 org.opengauss.core.v3.QueryExecutorImpl execute
非常详细: [192.168.2.209:64134/121.36.15.2:26010]   simple execute, handler=org.opengauss.jdbc.PgStatement$StatementResultHandler@709ba3fb, maxRows=0, fetchSize=0, flags=17
7月 11, 2022 10:08:52 上午 org.opengauss.core.v3.QueryExecutorImpl sendParse
非常详细: [192.168.2.209:64134/121.36.15.2:26010]  FE=> Parse(stmt=null,query="
select 1 from xxxx",oids={})
7月 11, 2022 10:08:52 上午 org.opengauss.core.v3.QueryExecutorImpl sendBind
非常详细: [192.168.2.209:64134/121.36.15.2:26010]  FE=> Bind(stmt=null,portal=null)
7月 11, 2022 10:08:52 上午 org.opengauss.core.v3.QueryExecutorImpl sendDescribePortal
非常详细: [192.168.2.209:64134/121.36.15.2:26010]  FE=> Describe(portal=null)
7月 11, 2022 10:08:52 上午 org.opengauss.core.v3.QueryExecutorImpl sendExecute
非常详细: [192.168.2.209:64134/121.36.15.2:26010]  FE=> Execute(portal=null,limit=0)
7月 11, 2022 10:08:52 上午 org.opengauss.core.v3.QueryExecutorImpl sendSync

评论 (4)

travelliu 创建了咨询

Hey @travelliu, Welcome to openGauss Community.
All of the projects in openGauss Community are maintained by @opengauss-bot.
That means the developers can comment below every pull request or issue to trigger Bot Commands.
Please follow instructions at Here to find the details.

travelliu 负责人设置为周斌

输入图片说明

这里在解析SQL直接删除了前注释。 虽然对SQL无影响但是这种做法不好,删减用户对SQL对用户不友好。 这样发给内核的SQL,如果出现了错误,返回错误位置和用户对SQL都不匹配不上

/sig connectors

opengauss-bot 添加了
 
sig/connectors
标签

Hi @travelliu,
if you want to get quick review about your issue, please contact the owner in first: @Pike ,
and then any of the maintainers: @Pike
and then any of the committers: @travelliu , @aaronwell , @Loong , @Kamus , @vimiix , @汪伟
if you have any question, please contact the SIG: Connectors.

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(2)
5622128 opengauss bot 1581905080 1603209 travelliu 1650447184
Java
1
https://gitee.com/opengauss/openGauss-connector-jdbc.git
git@gitee.com:opengauss/openGauss-connector-jdbc.git
opengauss
openGauss-connector-jdbc
openGauss-connector-jdbc

搜索帮助