bug #1444892, TYPE deprecated in MySQL 5.1

This commit is contained in:
Marc Delisle
2006-03-08 18:07:55 +00:00
parent 55c79bdf7c
commit 4d359e7e2f
4 changed files with 17 additions and 4 deletions

View File

@@ -5,6 +5,11 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2006-03-08 Marc Delisle <lem9@users.sourceforge.net>
* 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 <lem9@users.sourceforge.net> 2006-03-07 Marc Delisle <lem9@users.sourceforge.net>
* libraries/Config.class.php: bug #1444867, does not load config.inc.php * libraries/Config.class.php: bug #1444867, does not load config.inc.php
under PHP < 4.3.0, thanks to Julian Ladisch - julianladisch under PHP < 4.3.0, thanks to Julian Ladisch - julianladisch

View File

@@ -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 (PMA_MYSQL_INT_VERSION >= 40100) {
// If $lang is defined and we are on MySQL >= 4.1.x, // If $lang is defined and we are on MySQL >= 4.1.x,

View File

@@ -148,8 +148,8 @@ if (isset($submit_num_fields)) {
// Adds table type, character set and comments // Adds table type, character set and comments
if (!empty($tbl_type) && ($tbl_type != 'Default')) { if (!empty($tbl_type) && ($tbl_type != 'Default')) {
$sql_query .= ' TYPE = ' . $tbl_type; $sql_query .= ' ' . PMA_ENGINE_KEYWORD . ' = ' . $tbl_type;
$query_cpy .= "\n" . 'TYPE = ' . $tbl_type; $query_cpy .= "\n" . PMA_ENGINE_KEYWORD . ' = ' . $tbl_type;
} }
if (PMA_MYSQL_INT_VERSION >= 40100 && !empty($tbl_collation)) { if (PMA_MYSQL_INT_VERSION >= 40100 && !empty($tbl_collation)) {
$sql_query .= PMA_generateCharsetQueryPart($tbl_collation); $sql_query .= PMA_generateCharsetQueryPart($tbl_collation);

View File

@@ -62,7 +62,7 @@ if (isset($_REQUEST['submitoptions'])) {
} }
if (! empty($_REQUEST['new_tbl_type']) if (! empty($_REQUEST['new_tbl_type'])
&& strtolower($_REQUEST['new_tbl_type']) !== strtolower($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']; $tbl_type = $_REQUEST['new_tbl_type'];
} }
@@ -405,7 +405,7 @@ if ($tbl_type == 'MYISAM' || $tbl_type == 'BERKELEYDB' || $tbl_type == 'INNODB')
} }
if ($tbl_type == 'INNODB') { if ($tbl_type == 'INNODB') {
$this_url_params = array_merge($url_params, $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'));
?> ?>
<li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>"> <li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>">
<?php echo $strDefragment; ?></a> <?php echo $strDefragment; ?></a>