apache / apache/shardingsphere
Can't exeute DDL statement with python module that interfaces to a PostgreSQL database
- Dominant language
- Java
- Stars
- 20.8k
- Forks
- 6.9k
- Avg merge
- 11h 38m
- Merged PRs (30d)
- 326
Description
## Bug Report
### Which version of ShardingSphere did you use?
5.1.2
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy
### Expected behavior
DDL statement was executed successfully with python module that interfaces to a PostgreSQL database.
### Actual behavior
Got an error saying:
OperationalError: ERROR: org.apache.shardingsphere.proxy.backend.exception.TableModifyInTransactionException
### Reason analyze (If you can)
ShardingSphere-Proxy is not compatible with python module that interfaces to a PostgreSQL database, since I executed the same DDL statement successfully according the ShardingSphere-Proxy.
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
First. start ShardingSphere-Proxy successfully with two data source configured.
Second, install the python PostgreSQL database interfaces modules
```
yum install python-devel
yum install postgresql
yum install postgresql-devel
pip3 install PyGreSQL
```
Third, use the python PostgreSQL database interfaces connect the ShardingSphere-Proxy and execute the DDL statement
### Example codes for reproduce this issue (such as a github link).
```
#!/usr/bin/python3
import pgdb
conn=pgdb.connect( host='localhost', port=3307, user='your_user_name', password='your_password', dbname='your_db_name')
cur=conn.cursor()
cur.execute("create table test(id serial);")
print (cur)
conn.commit()
cur.close()
conn.close()
```
Contributor guide
Assessment
This issue has not been assessed yet.