removed MySQL < 5 code

This commit is contained in:
Sebastian Mendel
2007-10-02 08:47:20 +00:00
parent d8a71a539f
commit 8a3d582aaa
4 changed files with 20 additions and 32 deletions

View File

@@ -244,7 +244,7 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
if ($do_relation && $have_rel) { if ($do_relation && $have_rel) {
$schema_insert .= '<td class="print"><b>' . htmlspecialchars($GLOBALS['strLinksTo']) . '</b></td>'; $schema_insert .= '<td class="print"><b>' . htmlspecialchars($GLOBALS['strLinksTo']) . '</b></td>';
} }
if ($do_comments && ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100)) { if ($do_comments) {
$schema_insert .= '<td class="print"><b>' . htmlspecialchars($GLOBALS['strComments']) . '</b></td>'; $schema_insert .= '<td class="print"><b>' . htmlspecialchars($GLOBALS['strComments']) . '</b></td>';
$comments = PMA_getComments($db, $table); $comments = PMA_getComments($db, $table);
} }

View File

@@ -37,10 +37,8 @@ if (isset($plugin_list)) {
$plugin_list['latex']['options'][] = $plugin_list['latex']['options'][] =
array('type' => 'bool', 'name' => 'relation', 'text' => 'strRelations'); array('type' => 'bool', 'name' => 'relation', 'text' => 'strRelations');
} }
if (!empty($GLOBALS['cfgRelation']['commwork']) || PMA_MYSQL_INT_VERSION >= 40100) { $plugin_list['latex']['options'][] =
$plugin_list['latex']['options'][] = array('type' => 'bool', 'name' => 'comments', 'text' => 'strComments');
array('type' => 'bool', 'name' => 'comments', 'text' => 'strComments');
}
if (!empty($GLOBALS['cfgRelation']['mimework'])) { if (!empty($GLOBALS['cfgRelation']['mimework'])) {
$plugin_list['latex']['options'][] = $plugin_list['latex']['options'][] =
array('type' => 'bool', 'name' => 'mime', 'text' => 'strMIME_MIMEtype'); array('type' => 'bool', 'name' => 'mime', 'text' => 'strMIME_MIMEtype');
@@ -344,7 +342,7 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
$columns_cnt++; $columns_cnt++;
$alignment .= 'l|'; $alignment .= 'l|';
} }
if ($do_comments && ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100)) { if ($do_comments) {
$columns_cnt++; $columns_cnt++;
$alignment .= 'l|'; $alignment .= 'l|';
} }
@@ -359,7 +357,7 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
if ($do_relation && $have_rel) { if ($do_relation && $have_rel) {
$header .= ' & \\multicolumn{1}{|c|}{\\textbf{' . $GLOBALS['strLinksTo'] . '}}'; $header .= ' & \\multicolumn{1}{|c|}{\\textbf{' . $GLOBALS['strLinksTo'] . '}}';
} }
if ($do_comments && ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100)) { if ($do_comments) {
$header .= ' & \\multicolumn{1}{|c|}{\\textbf{' . $GLOBALS['strComments'] . '}}'; $header .= ' & \\multicolumn{1}{|c|}{\\textbf{' . $GLOBALS['strComments'] . '}}';
$comments = PMA_getComments($db, $table); $comments = PMA_getComments($db, $table);
} }

View File

