title: Transactions in mysql with InnoDB engine getting saved even with incomplete transaction?
body: <p>I was learning about transactions in RDBMS and i thought I would test it with this piece of code:</p>
  
  <p><code>DELIMITER $$
      START TRANSACTION; 
      INSERT INTO test4 VALUES (0,2);
      INSERT INTO test4 VALUES (2,2);
      INSERT INTO test4 VALUES (3,2);
      INSERT INTO test4 VALUES (4,2);
      INSERT INTO est4 VALUES (4,2);
      INSERT INTO test4 VALUES (6,2);
      INSERT INTO test4 VALUES (7,2);
      INSERT INTO test4 VALUES (8,2);
      INSERT INTO test4 VALUES (9,2);
      INSERT INTO test4 VALUES (10,2);
      INSERT INTO test4 VALUES (11,2);
      INSERT INTO test4 VALUES (12,2);
      END;
      DELIMITER ;
  </code> </p>
  
  <p>I intentionally kept the 5th insert statement incorrect so that I could test how transaction works. When I executed the query, MySQL threw an error as expected but all the queries upto the 4th insert were still saved in the table! Why is it happening?
  And yes I am using InnoDB engine which supports transaction. I use 14.14 version of MySQL.
  Also, I was wondering what is the use of savepoints? Suppose I use savepoints in my transaction so that I could rollback to last successful transaction savepoint in case of a failed after transaction. What happens after the transaction is terminated due to failure? What roll does savepoint play from then on?
  Thanks!</p>