39
C0D4
6y

What a fucking day!
So some many years ago, we placed a small and useful piece of code into a MySQL Query, which prefixes the order ids with a string and returns the value.

Basically

SELECT
CONCAT(“ORDER_PREFIX”, LPAD(order.id,5,’0’) AS order_reference

Now many years ago when this was a simple solution to a system that wasn’t expected to be running today, all went well, except today.... today that fucking line exceeded 5 digits
😓😍😓

I don’t know if I should be ashamed, or happy right now, a totally unfuture proof query that just rolled that little too far, or the fact that I’ve watch 100k orders role through this system.

Now for the clean up crew to do their job.... oh 🙁 that’s me too.

Now this doesn’t affect the order ids... so that’s something but external systems rely on that guy 😭

Comments
  • 1
    A great anecdote for the ’allow me to explain to you why’-toolbox
  • 6
    A bit like Y2K, huh?
    "Nah, 2 digits for the year is enough!" 😁
  • 2
    @Yamakuzure Y218 Bug😂
  • 3
    We have a senior software engineer apparently lived the golden age of tape programming delivered a major piece last year that he proudly blended order flags within a single byte, all bit operator and shits.
    Now the clean up crew had to figure out how to implement extra flags.... hundreds of thousands of orders going through system like yours....
  • 1
    @cyanly Using bit operations for flags is highly convenient if done right. Using only a single byte, limiting the number of flags to 8, is just plain stupid.

    I'd have checked how many flags there are, multiplied by three, and then used the number of required bytes plus mod 2.
Add Comment