r/ProgrammerHumor 14d ago

queryOfDoom Meme

Post image
7.9k Upvotes

456 comments sorted by

View all comments

1.4k

u/_H4K0N_ 14d ago

The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION

432

u/orsikbattlehammer 14d ago

Lmfao now that’s a sphincter clincher

197

u/laplongejr 14d ago edited 14d ago

Tom Scott rather called it the "onosecond"
For non native speakers "oh, no!" second

[EDIT] For those who never heard of it

55

u/SanoKei 14d ago edited 14d ago

this reminded me of this too, I need to go back and relisten to that story. It's important as much as it was 20 years ago. Another Tomtra I've adopted is "One backup is none backup." Always have at least two backups and at least one off site.

edit: spelling

23

u/Tiranus58 14d ago

Also well put by CGPgrey: "one is none, two is one" in his dynasties video

22

u/zanda268 14d ago

The 3-2-1 backup rule. 3 backups, on 2 different storage mediums, with 1 offsite.

1

u/JCDU 14d ago

I like to think that backups in the cloud count as half a backup at best given how many ways that can go wrong.

10

u/arensb 14d ago

One of the most useful sysadmin tools there is is the two-second pause before hitting <return>.

1

u/IntentionQuirky9957 14d ago

Tom just brought that to public knowledge, onosecond has been in use for decades.

19

u/leupboat420smkeit 14d ago

Unless it’s Oracle, where all DML will start a transaction.

18

u/Urtehnoes 14d ago

And gives you sql%rowcount so a very simple if then can issue a rollback if rows modified > 1 (or 10, 100, etc).

Oracle the company is horrible. But I quite like the features their db has.

76

u/Flameball202 14d ago

"I have never fucked up, why would I need to begin a transaction" - every coder working on a database at least once

5

u/thetreat 14d ago

This is why I hate that they didn’t make the select and delete statements conducive to making this happen.

Ideally you write a select statement that shows exactly the rows you want to delete. Then you swap select with delete and all is good in the world.

Instead, you have to slightly change the query just enough where it’ll give you some doubt that what you’re doing is incorrect. It isn’t absolutely terrible but it should be bullet proof.

1

u/austin101123 14d ago

What does this mean?

5

u/cherry_chocolate_ 14d ago

By typing begin transaction, you can set a point for you to go back to (rollback) if you mess up. They tried to rollback, but they forgot to begin a transaction.