git-svn-id: file:///svn/phpbb/trunk@6961 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
David M 2007-02-03 04:26:10 +00:00
parent 22aa2b7c52
commit 9bf3bd0cbc

View file

@ -113,7 +113,7 @@ class dbal_oracle extends dbal
$array = array(); $array = array();
// We overcome Oracle's 4000 char limit by binding vars // We overcome Oracle's 4000 char limit by binding vars
if (preg_match('/^(INSERT INTO[^(]+)\\(([^()]+)\\) VALUES[^(]+\\((.*?)\\)$/', $query, $regs)) if (preg_match('/^(INSERT INTO[^(]+)\\(([^()]+)\\) VALUES[^(]+\\((.*?)\\)$/s', $query, $regs))
{ {
if (strlen($regs[3]) > 4000) if (strlen($regs[3]) > 4000)
{ {
@ -143,26 +143,21 @@ class dbal_oracle extends dbal
preg_match_all('/(\\w++) = (\'(?:[^\']++|\'\')*+\'|\\d++)/', $data[0][2], $temp, PREG_SET_ORDER); preg_match_all('/(\\w++) = (\'(?:[^\']++|\'\')*+\'|\\d++)/', $data[0][2], $temp, PREG_SET_ORDER);
unset($data); unset($data);
$cols = array(); $art = array();
foreach ($temp as $value) foreach ($temp as $value)
{ {
if (!empty($value[2]) && $value[2][0] === "'" && strlen($value[2]) > 4002) // check to see if this thing is greater than the max + 'x2 + a space if (!empty($value[2]) && $value[2][0] === "'" && strlen($value[2]) > 4002) // check to see if this thing is greater than the max + 'x2
{ {
$cols[$value[1]] = ':' . strtoupper($value[1]); $art[] = $value[1] . '=:' . strtoupper($value[1]);
$array[$cols[$value[1]]] = str_replace("''", "'", substr($value[2], 1, -1)); $array[$cols[$value[1]]] = str_replace("''", "'", substr($value[2], 1, -1));
} }
else else
{ {
$cols[$value[1]] = $value[2]; $art[] = $value[1] . '=' . $value[2];
} }
} }
$art = array(); $query = $update . implode(', ', $art) . ' ' . $where;
foreach ($cols as $col => $val)
{
$art[] = $col . '=' . $val;
}
$query = $update . implode(', ', $art) . ' ' . $where;
} }
} }