0

There are two transactions. One transaction I used BEGIN RO for read-only transaction. While the other one I used BEGIN to allow me adding a new column to my table called dummy_table. This is what I've done :

The transcation is aborted

However, after committing (even though I'm getting error transaction aborted), the column is successfully added.

For testing, I tried to UPDATE one of the row instead, the tx2 able to COMMIT successfully. May I know what is the cause of the problem? Why is adding column causing the transaction to abort? What kind of improvement can I do?

4
  • I'll remove the PostgreSQL tag, ok? Oct 15, 2019 at 7:33
  • Is this really mysql? As far as I know there's no CLOSE; statement and I can't find anything in the documentation about it. CLOSE; results in a syntax error.
    – tombom
    Oct 15, 2019 at 8:12
  • I used Google Spanner so Im not very sure which SQL language they use. but its the most similar to MySQL so far. Oct 15, 2019 at 8:26
  • What datatype is ip_addrs supposed to be? Etc. The ALTER is incomplete.
    – Rick James
    Oct 18, 2019 at 16:04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.