diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2009-02-28 19:22:27 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2009-02-28 19:22:27 +0000 |
| commit | 62973fa50416cebd78b46aba7e29f9746e949032 (patch) | |
| tree | 621fde9ce34e356606113248da6032b700a37a75 /phpBB/includes/db | |
| parent | bfa4e6038e1e15bab8c19a6a0caa9607933b972b (diff) | |
| download | forums-62973fa50416cebd78b46aba7e29f9746e949032.tar forums-62973fa50416cebd78b46aba7e29f9746e949032.tar.gz forums-62973fa50416cebd78b46aba7e29f9746e949032.tar.bz2 forums-62973fa50416cebd78b46aba7e29f9746e949032.tar.xz forums-62973fa50416cebd78b46aba7e29f9746e949032.zip | |
- adjust db_tools again to not remove any schema (they may be required)
- fill dbms version if not yet filled
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9351 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/db')
| -rw-r--r-- | phpBB/includes/db/db_tools.php | 47 |
1 files changed, 13 insertions, 34 deletions
diff --git a/phpBB/includes/db/db_tools.php b/phpBB/includes/db/db_tools.php index 1b14bd56f6..601f1be38b 100644 --- a/phpBB/includes/db/db_tools.php +++ b/phpBB/includes/db/db_tools.php @@ -311,9 +311,6 @@ class phpbb_db_tools $this->sql_layer = $this->db->sql_layer; break; } - - // Because we only need the dbms type map of one database type, we "adjust" it now. ;) - $this->dbms_type_map = $this->dbms_type_map[$this->sql_layer]; } /** @@ -877,55 +874,37 @@ class phpbb_db_tools if (strpos($column_data[0], ':') !== false) { list($orig_column_type, $column_length) = explode(':', $column_data[0]); - - if (!is_array($this->dbms_type_map[$orig_column_type . ':'])) - { - $column_type = sprintf($this->db->dbms_type_map[$orig_column_type . ':'], $column_length); - } - - $orig_column_type .= ':'; - } - else - { - $orig_column_type = $column_data[0]; - $column_type = $this->db->dbms_type_map[$column_data[0]]; - } - - // Get type - if (strpos($column_data[0], ':') !== false) - { - list($orig_column_type, $column_length) = explode(':', $column_data[0]); - if (!is_array($this->dbms_type_map[$orig_column_type . ':'])) + if (!is_array($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':'])) { - $column_type = sprintf($this->dbms_type_map[$orig_column_type . ':'], $column_length); + $column_type = sprintf($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':'], $column_length); } else { - if (isset($this->dbms_type_map[$orig_column_type . ':']['rule'])) + if (isset($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['rule'])) { - switch ($this->dbms_type_map[$orig_column_type . ':']['rule'][0]) + switch ($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['rule'][0]) { case 'div': - $column_length /= $this->dbms_type_map[$orig_column_type . ':']['rule'][1]; + $column_length /= $this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['rule'][1]; $column_length = ceil($column_length); - $column_type = sprintf($this->dbms_type_map[$orig_column_type . ':'][0], $column_length); + $column_type = sprintf($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':'][0], $column_length); break; } } - if (isset($this->dbms_type_map[$orig_column_type . ':']['limit'])) + if (isset($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['limit'])) { - switch ($this->dbms_type_map[$orig_column_type . ':']['limit'][0]) + switch ($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['limit'][0]) { case 'mult': - $column_length *= $this->dbms_type_map[$orig_column_type . ':']['limit'][1]; - if ($column_length > $this->dbms_type_map[$orig_column_type . ':']['limit'][2]) + $column_length *= $this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['limit'][1]; + if ($column_length > $this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['limit'][2]) { - $column_type = $this->dbms_type_map[$orig_column_type . ':']['limit'][3]; + $column_type = $this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['limit'][3]; } else { - $column_type = sprintf($this->dbms_type_map[$orig_column_type . ':'][0], $column_length); + $column_type = sprintf($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':'][0], $column_length); } break; } @@ -936,7 +915,7 @@ class phpbb_db_tools else { $orig_column_type = $column_data[0]; - $column_type = $this->dbms_type_map[$column_data[0]]; + $column_type = $this->dbms_type_map[$this->sql_layer][$column_data[0]]; } // Adjust default value if db-dependant specified |
