- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
It's not much different from inter-personal communication. For example, you can severely alter your relationship with a lady if you ask her, WHY ARE YOU SO DAMN FAT?? Just like with this PHP application, a simple query has very far reaching consequences :)
Admin
come on....
Kruft is a municipality in the district of Mayen-Koblenz in Rhineland-Palatinate, western Germany.
Cruft is a jargon word for anything that is left over, redundant and getting in the way.
Admin
Welcome to France, where every public administration website or app is a piece of cr*p that only works 50% of the time, and for which the government spent millions of euros of taxpayer money...
Admin
I was going to add a snarky comment mocking how difficult arithmetic is, but it would only subtract from the conversation, and I didn't want to divide us in these times.
Admin
That's how people from Springfield spell it.
Admin
Ah yes, PHPs serialize method that converts anything into a mess of unreadable text that is supposed to be able to preserve the exact state but doesn't quite work that way in practice since resources ( like database connections, filehandles, curl sockets, or similar ) are noted as being a resource without any details about construction. So if you unserialize it the result is a broken resource which doesn't work and can only ever really cause bugs since to all calling code it is a valid resource so it looks like it should work to most analysis.
Admin
"and then a "request" which just seemed to log the raw SQL run to alter the table. That last one didn't seem important"
EXCUSE ME? That raw sql is not just the most important part of the audit log, it's literally THE ONLY IMPORTANT (and the only necessary) part of the audit log! This is trwtf.
Admin
Ah-ha! I think we just found the original designer of this application!
And let me guess… not only is it the most important part of the Audit log, it’s also “Free” - you set it up so that when you write to the Audit Log, the system automatically captures the previous SQL, and saves it along with your Audit update, right?
That’s why it is critical that developers always put their Audit statements immediately after the data update statement… and of course, everything is single threaded…
Admin
Where's the problem with that? You just need an
ONSELECT
trigger which then executes someUPDATE
statement.Admin
It's interesting that France, being a country that is proud of its language and tries to keep it "clean", allows user-provided identifiers in code to be French mangled with English like "stages.lieuxid = lieux.lieuxid". Couldn't that have been translated properly? Additionally, it looks like they have been shortening USER to USR, but missed the opportunities of "old-people IBM speak", so they could have used USRUPDTE and USRCREAT or even USRUPD and USRCRT... maybe the tax-paying citizens would have been billed a few Euro less?
Admin
I mean, having a SELECT logged as an UPDATE seems bad enough to me... But it's more so the information that's being queried which, reading it now, I realize I failed to make entirely clear... the "lieux" table is a list of locations where the workshops are hosted; it contains the address among other information. The select in question only returned the identifying code (01 - 95) for the region of France that workshop was being held in. To cancel the workshop. Stored in the "stages" table. At least if there had been an ONSELECT trigger somewhere it would have made sense!
Admin
We french love / despise our contradictions. We struggle / have to learn english / preserve french, thanks to / despite our really great / awful translations for computer science / informatique. It gets really fun/weird when a small french team goes international or when developers use english for computer terms (id) and french for business terms (lieu).
But no matter the country or culture, lazy programmers will use lazy translations. Native english speakers just benefit from natural camouflage.
Admin
I suspect that - at least at one point - it was up to the user to paste in what they'd done, and some of them didn't copy the latest query before pasting.