eugene
eugene

Reputation: 41735

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".

  1. Suppose program(A) generates result set of "select" using a prepared statement.
  2. Now, program(B) "inserts" new rows.
  3. 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

Upvotes: 0

Views: 180

Answers (1)

eugene
eugene

Reputation: 41735

for the record,

it was autocommit off that caused the problem.

Upvotes: 1

Related Questions