|
Couple of weeks ago, but, as they used to say: "saved by the skin of my teeth"
Was working on code that produces SQL par rowsets by interpreting SQL table schema. Anyway, I was working on a version of the table that was named the same, but with an _test. I wanted to clear it of data, except the first record. DELETE FROM and then the moment of horror. My _test table wasn't empty. The production table was. Literally hundreds of reports and dozens of applications are totally dependent upon this table.
But, as it would happen, somehow a miracle was pre-planned. Literally the night before, my boss created an archive table. All the deleted records were moved to it. The several minutes of horror were soothed with a little bit of delete, rename, and then recreating that archive . . . just in case I want to drive myself to drink again, some day.* Amazingly, quick enough (although it seemed to take forever) that no one even called IT or put in a support request.
* Yes, there are backups, but until that could be brought to bare, a major panic was imminent, much yelling, screaming, gnashing of teeth, and then the bad stuff would start.
** This is only the second time in about 15 years I popped a production table. It was all much less essential that first time.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
W∴ Balboos wrote: * This is only the second time in about 15 years I popped a production table. It was all much less essential that first time. With some equipment[^] you get no second chance.
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|
Many many years ago we had a word for that . . . . . . . . . . ooops!
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
We had something like that hanging right above those consoles:
A soldier sitting at a radar console and you can see a missile launching outside the window. He holds a telephone and asks: "How do you say 'sorry, my fault' in Russian?"
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|
I wrote an SQL-Generator for that, so every DB Model has it and the Generator creates the statements. This saves my a55
Rules for the FOSW ![ ^]
if(this.signature != "")
{
MessageBox.Show("This is my signature: " + Environment.NewLine + signature);
}
else
{
MessageBox.Show("404-Signature not found");
}
|
|
|
|
|
Unless selecting, always start your SQL script with "START TRANSACTION".
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: always start your SQL script with "START TRANSACTION". That's like jumping out of a plane with a parachute on, just in case you need it. Real men don't need it.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
My rule of thumb is to create the select statement and run it before changing it to delete or update. That, however, only works if (1) I count on my thumbes, and (2) type the write table name. Everything could seem OK. (even with your Transaction wrap) until just a little bit later.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
W∴ Balboos wrote: Everything could seem OK. It is not relevant how things seem.
You validate before you commit. You cannot assume, one must validate. Seriously, paranoia pays.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Yeah, I usually do this.
Of course that doesn't work when you have some text selected (which I had) for deletion, but hit F5 instead
Luckily we had a backup (well, not so lucky as we make those daily) and I was able to undo the harm without anyone even reporting the issue
|
|
|
|
|
Silly human.
AI would've never made this mistake.
You are replaceable. The robots are coming! The robots are coming!
|
|
|
|
|
AI's have the ability to make millions of mistakes per second.
I won't even code that many instructions in my life
|
|
|
|
|
Easy mistake, since the F5 key is right next to the Del key ... oh wait.
Been there and done that, though. The feeling when you just realize you've just deleted the whole company's timecard entries? Like jumping out of an airplane. Thank goodness for frequent (15-minute intervals) log backups.
If you think 'goto' is evil, try writing an Assembly program without JMP.
|
|
|
|
|
Trapped | CommitStrip[^]
Vi was as much fun - no universal CTRL+F4 for us early adopters!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Been there, stuck in input mode, and it took some time to escape.
|
|
|
|
|
:w!
Damn, I meant :q!
sccs get program.c
Tap-tap-tappety-tap
Damn! Wrong again!
:w!
redo from start
98.4% of statistics are made up on the spot.
|
|
|
|
|
PeejayAdams wrote: 98.4% of statistics are made up on the spot.
47.7% of statistics are wrong.
|
|
|
|
|
vim is still my most used editor.
|
|
|
|
|
Please! Why did you remind me on that !
Rules for the FOSW ![ ^]
if(this.signature != "")
{
MessageBox.Show("This is my signature: " + Environment.NewLine + signature);
}
else
{
MessageBox.Show("404-Signature not found");
}
|
|
|
|
|
Because the Youth Of Today need to be reminded just how good they have it!
That and to remind everybody of what happens when you let developers design user interfaces...
(Though to be fair, most of Unix was much the same in those days, and DOS wasn't far behind: remember EDLIN?)
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I remember vi and edlin too.
There was one in RSTS but I forget it's name.
I'm glad they're largely gone.
|
|
|
|
|
Line mode EDT was what we were taught on RSTS, but them what knew used TECO in screen mode.
On OpenVMS I use EDT in screen mode.
|
|
|
|
|
I remember using TECO and EDT. TECO primarily under RT-11 and RSX-11 on PDP-11's of one sort or another, and EDT on VAXen.
Software Zen: delete this;
|
|
|
|
|
I had to program with VI and VIM so i know the pain.
Rules for the FOSW ![ ^]
if(this.signature != "")
{
MessageBox.Show("This is my signature: " + Environment.NewLine + signature);
}
else
{
MessageBox.Show("404-Signature not found");
}
|
|
|
|
|
Hard reboot. Psh. I just burn my house down whenever I get stuck in VIM.
|
|
|
|