diff --git a/ChangeLog b/ChangeLog index 58e5e6239..7f1efea40 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,11 @@ phpMyAdmin - Changelog $Id$ $Source$ +2006-03-08 Marc Delisle + * libraries/database_interface.lib.php, tbl_create.php, + tbl_properties_operations.php: bug #1444892, TYPE deprecated in + MySQL 5.1 + 2006-03-07 Marc Delisle * libraries/Config.class.php: bug #1444867, does not load config.inc.php under PHP < 4.3.0, thanks to Julian Ladisch - julianladisch diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index 48622b107..f09b77e46 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -737,6 +737,14 @@ function PMA_DBI_postConnect($link, $is_controluser = false) } } + if (!defined('PMA_ENGINE_KEYWORD')) { + if (PMA_MYSQL_INT_VERSION >= 40102) { + define('PMA_ENGINE_KEYWORD','ENGINE'); + } else { + define('PMA_ENGINE_KEYWORD','TYPE'); + } + } + if (PMA_MYSQL_INT_VERSION >= 40100) { // If $lang is defined and we are on MySQL >= 4.1.x, diff --git a/tbl_create.php b/tbl_create.php index ccdb7c9b1..df9aa8e20 100644 --- a/tbl_create.php +++ b/tbl_create.php @@ -148,8 +148,8 @@ if (isset($submit_num_fields)) { // Adds table type, character set and comments if (!empty($tbl_type) && ($tbl_type != 'Default')) { - $sql_query .= ' TYPE = ' . $tbl_type; - $query_cpy .= "\n" . 'TYPE = ' . $tbl_type; + $sql_query .= ' ' . PMA_ENGINE_KEYWORD . ' = ' . $tbl_type; + $query_cpy .= "\n" . PMA_ENGINE_KEYWORD . ' = ' . $tbl_type; } if (PMA_MYSQL_INT_VERSION >= 40100 && !empty($tbl_collation)) { $sql_query .= PMA_generateCharsetQueryPart($tbl_collation); diff --git a/tbl_properties_operations.php b/tbl_properties_operations.php index 562d1dcd0..b9ab590d8 100644 --- a/tbl_properties_operations.php +++ b/tbl_properties_operations.php @@ -62,7 +62,7 @@ if (isset($_REQUEST['submitoptions'])) { } if (! empty($_REQUEST['new_tbl_type']) && strtolower($_REQUEST['new_tbl_type']) !== strtolower($tbl_type)) { - $table_alters[] = 'TYPE = ' . $_REQUEST['new_tbl_type']; + $table_alters[] = PMA_ENGINE_KEYWORD . ' = ' . $_REQUEST['new_tbl_type']; $tbl_type = $_REQUEST['new_tbl_type']; } @@ -405,7 +405,7 @@ if ($tbl_type == 'MYISAM' || $tbl_type == 'BERKELEYDB' || $tbl_type == 'INNODB') } if ($tbl_type == 'INNODB') { $this_url_params = array_merge($url_params, - array('sql_query' => 'ALTER TABLE ' . PMA_backquote($GLOBALS['table']) . ' TYPE=InnoDB')); + array('sql_query' => 'ALTER TABLE ' . PMA_backquote($GLOBALS['table']) . ' ' . PMA_ENGINE_KEYWORD . '=InnoDB')); ?>