Changeset 18609 for tmp/version-2_5-test/data/module/DB/sqlite.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/sqlite.php
r15532 r18609 20 20 * @author Mika Tuupola <tuupola@appelsiini.net> 21 21 * @author Daniel Convissor <danielc@php.net> 22 * @copyright 1997-200 5The PHP Group22 * @copyright 1997-2007 The PHP Group 23 23 * @license http://www.php.net/license/3_0.txt PHP License 3.0 3.0 24 24 * @version CVS: $Id$ … … 46 46 * @author Mika Tuupola <tuupola@appelsiini.net> 47 47 * @author Daniel Convissor <danielc@php.net> 48 * @copyright 1997-200 5The PHP Group48 * @copyright 1997-2007 The PHP Group 49 49 * @license http://www.php.net/license/3_0.txt PHP License 3.0 3.0 50 * @version Release: @package_version@50 * @version Release: 1.7.14RC1 51 51 * @link http://pear.php.net/package/DB 52 52 */ … … 183 183 * ); 184 184 * 185 * $db = &DB::connect($dsn, $options);185 * $db = DB::connect($dsn, $options); 186 186 * if (PEAR::isError($db)) { 187 187 * die($db->getMessage()); … … 205 205 } 206 206 207 if ($dsn['database']) { 207 if (!$dsn['database']) { 208 return $this->sqliteRaiseError(DB_ERROR_ACCESS_VIOLATION); 209 } 210 211 if ($dsn['database'] !== ':memory:') { 208 212 if (!file_exists($dsn['database'])) { 209 213 if (!touch($dsn['database'])) { … … 230 234 return $this->sqliteRaiseError(DB_ERROR_ACCESS_VIOLATION); 231 235 } 232 } else {233 return $this->sqliteRaiseError(DB_ERROR_ACCESS_VIOLATION);234 236 } 235 237 … … 237 239 238 240 // track_errors must remain on for simpleQuery() 239 ini_set('track_errors', 1);241 @ini_set('track_errors', 1); 240 242 $php_errormsg = ''; 241 243 … … 281 283 function simpleQuery($query) 282 284 { 283 $ismanip = DB::isManip($query);285 $ismanip = $this->_checkManip($query); 284 286 $this->last_query = $query; 285 287 $query = $this->modifyQuery($query); … … 357 359 if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) { 358 360 $arr = array_change_key_case($arr, CASE_LOWER); 361 } 362 363 /* Remove extraneous " characters from the fields in the result. 364 * Fixes bug #11716. */ 365 if (is_array($arr) && count($arr) > 0) { 366 $strippedArr = array(); 367 foreach ($arr as $field => $value) { 368 $strippedArr[trim($field, '"')] = $value; 369 } 370 $arr = $strippedArr; 359 371 } 360 372 } else { … … 728 740 { 729 741 static $error_regexps; 742 743 // PHP 5.2+ prepends the function name to $php_errormsg, so we need 744 // this hack to work around it, per bug #9599. 745 $errormsg = preg_replace('/^sqlite[a-z_]+\(\): /', '', $errormsg); 746 730 747 if (!isset($error_regexps)) { 731 748 $error_regexps = array( … … 739 756 '/may not be NULL/' => DB_ERROR_CONSTRAINT_NOT_NULL, 740 757 '/^no such column:/' => DB_ERROR_NOSUCHFIELD, 758 '/no column named/' => DB_ERROR_NOSUCHFIELD, 741 759 '/column not present in both tables/i' => DB_ERROR_NOSUCHFIELD, 742 760 '/^near ".*": syntax error$/' => DB_ERROR_SYNTAX,
Note: See TracChangeset
for help on using the changeset viewer.