Changeset 18609 for tmp/version-2_5-test/data/module/DB/mysqli.php
- Timestamp:
- 2010/03/11 10:35:11 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tmp/version-2_5-test/data/module/DB/mysqli.php
r15532 r18609 18 18 * @package DB 19 19 * @author Daniel Convissor <danielc@php.net> 20 * @copyright 1997-200 5The PHP Group20 * @copyright 1997-2007 The PHP Group 21 21 * @license http://www.php.net/license/3_0.txt PHP License 3.0 22 22 * @version CVS: $Id$ … … 42 42 * @package DB 43 43 * @author Daniel Convissor <danielc@php.net> 44 * @copyright 1997-200 5The PHP Group44 * @copyright 1997-2007 The PHP Group 45 45 * @license http://www.php.net/license/3_0.txt PHP License 3.0 46 * @version Release: @package_version@46 * @version Release: 1.7.14RC1 47 47 * @link http://pear.php.net/package/DB 48 48 * @since Class functional since Release 1.6.3 … … 115 115 1216 => DB_ERROR_CONSTRAINT, 116 116 1217 => DB_ERROR_CONSTRAINT, 117 1356 => DB_ERROR_DIVZERO, 118 1451 => DB_ERROR_CONSTRAINT, 119 1452 => DB_ERROR_CONSTRAINT, 117 120 ); 118 121 … … 211 214 MYSQLI_TYPE_STRING => 'char', 212 215 MYSQLI_TYPE_GEOMETRY => 'geometry', 216 /* These constants are conditionally compiled in ext/mysqli, so we'll 217 * define them by number rather than constant. */ 218 16 => 'bit', 219 246 => 'decimal', 213 220 ); 214 221 … … 265 272 * ); 266 273 * 267 * $db = &DB::connect($dsn, $options);274 * $db = DB::connect($dsn, $options); 268 275 * if (PEAR::isError($db)) { 269 276 * die($db->getMessage()); … … 288 295 289 296 $ini = ini_get('track_errors'); 290 ini_set('track_errors', 1);297 @ini_set('track_errors', 1); 291 298 $php_errormsg = ''; 292 299 293 if ( $this->getOption('ssl') === true) {300 if (((int) $this->getOption('ssl')) === 1) { 294 301 $init = mysqli_init(); 295 302 mysqli_ssl_set( … … 323 330 } 324 331 325 ini_set('track_errors', $ini);332 @ini_set('track_errors', $ini); 326 333 327 334 if (!$this->connection) { … … 373 380 function simpleQuery($query) 374 381 { 375 $ismanip = DB::isManip($query);382 $ismanip = $this->_checkManip($query); 376 383 $this->last_query = $query; 377 384 $query = $this->modifyQuery($query); … … 491 498 function freeResult($result) 492 499 { 493 return @mysqli_free_result($result);500 return is_resource($result) ? mysqli_free_result($result) : false; 494 501 } 495 502 … … 627 634 function affectedRows() 628 635 { 629 if ( DB::isManip($this->last_query)) {636 if ($this->_last_query_manip) { 630 637 return @mysqli_affected_rows($this->connection); 631 638 } else { … … 824 831 /** 825 832 * Quotes a string so it can be safely used as a table or column name 826 * 827 * MySQL can't handle the backtick character (<kbd>`</kbd>) in 828 * table or column names. 833 * (WARNING: using names that require this is a REALLY BAD IDEA) 834 * 835 * WARNING: Older versions of MySQL can't handle the backtick 836 * character (<kbd>`</kbd>) in table or column names. 829 837 * 830 838 * @param string $str identifier name to be quoted … … 837 845 function quoteIdentifier($str) 838 846 { 839 return '`' . $str. '`';847 return '`' . str_replace('`', '``', $str) . '`'; 840 848 } 841 849 … … 879 887 function modifyLimitQuery($query, $from, $count, $params = array()) 880 888 { 881 if (DB::isManip($query) ) {889 if (DB::isManip($query) || $this->_next_query_manip) { 882 890 return $query . " LIMIT $count"; 883 891 } else { … … 955 963 { 956 964 if (is_string($result)) { 965 // Fix for bug #11580. 966 if ($this->_db) { 967 if (!@mysqli_select_db($this->connection, $this->_db)) { 968 return $this->mysqliRaiseError(DB_ERROR_NODBSELECTED); 969 } 970 } 971 957 972 /* 958 973 * Probably received a table name. … … 1016 1031 ? $this->mysqli_types[$tmp->type] 1017 1032 : 'unknown', 1018 'len' => $tmp->max_length, 1033 // http://bugs.php.net/?id=36579 1034 'len' => $tmp->length, 1019 1035 'flags' => $flags, 1020 1036 );
Note: See TracChangeset
for help on using the changeset viewer.