Ignore:
Timestamp:
2010/03/11 10:35:11 (14 years ago)
Author:
kajiwara
Message:

正式版にナイトリービルド版をマージしてみるテスト

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tmp/version-2_5-test/data/module/DB/sqlite.php

    r15532 r18609  
    2020 * @author     Mika Tuupola <tuupola@appelsiini.net> 
    2121 * @author     Daniel Convissor <danielc@php.net> 
    22  * @copyright  1997-2005 The PHP Group 
     22 * @copyright  1997-2007 The PHP Group 
    2323 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0 3.0 
    2424 * @version    CVS: $Id$ 
     
    4646 * @author     Mika Tuupola <tuupola@appelsiini.net> 
    4747 * @author     Daniel Convissor <danielc@php.net> 
    48  * @copyright  1997-2005 The PHP Group 
     48 * @copyright  1997-2007 The PHP Group 
    4949 * @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 
    5151 * @link       http://pear.php.net/package/DB 
    5252 */ 
     
    183183     * ); 
    184184     *  
    185      * $db =& DB::connect($dsn, $options); 
     185     * $db = DB::connect($dsn, $options); 
    186186     * if (PEAR::isError($db)) { 
    187187     *     die($db->getMessage()); 
     
    205205        } 
    206206 
    207         if ($dsn['database']) { 
     207        if (!$dsn['database']) { 
     208            return $this->sqliteRaiseError(DB_ERROR_ACCESS_VIOLATION); 
     209        } 
     210 
     211        if ($dsn['database'] !== ':memory:') { 
    208212            if (!file_exists($dsn['database'])) { 
    209213                if (!touch($dsn['database'])) { 
     
    230234                return $this->sqliteRaiseError(DB_ERROR_ACCESS_VIOLATION); 
    231235            } 
    232         } else { 
    233             return $this->sqliteRaiseError(DB_ERROR_ACCESS_VIOLATION); 
    234236        } 
    235237 
     
    237239 
    238240        // track_errors must remain on for simpleQuery() 
    239         ini_set('track_errors', 1); 
     241        @ini_set('track_errors', 1); 
    240242        $php_errormsg = ''; 
    241243 
     
    281283    function simpleQuery($query) 
    282284    { 
    283         $ismanip = DB::isManip($query); 
     285        $ismanip = $this->_checkManip($query); 
    284286        $this->last_query = $query; 
    285287        $query = $this->modifyQuery($query); 
     
    357359            if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) { 
    358360                $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; 
    359371            } 
    360372        } else { 
     
    728740    { 
    729741        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         
    730747        if (!isset($error_regexps)) { 
    731748            $error_regexps = array( 
     
    739756                '/may not be NULL/' => DB_ERROR_CONSTRAINT_NOT_NULL, 
    740757                '/^no such column:/' => DB_ERROR_NOSUCHFIELD, 
     758                '/no column named/' => DB_ERROR_NOSUCHFIELD, 
    741759                '/column not present in both tables/i' => DB_ERROR_NOSUCHFIELD, 
    742760                '/^near ".*": syntax error$/' => DB_ERROR_SYNTAX, 
Note: See TracChangeset for help on using the changeset viewer.