PyMySQL returning old/snapshot values/not rerunning query?

微笑、不失礼 提交于 2019-11-29 06:33:14

I do not understand why this is necessary, but you can fix it by either

  1. Adding autocommit=True into the connect() parameters.

  2. Calling conn.commit() after the cursor.execute() command.

Seems it starts a transaction at a snapshot or something by default. I (nervously!) submitted an issue on the pymysql repo, as I'd not heard anything back here. This was closed immediately with the explanation

It's repeatable read

If anyone knows something better than using autocommit let me know.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!