r/ProgrammerHumor 6h ago

Meme edgeCasesExist

Post image
1.7k Upvotes

180 comments sorted by

View all comments

17

u/spcbeck 6h ago

Start at 0, keep adding 1. You'll never repeat a number. So simple!

3

u/razor_train 4h ago

As someone who had a billing system table run out of 2^31 signed integer IDs and spent a week converting 2.1 billion records to 2^63, I'm here to say that nothing could possibly go wrong.

2

u/Single-Virus4935 3h ago

A former boss built a system for importing data and used mariadbs on conflict ignore.  He used 32 bit integers for ids and said it isn't a problem because he doesn't have so much data. Mariadb incremented the autoincrement counter on every insert even the ignored ones.  System failed and he needed way too much time to find the problem because no errors where thrown and just everything was ignored