On Sun, 2006-06-18 at 19:59 +0400, Andrey Panin wrote:
Here is a big problem with transaction support in MySQL driver: it simpy doesn't work :( sql_transaction_commit_s() function fails and MySQL reports this error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ';UPDATE ...
Looks like mysql_query() chokes if query contains semicolon.
Did you really test with the few days old code? Because I added this which fixed it for me:
#ifdef CLIENT_MULTI_STATEMENTS /* Updates require this because everything is committed in one large SQL statement. */ db->client_flags |= CLIENT_MULTI_STATEMENTS; #endif
IMHO we must just use MySQL BEGIN/COMMIT/ROLLBACK and let users care about transaction safety of their databases.
I don't think that's such a good idea, because if transactions aren't supported (and isn't that how MySQL is most commonly still used?) the rollback command does nothing and that can cause problems (like wrongly updating quota).