@@ -30,10 +30,8 @@ if (isset($plugin_list)) {
$plugin_list['odt']['options'][] = $plugin_list['odt']['options'][] =
array('type' => 'bool', 'name' => 'relation', 'text' => 'strRelations'); array('type' => 'bool', 'name' => 'relation', 'text' => 'strRelations');
} }
if (!empty($GLOBALS['cfgRelation']['commwork']) || PMA_MYSQL_INT_VERSION >= 40100) { $plugin_list['odt']['options'][] =
$plugin_list['odt']['options'][] = array('type' => 'bool', 'name' => 'comments', 'text' => 'strComments');
array('type' => 'bool', 'name' => 'comments', 'text' => 'strComments');
}
if (!empty($GLOBALS['cfgRelation']['mimework'])) { if (!empty($GLOBALS['cfgRelation']['mimework'])) {
$plugin_list['odt']['options'][] = $plugin_list['odt']['options'][] =
array('type' => 'bool', 'name' => 'mime', 'text' => 'strMIME_MIMEtype'); array('type' => 'bool', 'name' => 'mime', 'text' => 'strMIME_MIMEtype');
@@ -279,7 +277,7 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
if ($do_relation && $have_rel) { if ($do_relation && $have_rel) {
$columns_cnt++; $columns_cnt++;
} }
if ($do_comments && ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100)) { if ($do_comments) {
$columns_cnt++; $columns_cnt++;
} }
if ($do_mime && $cfgRelation['mimework']) { if ($do_mime && $cfgRelation['mimework']) {
@@ -305,7 +303,7 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
. '<text:p>' . htmlspecialchars($GLOBALS['strLinksTo']) . '</text:p>' . '<text:p>' . htmlspecialchars($GLOBALS['strLinksTo']) . '</text:p>'
. '</table:table-cell>'; . '</table:table-cell>';
} }
if ($do_comments && ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100)) { if ($do_comments) {
$GLOBALS['odt_buffer'] .= '<table:table-cell office:value-type="string">' $GLOBALS['odt_buffer'] .= '<table:table-cell office:value-type="string">'
. '<text:p>' . htmlspecialchars($GLOBALS['strComments']) . '</text:p>' . '<text:p>' . htmlspecialchars($GLOBALS['strComments']) . '</text:p>'
. '</table:table-cell>'; . '</table:table-cell>';
@@ -376,7 +374,7 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
. '</table:table-cell>'; . '</table:table-cell>';
} }
} }
if ($do_comments && ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100)) { if ($do_comments) {
if (isset($comments[$field_name])) { if (isset($comments[$field_name])) {
$GLOBALS['odt_buffer'] .= '<table:table-cell office:value-type="string">' $GLOBALS['odt_buffer'] .= '<table:table-cell office:value-type="string">'
. '<text:p>' . htmlspecialchars($comments[$field_name]) . '</text:p>' . '<text:p>' . htmlspecialchars($comments[$field_name]) . '</text:p>'

View File

@@ -59,10 +59,8 @@ if (isset($plugin_list)) {
} else { } else {
$drop_clause = 'DROP TABLE'; $drop_clause = 'DROP TABLE';
} }
} elseif (PMA_MYSQL_INT_VERSION >= 50000) {
$drop_clause = 'DROP TABLE / DROP VIEW';
} else { } else {
$drop_clause = 'DROP TABLE'; $drop_clause = 'DROP TABLE / DROP VIEW';
} }
$plugin_list['sql']['options'][] = $plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'drop_table', 'text' => sprintf($GLOBALS['strAddClause'], $drop_clause)); array('type' => 'bool', 'name' => 'drop_table', 'text' => sprintf($GLOBALS['strAddClause'], $drop_clause));
@@ -84,10 +82,6 @@ if (isset($plugin_list)) {
$plugin_list['sql']['options'][] = $plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'relation', 'text' => 'strRelations'); array('type' => 'bool', 'name' => 'relation', 'text' => 'strRelations');
} }
if (!empty($GLOBALS['cfgRelation']['commwork']) && PMA_MYSQL_INT_VERSION < 40100) {
$plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'comments', 'text' => 'strComments');
}
if (!empty($GLOBALS['cfgRelation']['mimework'])) { if (!empty($GLOBALS['cfgRelation']['mimework'])) {
$plugin_list['sql']['options'][] = $plugin_list['sql']['options'][] =
array('type' => 'bool', 'name' => 'mime', 'text' => 'strMIME_MIMEtype'); array('type' => 'bool', 'name' => 'mime', 'text' => 'strMIME_MIMEtype');
@@ -189,7 +183,7 @@ function PMA_exportHeader()
global $cfg; global $cfg;
global $mysql_charset_map; global $mysql_charset_map;
if (PMA_MYSQL_INT_VERSION >= 40100 && isset($GLOBALS['sql_compatibility']) && $GLOBALS['sql_compatibility'] != 'NONE') { if (isset($GLOBALS['sql_compatibility']) && $GLOBALS['sql_compatibility'] != 'NONE') {
PMA_DBI_try_query('SET SQL_MODE="' . $GLOBALS['sql_compatibility'] . '"'); PMA_DBI_try_query('SET SQL_MODE="' . $GLOBALS['sql_compatibility'] . '"');
} }
$head = PMA_exportComment('phpMyAdmin SQL Dump') $head = PMA_exportComment('phpMyAdmin SQL Dump')
@@ -219,7 +213,7 @@ function PMA_exportHeader()
/* We want exported AUTO_INCREMENT fields to have still same value, do this only for recent MySQL exports */ /* We want exported AUTO_INCREMENT fields to have still same value, do this only for recent MySQL exports */
if (!isset($GLOBALS['sql_compatibility']) || $GLOBALS['sql_compatibility'] == 'NONE') { if (!isset($GLOBALS['sql_compatibility']) || $GLOBALS['sql_compatibility'] == 'NONE') {
$head .= $crlf . (PMA_MYSQL_INT_VERSION >= 40101 ? 'SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";' . $crlf : ''); $head .= $crlf . 'SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";' . $crlf;
} }
if (isset($GLOBALS['sql_use_transaction'])) { if (isset($GLOBALS['sql_use_transaction'])) {
@@ -259,19 +253,17 @@ function PMA_exportDBCreate($db)
} }
} }
$create_query = 'CREATE DATABASE ' . (isset($GLOBALS['sql_backquotes']) ? PMA_backquote($db) : $db); $create_query = 'CREATE DATABASE ' . (isset($GLOBALS['sql_backquotes']) ? PMA_backquote($db) : $db);
if (PMA_MYSQL_INT_VERSION >= 40101) { $collation = PMA_getDbCollation($db);
$collation = PMA_getDbCollation($db); if (strpos($collation, '_')) {
if (strpos($collation, '_')) { $create_query .= ' DEFAULT CHARACTER SET ' . substr($collation, 0, strpos($collation, '_')) . ' COLLATE ' . $collation;
$create_query .= ' DEFAULT CHARACTER SET ' . substr($collation, 0, strpos($collation, '_')) . ' COLLATE ' . $collation; } else {
} else { $create_query .= ' DEFAULT CHARACTER SET ' . $collation;
$create_query .= ' DEFAULT CHARACTER SET ' . $collation;
}
} }
$create_query .= ';' . $crlf; $create_query .= ';' . $crlf;
if (!PMA_exportOutputHandler($create_query)) { if (!PMA_exportOutputHandler($create_query)) {
return FALSE; return FALSE;
} }
if (isset($GLOBALS['sql_backquotes']) && PMA_MYSQL_INT_VERSION >= 40100 && isset($GLOBALS['sql_compatibility']) && $GLOBALS['sql_compatibility'] == 'NONE') { if (isset($GLOBALS['sql_backquotes']) && isset($GLOBALS['sql_compatibility']) && $GLOBALS['sql_compatibility'] == 'NONE') {
return PMA_exportOutputHandler('USE ' . PMA_backquote($db) . ';' . $crlf); return PMA_exportOutputHandler('USE ' . PMA_backquote($db) . ';' . $crlf);
} }
return PMA_exportOutputHandler('USE ' . $db . ';' . $crlf); return PMA_exportOutputHandler('USE ' . $db . ';' . $crlf);
@@ -313,7 +305,7 @@ function PMA_exportDBFooter($db)
unset($GLOBALS['sql_constraints']); unset($GLOBALS['sql_constraints']);
} }
if (PMA_MYSQL_INT_VERSION >= 50000 && isset($GLOBALS['sql_structure']) && isset($GLOBALS['sql_procedure_function'])) { if (isset($GLOBALS['sql_structure']) && isset($GLOBALS['sql_procedure_function'])) {
$procs_funcs = ''; $procs_funcs = '';
$procedure_names = PMA_DBI_get_procedures_or_functions($db, 'PROCEDURE'); $procedure_names = PMA_DBI_get_procedures_or_functions($db, 'PROCEDURE');