37 Star 102 Fork 107

openGauss / openGauss-connector-jdbc

 / 详情

errMessageForQuery没有考虑长度问题

已完成
缺陷 成员
创建于  
2023-10-30 17:33
 private ErrMessageResult errMessageForQuery(String queryStr, int errIndex) {
    int line = 1;
    int scroffset = 0;
    String lineMess = queryStr;
    char[] chars = queryStr.toCharArray();  -->这里没有考虑长度问题。 errIndex后端返回的可能大于 queryStr的长度
    for (int i = 0; i <= errIndex; i++) {
      char ch = chars[i];
      if (ch == '\n') {
        line++;
        scroffset = errIndex - (i + 1);
        lineMess = lineMess.substring(lineMess.indexOf("\n") + 1);
      }
    }
    if (scroffset == 0) {
      scroffset = errIndex;
    }
    if (lineMess.contains("\n")) {
      lineMess = lineMess.substring(0, lineMess.indexOf("\n"));
    }
    return new ErrMessageResult(line, scroffset, lineMess);
  }

评论 (2)

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.

opengauss_bot 添加了
 
sig/connectors
标签

Hi @travelliu,
if you want to get quick review about your issue, please contact the owner in first: @周斌 ,
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.

travelliu 负责人设置为travelliu
travelliu 任务状态待办的 修改为已确认
travelliu 任务状态已确认 修改为修复中
travelliu 任务状态修复中 修改为已完成

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(2)
13084139 opengauss bot 1686829535 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

搜索帮助