From 42d5ca744b29c1004b7259f6066c7aee14837a40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 23 Nov 2005 22:13:18 +0000 Subject: [PATCH] Use native MySQL comments when applicable (RFE #1362923). --- ChangeLog | 4 ++++ libraries/display_tbl.lib.php | 2 +- libraries/export/htmlword.php | 2 +- libraries/export/latex.php | 2 +- tbl_change.php | 2 +- tbl_printview.php | 2 +- tbl_properties.inc.php | 4 ++-- tbl_properties_structure.php | 2 +- 8 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 46612a925..68cdcce2d 100755 --- a/ChangeLog +++ b/ChangeLog @@ -78,6 +78,10 @@ $Source$ default (RFE #1228013). * db_details_structure.php, left.php, tbl_properties_links.php: Do not pass default query to sql.php as it is not needed right now. + * tbl_change.php, tbl_printview.php, tbl_properties.inc.php, + tbl_properties_structure.php, libraries/display_tbl.lib.php, + libraries/export/htmlword.php, libraries/export/latex.php: Use native + MySQL comments when applicable (RFE #1362923). 2005-11-22 Sebastian Mendel * added test/theme.php: for testing themes diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index 7960d8a23..1d7715fbd 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -664,7 +664,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $ // 2.0.1 Prepare Display column comments if enabled ($GLOBALS['cfg']['ShowBrowseComments']). // Do not show comments, if using horizontalflipped mode, because of space usage - if ($GLOBALS['cfg']['ShowBrowseComments'] && $GLOBALS['cfgRelation']['commwork'] && $disp_direction != 'horizontalflipped') { + if ($GLOBALS['cfg']['ShowBrowseComments'] && ($GLOBALS['cfgRelation']['commwork'] || PMA_MYSQL_INT_VERSION >= 40100) && $disp_direction != 'horizontalflipped') { $comments_map = array(); foreach ($analyzed_sql[0]['table_ref'] as $tbl) { diff --git a/libraries/export/htmlword.php b/libraries/export/htmlword.php index 8c0063dcf..72a991f59 100644 --- a/libraries/export/htmlword.php +++ b/libraries/export/htmlword.php @@ -208,7 +208,7 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals if ($do_relation && $have_rel) { $schema_insert .= '' . htmlspecialchars($GLOBALS['strLinksTo']) . ''; } - if ($do_comments && $cfgRelation['commwork']) { + if ($do_comments && ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100)) { $schema_insert .= '' . htmlspecialchars($GLOBALS['strComments']) . ''; $comments = PMA_getComments($db, $table); } diff --git a/libraries/export/latex.php b/libraries/export/latex.php index f3321ce08..78d302c4d 100644 --- a/libraries/export/latex.php +++ b/libraries/export/latex.php @@ -283,7 +283,7 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals if ($do_relation && $have_rel) { $header .= ' & \\multicolumn{1}{|c|}{\\textbf{' . $GLOBALS['strLinksTo'] . '}}'; } - if ($do_comments && $cfgRelation['commwork']) { + if ($do_comments && ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100)) { $header .= ' & \\multicolumn{1}{|c|}{\\textbf{' . $GLOBALS['strComments'] . '}}'; $comments = PMA_getComments($db, $table); } diff --git a/tbl_change.php b/tbl_change.php index 0159e1b32..20e1b5959 100644 --- a/tbl_change.php +++ b/tbl_change.php @@ -84,7 +84,7 @@ if ($GLOBALS['cfg']['ShowPropertyComments']) { $cfgRelation = PMA_getRelationsParam(); - if ($cfgRelation['commwork']) { + if ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100) { $comments_map = PMA_getComments($db, $table); } } diff --git a/tbl_printview.php b/tbl_printview.php index a56622059..2878c1baf 100644 --- a/tbl_printview.php +++ b/tbl_printview.php @@ -231,7 +231,7 @@ foreach ($the_tables AS $key => $table) { } echo ' ' . "\n"; } - if ($cfgRelation['commwork']) { + if ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100) { echo ' '; $comments = PMA_getComments($db, $table); if (isset($comments[$field_name])) { diff --git a/tbl_properties.inc.php b/tbl_properties.inc.php index 72c002eb3..532b04c91 100644 --- a/tbl_properties.inc.php +++ b/tbl_properties.inc.php @@ -142,7 +142,7 @@ $comments_map = array(); $mime_map = array(); $available_mime = array(); -if ($cfgRelation['commwork']) { +if ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100) { $comments_map = PMA_getComments($db, $table); $header_cells[] = $strComments; @@ -502,7 +502,7 @@ for ( $i = 0 ; $i <= $num_fields; $i++ ) { } // end if ($action ==...) // garvin: comments - if ($cfgRelation['commwork']) { + if ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100) { $content_cells[$i][$ci] = ''; $ci++; } diff --git a/tbl_properties_structure.php b/tbl_properties_structure.php index f02784f75..579e44f5e 100644 --- a/tbl_properties_structure.php +++ b/tbl_properties_structure.php @@ -192,7 +192,7 @@ if ($GLOBALS['cfg']['ShowPropertyComments']) { $cfgRelation = PMA_getRelationsParam(); - if ($cfgRelation['commwork']) { + if ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100) { $comments_map = PMA_getComments($db, $table); if ($cfgRelation['mimework'] && $cfg['BrowseMIME']) {