Changeset 702 for trunk/forum/includes/db/oracle.php
- Timestamp:
- Mar 31, 2010, 6:32:40 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/forum/includes/db/oracle.php
r400 r702 3 3 * 4 4 * @package dbal 5 * @version $Id : oracle.php 9175 2008-12-05 11:18:59Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 137 137 function _rewrite_where($where_clause) 138 138 { 139 preg_match_all('/\s*(AND|OR)?\s*([\w_. ]++)\s*(?:(=|<[=>]?|>=?)\s*((?>\'(?>[^\']++|\'\')*+\'|[\d-.]+))|((NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|[\d-.]+,? ?)*+\)))/', $where_clause, $result, PREG_SET_ORDER);139 preg_match_all('/\s*(AND|OR)?\s*([\w_.()]++)\s*(?:(=|<[=>]?|>=?|LIKE)\s*((?>\'(?>[^\']++|\'\')*+\'|[\d-.()]+))|((NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|[\d-.]+,? ?)*+\)))/', $where_clause, $result, PREG_SET_ORDER); 140 140 $out = ''; 141 141 foreach ($result as $val) … … 256 256 if (strlen($query) > 4000) 257 257 { 258 if (preg_match('/^(INSERT INTO[^(]++)\\(([^()]+)\\) VALUES[^(]++\\((.*?)\\)$/s ', $query, $regs))258 if (preg_match('/^(INSERT INTO[^(]++)\\(([^()]+)\\) VALUES[^(]++\\((.*?)\\)$/sU', $query, $regs)) 259 259 { 260 260 if (strlen($regs[3]) > 4000) 261 261 { 262 262 $cols = explode(', ', $regs[2]); 263 263 264 preg_match_all('/\'(?:[^\']++|\'\')*+\'|[\d-.]+/', $regs[3], $vals, PREG_PATTERN_ORDER); 265 266 if (sizeof($cols) !== sizeof($vals)) 267 { 268 // Try to replace some common data we know is from our restore script or from other sources 269 $regs[3] = str_replace("'||chr(47)||'", '/', $regs[3]); 270 $_vals = explode(', ', $regs[3]); 271 272 $vals = array(); 273 $is_in_val = false; 274 $i = 0; 275 $string = ''; 276 277 foreach ($_vals as $value) 278 { 279 if (strpos($value, "'") === false && !$is_in_val) 280 { 281 $vals[$i++] = $value; 282 continue; 283 } 284 285 if (substr($value, -1) === "'") 286 { 287 $vals[$i] = $string . (($is_in_val) ? ', ' : '') . $value; 288 $string = ''; 289 $is_in_val = false; 290 291 if ($vals[$i][0] !== "'") 292 { 293 $vals[$i] = "''" . $vals[$i]; 294 } 295 $i++; 296 continue; 297 } 298 else 299 { 300 $string .= (($is_in_val) ? ', ' : '') . $value; 301 $is_in_val = true; 302 } 303 } 304 305 if ($string) 306 { 307 // New value if cols != value 308 $vals[(sizeof($cols) !== sizeof($vals)) ? $i : $i - 1] .= $string; 309 } 310 311 $vals = array(0 => $vals); 312 } 264 313 265 314 $inserts = $vals[0]; … … 569 618 } 570 619 620 function _sql_bit_and($column_name, $bit, $compare = '') 621 { 622 return 'BITAND(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : ''); 623 } 624 625 function _sql_bit_or($column_name, $bit, $compare = '') 626 { 627 return 'BITOR(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : ''); 628 } 629 571 630 /** 572 631 * return sql error array
Note:
See TracChangeset
for help on using the changeset viewer.