diff options
| author | Nils Adermann <naderman@naderman.de> | 2010-03-02 01:05:34 +0100 |
|---|---|---|
| committer | Nils Adermann <naderman@naderman.de> | 2010-03-02 01:05:34 +0100 |
| commit | 89b37954f994a7cd517553d2d16686f91dcaae72 (patch) | |
| tree | b20e25768bc55be250454c439ffee08ce2981031 /phpBB/includes/db | |
| parent | 07633a66e8c9bbb2b288a286bfbea6f562eeca4d (diff) | |
| parent | 80d429a02d26da1f00777e62a0268d83f581f598 (diff) | |
| download | forums-89b37954f994a7cd517553d2d16686f91dcaae72.tar forums-89b37954f994a7cd517553d2d16686f91dcaae72.tar.gz forums-89b37954f994a7cd517553d2d16686f91dcaae72.tar.bz2 forums-89b37954f994a7cd517553d2d16686f91dcaae72.tar.xz forums-89b37954f994a7cd517553d2d16686f91dcaae72.zip | |
Merge commit 'release-3.0-B4'
Diffstat (limited to 'phpBB/includes/db')
| -rw-r--r-- | phpBB/includes/db/dbal.php | 7 | ||||
| -rw-r--r-- | phpBB/includes/db/mssql.php | 3 | ||||
| -rw-r--r-- | phpBB/includes/db/mssql_odbc.php | 3 | ||||
| -rw-r--r-- | phpBB/includes/db/oracle.php | 46 |
4 files changed, 3 insertions, 56 deletions
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index d2d3efedaa..da5efcf55a 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -307,15 +307,15 @@ class dbal } else { - return $field . ($negate ? ' NOT IN ' : ' IN ' ) . '(' . implode(', ', array_map(array($this, '_sql_validate_value'), $array)) . ')'; + return $field . ($negate ? ' NOT IN ' : ' IN ') . '(' . implode(', ', array_map(array($this, '_sql_validate_value'), $array)) . ')'; } } /** * Run more than one insert statement. * - * @param $sql_ary array multi-dimensional array holding the statement data. - * @param $table string table name to run the statements on + * @param string $table table name to run the statements on + * @param array &$sql_ary multi-dimensional array holding the statement data. * * @return bool false if no statements were executed. * @access public @@ -332,7 +332,6 @@ class dbal case 'mysql': case 'mysql4': case 'mysqli': - case 'sqlite': $this->sql_query('INSERT INTO ' . $table . ' ' . $this->sql_build_array('MULTI_INSERT', $sql_ary)); break; diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php index f95f99969c..439cb725fb 100644 --- a/phpBB/includes/db/mssql.php +++ b/phpBB/includes/db/mssql.php @@ -116,9 +116,6 @@ class dbal_mssql extends dbal $this->sql_report('start', $query); } - // For now, MSSQL has no real UTF-8 support - $query = utf8_decode($query); - $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false; $this->sql_add_num_queries($this->query_result); diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php index 12e3ca686e..2cb3bf0f2d 100644 --- a/phpBB/includes/db/mssql_odbc.php +++ b/phpBB/includes/db/mssql_odbc.php @@ -114,9 +114,6 @@ class dbal_mssql_odbc extends dbal $this->sql_report('start', $query); } - // For now, MSSQL has no real UTF-8 support - $query = utf8_decode($query); - $this->last_query_text = $query; $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false; $this->sql_add_num_queries($this->query_result); diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php index e8a0ce3605..8f65c667a7 100644 --- a/phpBB/includes/db/oracle.php +++ b/phpBB/includes/db/oracle.php @@ -219,52 +219,6 @@ class dbal_oracle extends dbal { $this->query_result = false; - // Any implicit columns exist? - if (strpos($query, '.*') !== false) - { - // This sucker does a few things for us. It grabs all the explicitly named columns and what tables are being used - preg_match('/SELECT (?:DISTINCT )?(.*?)FROM(.*?)(?:WHERE|(ORDER|GROUP) BY|$)/s', $query, $tables); - - // The prefixes of the explicit columns don't matter, they simply get in the way - preg_match_all('/\.(\w+)/', trim($tables[1]), $columns); - - // Flip lets us do an easy isset() call - $columns = array_flip($columns[1]); - - $table_data = trim($tables[2]); - - // Grab the implicitly named columns, they need expanding... - preg_match_all('/(\w)\.\*/', $query, $info); - - $cols = array(); - - foreach ($info[1] as $table_alias) - { - // We need to get the name of the aliased table - preg_match('/(\w+) ' . $table_alias . '/', $table_data, $table_name); - $table_name = $table_name[1]; - - $sql = "SELECT column_name - FROM all_tab_cols - WHERE table_name = '" . strtoupper($table_name) . "'"; - - $result = $this->sql_query($sql); - while ($row = $this->sql_fetchrow($result)) - { - if (!isset($columns[strtolower($row['column_name'])])) - { - $cols[] = $table_alias . '.' . strtolower($row['column_name']); - } - } - $this->sql_freeresult($result); - - // Remove the implicity .* with it's full expansion - $query = str_replace($table_alias . '.*', implode(', ', $cols), $query); - - unset($cols); - } - } - $query = 'SELECT * FROM (SELECT /*+ FIRST_ROWS */ rownum AS xrownum, a.* FROM (' . $query . ') a WHERE rownum <= ' . ($offset + $total) . ') WHERE xrownum >= ' . $offset; return $this->sql_query($query, $cache_ttl); |
