0

Disclaimer: I'm trying to do something very bad and if you think I shouldn't be doing this, that's wonderful but I'm still going to do it because I'm being told explicitly to either do this or show that it can't be done.

I have a piece of code that I have absolutely 0.00% control over. This piece of code cannot be changed or edited by me in any way, I don't have the source and have no way of obtaining it. I only have control over the MySQL db itself. The code I am working with connects to the MySQL db and attempts to do an update on a table I do not want updated. The update is pointless and destructive and should not happen but the code will not proceed unless the update query goes through.

I need MySQL to lie about the update. Is there any setting or option or anything to make it so when something connects to MySQL with an account that doesn't have write access to a table tries to do an update... MySQL will just tell the client "Yeah sure no problem, update complete." and then just not do it?

KatDevsGames
  • 1,109
  • 10
  • 21
  • Dump the table,do the update,drop the table and recreate it from the dump. – Mihai Dec 31 '13 at 17:15
  • Most DBMS support `instead of` triggers - I don't know if MySQL does though. –  Dec 31 '13 at 17:15
  • Connecting to a database without write permissions and attempting an update? I suggest showing that it can't be done. – Dan Bracuk Dec 31 '13 at 17:21
  • You can create a trigger which rolls back any changes if the userID matches whatever. Not nice - but possible... – Neville Kuyt Dec 31 '13 at 18:22

0 Answers0