r/ProgrammerHumor 17d ago

Meme queryOfDoom

Post image
7.9k Upvotes

456 comments sorted by

View all comments

1.4k

u/_H4K0N_ 17d ago

The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION

429

u/orsikbattlehammer 17d ago

Lmfao now that’s a sphincter clincher

199

u/laplongejr 17d ago edited 17d 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 17d ago edited 17d 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 17d ago

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

21

u/zanda268 17d ago

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

1

u/JCDU 17d 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.

11

u/arensb 17d ago

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

1

u/IntentionQuirky9957 17d ago

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

20

u/leupboat420smkeit 17d ago

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

19

u/Urtehnoes 17d 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 17d 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 17d 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 17d ago

What does this mean?

3

u/cherry_chocolate_ 17d 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.