SPLWare / SPLWare/esProc

并发问题

Open
#5 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
4.7k
Forks
364
PR merge metrics
No merged PRs in 30d

Description

select 字段1 + '#'+字段2 from table_1

我要表达的意思是不支持并发,根本原因是 ExpressionTranslator这个类的 marksList与funcsList 是static对象,这边能优化这个地方么?

java.sql.SQLException: String index out of range: -1
at com.esproc.jdbc.InternalStatement.executeJDBC(InternalStatement.java:286)
at com.esproc.jdbc.InternalStatement$1.run(InternalStatement.java:148)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.AbstractStringBuilder.replace(AbstractStringBuilder.java:851)
at java.lang.StringBuffer.replace(StringBuffer.java:452)
at com.scudata.dm.query.utils.ExpressionTranslator.moveInMarks(ExpressionTranslator.java:257)
at com.scudata.dm.query.utils.ExpressionTranslator.translateExp(ExpressionTranslator.java:115)
at com.scudata.dm.query.SimpleSelect.execute(SimpleSelect.java:6298)
at com.scudata.dm.query.SimpleSelect.query(SimpleSelect.java:3007)
at com.scudata.dm.query.SimpleJoin.query(SimpleJoin.java:5129)
at com.scudata.dm.query.SimpleUnion.query(SimpleUnion.java:84)
at com.scudata.dm.query.SimpleSQL.execute(SimpleSQL.java:140)
at com.scudata.app.common.AppUtil.executeSql(AppUtil.java:198)
at com.esproc.jdbc.JDBCUtil.execute(JDBCUtil.java:398)
at com.esproc.jdbc.InternalStatement.executeJDBC(InternalStatement.java:267)
... 1 common frames omitted

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in ExpressionTranslator.java at translateExp and moveInMarks, then inspect how the static marksList and funcsList are used during the failing SQL execution. Reproduce the reported query with concurrent executions and trace the String index error. Done means concurrent queries no longer produce the reported SQLException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, sql
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.