You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/06/20 11:48:08 UTC
[GitHub] [shardingsphere] lcxywfe opened a new issue, #18461: Django.db with ShardingProxy not commit after update
lcxywfe opened a new issue, #18461:
URL: https://github.com/apache/shardingsphere/issues/18461
## Bug Report
### Which version of ShardingSphere did you use?
5.1.2
Django version: 3.0.4
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy
### Expected behavior
Update mysql with django.db
### Actual behavior
The update will not be committed and lock the row;
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
```
import os
import django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.settings")
django.setup()
from sharding_test.models import ShardingTest
ShardingTest.objects.filter(id=1).update(v=9)
```
It could be reproduced with simple update and simple mysql table
The log of ShardingProxy:
```
[INFO ] 2022-06-20 11:45:15.385 [ShardingSphere-Command-120] ShardingSphere-SQL - Logic SQL: SELECT @@SQL_AUTO_IS_NULL
[INFO ] 2022-06-20 11:45:15.385 [ShardingSphere-Command-120] ShardingSphere-SQL - SQLStatement: MySQLSelectStatement(table=Optional.empty, limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
[INFO ] 2022-06-20 11:45:15.385 [ShardingSphere-Command-120] ShardingSphere-SQL - Actual SQL: ds_11 ::: SELECT @@SQL_AUTO_IS_NULL
[INFO ] 2022-06-20 11:45:15.394 [ShardingSphere-Command-120] ShardingSphere-SQL - Logic SQL: UPDATE `ProjectIndexRecord` SET `status` = 1 WHERE `ProjectIndexRecord`.`project_id` = 30000
[INFO ] 2022-06-20 11:45:15.395 [ShardingSphere-Command-120] ShardingSphere-SQL - SQLStatement: MySQLUpdateStatement(orderBy=Optional.empty, limit=Optional.empty)
[INFO ] 2022-06-20 11:45:15.395 [ShardingSphere-Command-120] ShardingSphere-SQL - Actual SQL: ds_0 ::: UPDATE `ProjectIndexRecord` SET `status` = 1 WHERE `ProjectIndexRecord`.`project_id` = 30000
```
### Example codes for reproduce this issue (such as a github link).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] TeslaCN commented on issue #18461: Django.db with ShardingProxy not commit after update
Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #18461:
URL: https://github.com/apache/shardingsphere/issues/18461#issuecomment-1161137700
The flag `AUTO_COMMIT` returned by Proxy is always `true`, which causes this issue.
![image](https://user-images.githubusercontent.com/20503072/174704169-8bdd6001-d1ab-4552-bcaf-131f27c1c303.png)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] tristaZero closed issue #18461: Django.db with ShardingProxy not commit after update
Posted by GitBox <gi...@apache.org>.
tristaZero closed issue #18461: Django.db with ShardingProxy not commit after update
URL: https://github.com/apache/shardingsphere/issues/18461
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] tristaZero commented on issue #18461: Django.db with ShardingProxy not commit after update
Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #18461:
URL: https://github.com/apache/shardingsphere/issues/18461#issuecomment-1166516356
@lcxywfe Good report, thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org