apache / apache/shardingsphere
panic: pq: No value specified for parameter 1. when using Golang XORM
- Dominant language
- Java
- Stars
- 20.8k
- Forks
- 6.9k
- Avg merge
- 11h 35m
- Merged PRs (30d)
- 326
Description
## Bug Report
### Which version of ShardingSphere did you use?
master - e71e94d7e1b71694402829ea0074cb085129069e
This issue may be caused by https://github.com/apache/shardingsphere/pull/13692
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy PostgreSQL
### Expected behavior
Query returned correct result.
### Actual behavior
```
panic: pq: No value specified for parameter 1.
```
### Reason analyze (If you can)


### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
```yaml
schemaName: postgres
dataSources:
ds_0:
url: jdbc:postgresql://127.0.0.1:5432/postgres?prepareThreshold=1
username: postgres
password: postgres
connectionTimeoutMilliseconds: 3000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 32
minPoolSize: 0
rules: []
```
### Reproduce
```
docker run \
--network host \
-e driverName=postgres \
-e dataSourceName='user=postgres password=postgres host=127.0.0.1 port=55432 sslmode=disable dbname=casdoor' \
casbin/casdoor:v1.171.0
```
```
panic: pq: No value specified for parameter 1.
goroutine 1 [running]:
github.com/casdoor/casdoor/object.(*Adapter).createTable(0xc0000b4ec0)
/go/src/casdoor/object/adapter.go:128 +0x8ce
github.com/casdoor/casdoor/object.InitAdapter(0x0)
/go/src/casdoor/object/adapter.go:53 +0xb1
main.main()
/go/src/casdoor/main.go:38 +0xa7
```
Contributor guide
Research direction
Start by running the supplied ShardingSphere-Proxy PostgreSQL configuration and Casdoor Docker reproduction, using the stack trace at casdoor/object/adapter.go:128 as the client-side entry point while tracing prepared-parameter handling in the proxy. Done means the reproduction no longer panics and the query returns the correct result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, java, postgresql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100