neosheo,
@neosheo@discuss.tchncs.de avatar

I’m dying lol

TangledHyphae, (edited )

Looks like little bobby tables is at it again. (edit: for reference: xkcd.com/327/)

Edit #2: For lemmy app users: xkcd.com/327

And thanks to @Gestrid for the correction.

Gestrid,

My Lemmy app doesn’t like that parenthese. Fixed link in case anyone else is affected: xkcd.com/327/

TangledHyphae,

Sorry about that, I will update future links to not use parenthesis.

Gestrid,

No problem. And all you need to do, really, is put a space between the link and the parenthese.

erogenouswarzone,
@erogenouswarzone@lemmy.ml avatar

You can also do this by forgetting a WHERE clause. I know this because I ruined a production database in my early years.

Always write your where before your insert, kids.

themusicman,

Always start every command with EXPLAIN and don’t remove it until you’ve run it

bitflag,

I learned the same lesson the same way 😞

kamen,

This is now the correct database.

Rosco,

That’s what backups are for.

figaro,

Checking the backups… Ah yes, the backup done in August 2017.

Hello boss, I broke the company. I’ll see myself out

Rosco,

You should take it upon yourself to make regular backups in case you fuck up really bad. I had an intern that deleted everything on its fifth day, luckily l was automatically making backups two times a day, so it was fine.

figaro,

Yep I do that on a local project basis before I make any updates. Saved me a couple times from my own mistakes 😅

TheSlad,

Why would an intern be allowed anywhere near prod DB? Do you not have lower environments?

Rosco,

Company was a shitshow, new features or changes were expected immediately, so we got used to work directly on prod. I told him to test anything on a dummy DB and show me before we submit it, but he got around it when I wasn’t looking. The security tools were garbage, I wasn’t allowed to change permissions.

TheSlad,

Sounds fun! As long as you have no stake in the company lol

Rosco,

I left to pursue my studies, the intern took my place and was put in charge of everything, I don’t know how he’s doing now and I don’t really care.

erogenouswarzone,
@erogenouswarzone@lemmy.ml avatar

If you don’t have apt backups, that is a failure of the process, not yours.

_dev_null,
@_dev_null@lemmy.zxcvn.xyz avatar

Plot twist, they were also the one responsible for developing the backup process.

Naomikho,

I actually screwed up twice on dev environment. Luckily the second case was salvageable without using data from an old backup(I wasn’t given one that time) and I managed to sweep it up fast.

I started testing my queries super carefully after the first incident, but I was too tired once that I forgot to restrict the update scope for testing and screwed up again.

threelonmusketeers, (edited )

https://youtu.be/X6NJkWbM1xk :)

Whenever SQL databases come up, I always think of this video from one of the greatest ‘content’ creators in history.

Yearly1845,

