Select after an Uncommited Update in Python-MySQLdb May be this is a newbie question but want to confirm as this is important for my app:

I'm using MySQLdb on Python and my code looks like:

db = MySQLdb.connect("localhost","root","",test)
cursor = db.cursor()


cursor.execute("UPDATE users SET address = 'Something' WHERE name = 'Someone'")
db.query("SELECT * FROM users WHERE address = 'Something'")
sample=db.store_result().fetch_row(maxrows=0)


So the question is, will sample contain the row that was changed by the uncommitted update? 

In the real app, I am making some complex queries with subclauses like GROUP_CONCAT, etc. Will all these work with uncommitted updates? (In the sense that can these work on the rows updated by uncommitted updates)
tl;dr Yes, sample will contain the rows that were just updated. 

Please note that you're not in a transaction context. So every query is an implicit transaction in this specific case.

Assuming you did have a begin somewhere sample would still see the rows because it's the same connection and the same transaction. 

If you started the transaction and opened a separate connection or you had a concurrent process/request it would only see the rows without commit if your mysql is running with READ-UNCOMMITTED transaction level.

You can check the global settings by: 

mysql&gt; show global variables like 'tx_isolation';


It can also be set for individual connection:

mysql&gt; set tx_isolation='READ-UNCOMMITTED';


I hope this answers your question.