Just rollback the transaction. Wait, you were running under a transaction right...
iiiiiiitttttttttttt
you know the computer thing is it plugged in?
Transactions are for people that make mistakes.
My first "real job" during college was a a large document management software vendor. Overheard a support call:
"Okay: delete from documents whe... what do you mean 'oops'?"
Dropping 250,000 rows from a production database and having to call the senior after hours, in tears, is a right-of-passage that everyone goes through. Right? ...right?
Tables? TABLES?
Nope, rows.
That was a typo. Which probably explains why I dropped 250,000 rows from the database to begin with.
Oh, little Bobby...
Could also have had some chairs as well.
what are those?
- mysql user
No time for that just yolo it
Write every update as a select first. Once the criteria is good, then you change it.
Nah, my motto is "break fast and move things"
I like breakfast!
I did that before. Logged in as read only access. 80k rows updated... Uhhh shit what? Run an update script to change admin accounts email address, it runs. Change it back. So the read only access was actually full access for some reason on that server. I don't know, I don't have permission to setup the accounts.
Still don't know what those records were that got updated. It was a massive stored procedure that I had never seen before and wanted to test chunks of it. We may never know. To this day that customer often comes up with obscure issues.
Oh, the amount of absolute destruction I've watched techs lay onto client sites...
One time, over a decade ago, daylight savings time changed and Microsoft coded some half-assed patch that created hidden fake timezones that screwed up the UTC offset of files saved during those two weeks.
It was afterhours and I was the on-call. The client, a major law firm and defense contractor that you have definitely heard of, was noticing that some documents had negative billable hours and opened a ticket. Once we determined that it was Microsoft's problem and I opened a ticket for development to take over the Microsoft portion of things, the site admins were trying to figure out how to resolve the problem before lawyers started wondering why they had negative billable hours.
They decided to just err on the side of billing too much rather than too little and just added an hour to every document opened in the two week window. It was easily thousands of documents in the update statement (they wrote and executed it, I just told them the tables and columns).
But the bug only affected documents that were open during the change over... so they generated hundreds of thousands of dollars in billable hours out of thin air.
The site admin sent me a $100 gift card for a local coffee shop in thanks for solving their problem quickly and I kept my mouth shut and closed the ticket as "resolved by site".
One time I made a bulk change (thousands of records) and each and every one sent at email to the record owner. That was fun.
In fairness, that sort of trigger is a horrible half-assed solution that should never have been implemented. No blame at your feet (unless you put it in place).
Oh it was all me start to finish.
Haha, call it karma, then!
BEGIN;
The ol' forgotten 'WHERE', I know it well. Gonna find out a lot about the Backup strategy. First of all if there is one.
I call this the unplanned disaster recovery drill.
isn't it always "the more -- the better"?
Even worse, you did it on Friday afternoon