When running a DML statement such as 'update' in the
SQL window it would be nice to see a checkbox that says
"Rollback updates/deletes when finished". This would be
directly next to or below the existing checkbox "Show
this query here again"
This way you could run an update SQL and see the
'affected rows' value without actually committing the
transaction. Seeing the 'affected rows' kinda
indicates the relative success or failure of your DML.
Of course, the ability to rollback or commit
transaction only applies to InnoDB type tables...
Logged In: YES
user_id=210714
Not easy to implement: we have to check every table name in
the query, some might be InnoDB and some not!
If we don't do that and offer the "rollback" checkbox, we
cannot garantee a rollback will occur.
Logged In: YES
user_id=210714
Originator: NO
Suggested by jganders:
You'd have get the table name string from the sql, then
explode the string by commas. Foreach element you'd have to
lookup the table type, and you're almost there; allow the
rollback option when all tables are InnoDB!
Update and delete ops can have multiple tables, inserts can not.
I dont know if this helps.
Hello Marc,
under Simulation of DML Queries, do we only need to get the affected rows and tables and their count ?
Or
also get some other things like foreign key dependencies that will be violated ?
Well, the more information about the update that the user receives, the better.
Hi Marc,
do we need to implement this feature only for DML queries?
Hi Ashutosh,
It would be also useful for DDL.
Hi Marc,
I was looking in MySQL documentation and found [1]. I observed that most of DDL statements cause an 'implicit' commit and can't be rolled back. So I think this feature will work best with DML.
[1] : http://dev.mysql.com/doc/refman/5.0/en/implicit-commit.html
Last edit: Ashutosh Dhundhara 2014-06-20
Hi Ashutosh,
I agree with your suggestion.