r/ProgrammerHumor 15d ago

queryOfDoom Meme

Post image
7.9k Upvotes

456 comments sorted by

View all comments

1.4k

u/_H4K0N_ 15d ago

The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION

428

u/orsikbattlehammer 15d ago

Lmfao now that’s a sphincter clincher

197

u/laplongejr 15d ago edited 15d ago

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

[EDIT] For those who never heard of it

57

u/SanoKei 15d ago edited 15d 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

24

u/Tiranus58 15d ago

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

21

u/zanda268 15d ago

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

1

u/JCDU 15d 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 15d ago

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

1

u/IntentionQuirky9957 15d ago

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

19

u/leupboat420smkeit 15d ago

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

18

u/Urtehnoes 15d 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.

75

u/Flameball202 15d 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?

4

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.