deleted_by_author

  • Loading...
  • felbane,

    Be Safe! Be a BUSCer!

    Agent641,

    The four horsemen of the datapocalypse

    mrbaby,

    And you can save a bunch of time by inlining all this into one query

    342345,

    Why update before select? Shouldn’t it be the other way around? (I’m clueless. )

    juja,

    The select after the update is to check if the update went through properly. You can have more selects before the update if you wanted to.

    342345,

    Ah. It makes sense now. Thanks.

    pomodoro_longbreak,
    @pomodoro_longbreak@sh.itjust.works avatar

    Ah reminds me of the time (back in the LAMP days) when I tried to apply this complicated equation that sales had come up with to our inventory database. This was one of those “just have the junior run it at midnight” type of shops. Anyway, I made a mistake and ended up exactly halving all inventory prices on production. See OP’s picture for my face.

    In retrospect, I’m thankful for that memory.

    Agent641,

    Ive had one of those moments. Where you fuck up so bad that your emotions wrap all the way around from panic, through fear, confusion, rage, dread and back to neutral, and you go 'Hmm…"

    pomodoro_longbreak,
    @pomodoro_longbreak@sh.itjust.works avatar

    Yeah that’s a good way to put it. It’s like so close to the thing you were dreading, that it’s a sort of sick relief when it actually happens.

    It’s like…

    “just like the simulations” meme

    palordrolap,

    8388409 = 2^23 - 199

    I may have noticed this on a certain other aggregator site once upon a time, but I'm still none the wiser as to why.

    199 rows kind of makes sense for whatever a legitimate query might have been, but if you're going to make up a number, why 2^23? Why subtract? Am I metaphorically barking up the wrong tree?

    Is this merely a mistyping of 8388608 and it was supposed to be ±1 row? Still the wrong (B-)tree?

    WHY DO I CARE

    driving_crooner,
    @driving_crooner@lemmy.eco.br avatar

    Are you Ramanujam reborn or a nerd who put every number they found on wolfram alpha?

    palordrolap,

    In a place for programmer humour, you've got to expect there's at least one person who knows their powers of two. (Though I am missing a few these days).

    As for considering me to be Ramanujan reborn, if there's any of Srinivasa in here, he's not been given a full deck to work with this time around and that's not very karmic of whichever deity or deities sent him back.

    Fuck_u_spez_,

    I know up to like 2^16 or maybe 2^17 while sufficiently caffeinated. Memorizing up to, or beyond, 2^23 is nerd award worthy.

    palordrolap,

    For me it's: 2^1 to 2^16 (I remember the 8-bit era), a hazy gap and then 2^24 (the marketing for 24 bit colour in the 90s had 16777216 plastered all over it). Then it's being uncomfortably lost up to 2^31 and 2^32, which I usually recognise when I see them (hello INT_MAX and UINT_MAX), but I don't know their digits well enough to repeat. 2^64 is similar. All others are incredibly vague or unknown.

    2^23 as half of 2^24 and having a lot of 8s in it seems to have put it into the "recognisable" category for me, even if it's in that hazy gap.

    So I grabbed a calculator to confirm.

    driving_crooner,
    @driving_crooner@lemmy.eco.br avatar

    I know that 2^20 is something more that a million because is the maximum number of rows excel can handle.

    LastYearsPumpkin,

    Ramanujan reborn - the main protagonist from the Wheel of Maths books.

    fushuan,

    Rollback.

    Blackmist,

    I don’t understand environments that don’t wrap things in transactions by default.

    Especially since an update or delete without a where clause is considered valid.

    finestnothing,

    I’m a data engineer that occasionally has to work in sql server, I use dbeaver and have our prod servers default to auto-wrap in transactions and I have to push a button and confirm I know it’s prod before it commits changes there, it’s great and has saved me when I accidentally had a script switch servers. For the sandbox server I don’t have that on because the changes there don’t matter except for testing, and we can always remake the thing from scratch in a few hours. I haven’t had an oppsie yet and I hope to keep that streak

    Ultraviolet,

    SQL Server technically does behind the scenes, but automatically commits, which kind of defeats the purpose.

    threelonmusketeers,

    No transaction to rollback

    nuke,

    Just hit Ctrl+Z to Undo

    originalucifer,
    @originalucifer@moist.catsweat.com avatar

    wasnt halloween last week. stop scarin me

    magic_lobster_party,

    Well at least we got a backup, right?

    Right???

    rostby,

    Right GitHub???

    dontcarebear,

    I felt a slight jolt of adrenaline on that second “right???” After living through something similar…

    datelmd5sum,

    ah the cold sweat and clenching of the anus

    DudeDudenson,

    Backup? What is this backup you speak of?

    Alexstarfire,

    Back up? No, we only go forward in this company

    _dev_null,
    @_dev_null@lemmy.zxcvn.xyz avatar

    “That’s why the windshield is bigger than the rear view mirror, we should be vigilant in remaining forward looking.”

    Said by an exec in my chain of command when he caused a huge cascading fuck up in the organization and there was no postmortem allowed.

    andrew,
    @andrew@lemmy.stuart.fun avatar

    It last ran a week ago and we technically haven’t tested it. Just our hot replicas which also just deleted all that data.

    TheGreenGolem,

    And of course by now every downstream system replicated AND CACHED that data.

    Amends1782,

    Holy shit the truth with replication deleting the data you needed too true lmao

    Tenthrow,
    @Tenthrow@lemmy.world avatar

    This is giving me PTSD

  • All
  • Subscribed
  • Moderated
  • Favorites
  • programmerhumor@lemmy.ml
  • mdbf
  • DreamBathrooms
  • cisconetworking
  • magazineikmin
  • InstantRegret
  • everett
  • thenastyranch
  • Youngstown
  • rosin
  • slotface
  • khanakhh
  • Durango
  • kavyap
  • ethstaker
  • megavids
  • anitta
  • modclub
  • osvaldo12
  • normalnudes
  • ngwrru68w68
  • GTA5RPClips
  • tacticalgear
  • provamag3
  • tester
  • Leos
  • cubers
  • JUstTest
  • lostlight
  • All magazines