White House blasts 'uninformed Democrats' who blamed Texas floods on Trump
ITV Love Island viewers call for boy to be removed 'ASAP' as Casa Amor antics exposed
Teenage campers describe terrifying moment they were forced to write names on bodies while fearing the worst during Texas floods
Activist who uses a wheelchair accuses doctor of 'pitying' her for having a disability
Trump calls Elon Musk a 'train wreck' as he breaks silence to taunt billionaire's 'ridiculous' plan to break up two-party system
Urgent hunt launched after girl, 15, 'raped' near library: Police release CCTV of man
Now that's what you call a burner phone! Creepy case is covered in fake SKIN that burns just like human flesh when exposed to UV
Trump's DOJ issues final verdict on Jeffrey Epstein in attempt to silence swirling conspiracy theories
Water levels swell in flood-ridden Kerr County as rain pours down after area was warned threat is 'far from over'
Inside Dannii Minogue's difficult relationship with Julian McMahon's socialite mother and how she wouldn't even let her into her home - as she stays silent on ex-husband's death
Scarlett Johansson becomes highest-grossing lead actor EVER after Jurassic Park Rebirth opens with $318M
Airbus okays use of ‘Taxibot’ to tow planes to the runway
Airbus last week revealed it has certified a “Taxibot” to transport its single-aisle planes from stand to runway.…
CodeSOD: All Locked Up
Dan was using a third-party database which provided a PHP API. At one point, Dan was running into an issue where he actually needed locks on the database. Fortunately for him, the vendor documentation told him that there was a method called obtainRowLock.
obtainRowLock($table, $where) - Attempt to lock a row, will escalate and lock the table if row locking is not supported, will escalate and lock the database if table locking is not supported; returns true on success, false on failure
$table - name of table to lock
$where - WHERE clause to define rows, ex: "WHERE id=52". If left empty, function will assume a table lock
That was exactly what Dan needed, so he called it. It returned false, implying a failure. He changed the parameters. He discarded his where clause. He tried all sorts of things, and it always returned false. So he dug into the source code, to see how it actually worked.
function obtainRowLock($table, $where) { return false; }Is it truly a failure if you don't even try?