- Patch #555446 by deekayen: remove backward-compatibility hacks from arg processing.

merge-requests/26/head
Dries Buytaert 2009-08-21 16:36:35 +00:00
parent b06e8d9caa
commit e4758cb4f5
1 changed files with 0 additions and 19 deletions

View File

@ -2528,25 +2528,6 @@ function _db_query_process_args($query, $args, $options) {
$args = array_values($args); // The old system allowed named arrays, but PDO doesn't if you use ?.
}
// A large number of queries pass FALSE or empty-string for
// int/float fields because the previous version of db_query()
// casted them to int/float, resulting in 0. MySQL PDO happily
// accepts these values as zero but PostgreSQL PDO does not, and I
// do not feel like tracking down and fixing every such query at
// this time.
if (preg_match_all('/%([dsfb])/', $old_query, $m) > 0) {
foreach ($m[1] as $idx => $char) {
switch ($char) {
case 'd':
$args[$idx] = (int) $args[$idx];
break;
case 'f':
$args[$idx] = (float) $args[$idx];
break;
}
}
}
return array($query, $args, $options);
}