mysql prepared statements stores(caches) result of select?
First, this question refers to c api of prepared statements, and mysql version 5.1.48.
I have one program(A) that does "select" and another(B) does "insert/update" I'd like the program(A) that does "select" to recognize new rows after program(B)'s "insert".
- 开发者_如何学GoSuppose program(A) generates result set of "select" using a prepared statement.
- Now, program(B) "inserts" new rows.
- When program(A) "select" using the same prepared statement, it won't return the newly inserted rows.
I've tried calling mysql_stmt_reset() on the statement handle but no effect.
How do I make the program(A) to recognize that the table in question is changed and grab a new data?
(If program(A) is actually caching the results, I would like to keep that behavior while db table remains the same.)When a row is updated, and selected again, the updated info is retrieved. But newly inserted row won't be selected! bah.
Thank you
for the record,
it was autocommit off that caused the problem.
精彩评论