From 9f35269358f9fa4e174de61e187ebc128ba38708 Mon Sep 17 00:00:00 2001
From: yllar <yllar.pajus@gmail.com>
Date: Mon, 09 Feb 2009 07:47:50 -0500
Subject: [PATCH] asturian translation

---
 program/lib/MDB2/Driver/sqlite.php |   35 +++++++++++++++++++++++++++++++----
 1 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/program/lib/MDB2/Driver/sqlite.php b/program/lib/MDB2/Driver/sqlite.php
index d612553..c8c485d 100644
--- a/program/lib/MDB2/Driver/sqlite.php
+++ b/program/lib/MDB2/Driver/sqlite.php
@@ -3,7 +3,7 @@
 // +----------------------------------------------------------------------+
 // | PHP versions 4 and 5                                                 |
 // +----------------------------------------------------------------------+
-// | Copyright (c) 1998-2007 Manuel Lemos, Tomas V.V.Cox,                 |
+// | Copyright (c) 1998-2008 Manuel Lemos, Tomas V.V.Cox,                 |
 // | Stig. S. Bakken, Lukas Smith                                         |
 // | All rights reserved.                                                 |
 // +----------------------------------------------------------------------+
@@ -43,7 +43,7 @@
 // | Author: Lukas Smith <smith@pooteeweet.org>                           |
 // +----------------------------------------------------------------------+
 //
-// $Id: sqlite.php,v 1.152 2007/11/27 07:44:41 quipo Exp $
+// $Id: sqlite.php,v 1.158 2008/03/08 14:18:39 quipo Exp $
 //
 
 /**
@@ -89,6 +89,7 @@
         $this->supported['transactions'] = true;
         $this->supported['savepoints'] = false;
         $this->supported['sub_selects'] = true;
+        $this->supported['triggers'] = true;
         $this->supported['auto_increment'] = true;
         $this->supported['primary_key'] = false; // requires alter table implementation
         $this->supported['result_introspection'] = false; // not implemented
@@ -97,11 +98,14 @@
         $this->supported['pattern_escaping'] = false;
         $this->supported['new_link'] = false;
 
+        $this->options['DBA_username'] = false;
+        $this->options['DBA_password'] = false;
         $this->options['base_transaction_name'] = '___php_MDB2_sqlite_auto_commit_off';
         $this->options['fixed_float'] = 0;
         $this->options['database_path'] = '';
         $this->options['database_extension'] = '';
         $this->options['server_version'] = '';
+        $this->options['max_identifiers_length'] = 128; //no real limit
     }
 
     // }}}
@@ -125,7 +129,7 @@
             
         // PHP 5.2+ prepends the function name to $php_errormsg, so we need
         // this hack to work around it, per bug #9599.
-        $native_msg = preg_replace('/^sqlite[a-z_]+\(\): /', '', $native_msg);
+        $native_msg = preg_replace('/^sqlite[a-z_]+\(\)[^:]*: /', '', $native_msg);
 
         if (is_null($error)) {
             static $error_regexps;
@@ -408,12 +412,14 @@
                 'unable to establish a connection', __FUNCTION__);
             }
 
+/*
             if (!empty($this->dsn['charset'])) {
                 $result = $this->setCharset($this->dsn['charset'], $connection);
                 if (PEAR::isError($result)) {
                     return $result;
                 }
             }
+*/
 
             $this->connection = $connection;
             $this->connected_dsn = $this->dsn;
@@ -422,6 +428,24 @@
             $this->dbsyntax = $this->dsn['dbsyntax'] ? $this->dsn['dbsyntax'] : $this->phptype;
         }
         return MDB2_OK;
+    }
+
+    // }}}
+    // {{{ databaseExists()
+
+    /**
+     * check if given database name is exists?
+     *
+     * @param string $name    name of the database that should be checked
+     *
+     * @return mixed true/false on success, a MDB2 error on failure
+     * @access public
+     */
+    function databaseExists($name)
+    {
+        $database_file = $this->_getDatabaseFile($name);
+        $result = file_exists($database_file);
+        return $result;
     }
 
     // }}}
@@ -721,7 +745,7 @@
                 $query .= ',';
                 $values.= ',';
             }
-            $query.= $name;
+            $query.= $this->quoteIdentifier($name, true);
             if (isset($fields[$name]['null']) && $fields[$name]['null']) {
                 $value = 'NULL';
             } else {
@@ -750,6 +774,7 @@
             return $connection;
         }
 
+        $table = $this->quoteIdentifier($table, true);
         $query = "REPLACE INTO $table ($query) VALUES ($values)";
         $result =& $this->_doQuery($query, true, $connection);
         if (PEAR::isError($result)) {
@@ -777,9 +802,11 @@
         $sequence_name = $this->quoteIdentifier($this->getSequenceName($seq_name), true);
         $seqcol_name = $this->options['seqcol_name'];
         $query = "INSERT INTO $sequence_name ($seqcol_name) VALUES (NULL)";
+        $this->pushErrorHandling(PEAR_ERROR_RETURN);
         $this->expectError(MDB2_ERROR_NOSUCHTABLE);
         $result =& $this->_doQuery($query, true);
         $this->popExpect();
+        $this->popErrorHandling();
         if (PEAR::isError($result)) {
             if ($ondemand && $result->getCode() == MDB2_ERROR_NOSUCHTABLE) {
                 $this->loadModule('Manager', null, true);

--
Gitblit v1.9.1