result does not match database data
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MySQL Connector/Python |
Invalid
|
Undecided
|
Unassigned |
Bug Description
How to reproduce:
from mysql.connector
db = MySQLConnection(
unix_socket = "/var/run/
user = "user",
password = "pass",
database = "database"
)
sql = """
SELECT p.*
FROM `cw_product_part` p
WHERE p.`product_id` = 253353 AND p.`deleted` = 0
ORDER BY p.`position`
"""
cur = db.cursor()
cur.execute(sql)
for row in cur:
# gives 2 rows
print row
cur.close()
print "\n\n
import time
time.sleep(20)
# now in phpmyadmin i change `deleted` = 1 on one of two rows
# do same query once again
cur = db.cursor()
cur.execute(sql)
for row in cur:
# gives same 2 rows, should give only one
print row
cur.close()
python -c "import mysql.connector as db; print db.__version__"
(0, 3, 2, 'devel', 292)
python --version
Python 2.6.5
mysql -NB -e "SELECT VERSION()"
5.5.17-55-log
(percona server)
uname -a
Linux sunfox 2.6.32-36-server #79-Ubuntu SMP Tue Nov 8 22:44:38 UTC 2011 x86_64 GNU/Linux
Changed in myconnpy: | |
importance: | Critical → Undecided |
Changed in myconnpy: | |
status: | In Progress → Invalid |
assignee: | Geert JM Vanderkelen (geertjmvdk) → nobody |
Please check:
1) You are using MySQL 5.5, so default storage engine is InnoDB, means that it is transactional
2) and if so, make sure you do COMMIT when you are updating data.