3 ms·
Anyone here ever checked in a bug that infected large numbers of users?
by jermaustin1 10y ago
Anyone here ever checked in a bug that infected large numbers of users?
- dotancohen 10y agoIn fact I have. I hit Enter before completing the WHERE clause, and because I'm OCD I close parentheses and quotes before filling them in, and put the ; at the end of SQL statements before filling in the clauses. Well, I _did_ a long time ago. Now I treat the semicolon key like I treat the Enter key. Lesson learned.
- jermaustin1 10y agoI am also much more cautious now. When I write my UPDATEs I leave out the SET until after writing WHERE clause. And for DELETEs I actually write it as a SELECT first, then once all the rows I expect are accounted for, switch SELECT to DELETE. Since I use MSSQL, the semicolon isn't required, only a new line, so I actually start every .sql file I write with 3 new lines and an open multi-line comment this way if I accidentally hit Ctrl-E without selecting the EXACT statement I want, it throws an error. All of these things to combat my stupidity.
- junto 10y agoI once checked in a database migration that was run automatically as part of the continuous deployment process we have for a client. It ran through testing and UAT without issue. When the deployment ran for production everything died. The database change was the addition of a new column to a database table which was set as NOT NULL with a default value. The production table had over 25 million rows. I learnt a valuable lesson the hard way. Never add columns large table with NOT NULL and a default value with MsSQL server. Leave it nullable.