From 5f4f2e8f3ffa8cfaf02dc65fa017e0125b2db383 Mon Sep 17 00:00:00 2001 From: Herman van Rink Date: Tue, 14 Apr 2009 13:34:20 +0000 Subject: [PATCH] bug #2687046 [export] Structure export: Null always YES --- libraries/export/htmlword.php | 4 ++-- libraries/export/latex.php | 6 ++++-- libraries/export/odt.php | 4 ++-- libraries/export/texytext.php | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/libraries/export/htmlword.php b/libraries/export/htmlword.php index 1740f3a1c..e1efdd4ec 100644 --- a/libraries/export/htmlword.php +++ b/libraries/export/htmlword.php @@ -300,7 +300,7 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals $strAttribute = 'UNSIGNED ZEROFILL'; } if (!isset($row['Default'])) { - if ($row['Null'] != '') { + if ($row['Null'] != 'NO') { $row['Default'] = 'NULL'; } } else { @@ -319,7 +319,7 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals } $schema_insert .= '' . $fmt_pre . htmlspecialchars($row['Field']) . $fmt_post . ''; $schema_insert .= '' . htmlspecialchars($type) . ''; - $schema_insert .= '' . htmlspecialchars($row['Null'] == '' ? $GLOBALS['strNo'] : $GLOBALS['strYes']) . ''; + $schema_insert .= '' . htmlspecialchars(($row['Null'] == '' || $row['Null'] == 'NO') ? $GLOBALS['strNo'] : $GLOBALS['strYes']) . ''; $schema_insert .= '' . htmlspecialchars(isset($row['Default']) ? $row['Default'] : '') . ''; $field_name = $row['Field']; diff --git a/libraries/export/latex.php b/libraries/export/latex.php index fe6d9f27a..d42e85b44 100644 --- a/libraries/export/latex.php +++ b/libraries/export/latex.php @@ -417,7 +417,7 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals $zerofill = preg_match('/ZEROFILL/i', $row['Type']); } if (!isset($row['Default'])) { - if ($row['Null'] != '') { + if ($row['Null'] != 'NO') { $row['Default'] = 'NULL'; } } else { @@ -426,7 +426,9 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals $field_name = $row['Field']; - $local_buffer = $field_name . "\000" . $type . "\000" . (($row['Null'] == '') ? $GLOBALS['strNo'] : $GLOBALS['strYes']) . "\000" . (isset($row['Default']) ? $row['Default'] : ''); + $local_buffer = $field_name . "\000" . $type . "\000" + . (($row['Null'] == '' || $row['Null'] == 'NO') ? $GLOBALS['strNo'] : $GLOBALS['strYes']) + . "\000" . (isset($row['Default']) ? $row['Default'] : ''); if ($do_relation && $have_rel) { $local_buffer .= "\000"; diff --git a/libraries/export/odt.php b/libraries/export/odt.php index 136c639b6..aeeb25a89 100644 --- a/libraries/export/odt.php +++ b/libraries/export/odt.php @@ -356,7 +356,7 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals . '' . htmlspecialchars($type) . '' . ''; if (!isset($row['Default'])) { - if ($row['Null'] != '') { + if ($row['Null'] != 'NO') { $row['Default'] = 'NULL'; } else { $row['Default'] = ''; @@ -365,7 +365,7 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals $row['Default'] = $row['Default']; } $GLOBALS['odt_buffer'] .= '' - . '' . htmlspecialchars(($row['Null'] == '') ? $GLOBALS['strNo'] : $GLOBALS['strYes']) . '' + . '' . htmlspecialchars(($row['Null'] == '' || $row['Null'] == 'NO') ? $GLOBALS['strNo'] : $GLOBALS['strYes']) . '' . ''; $GLOBALS['odt_buffer'] .= '' . '' . htmlspecialchars($row['Default']) . '' diff --git a/libraries/export/texytext.php b/libraries/export/texytext.php index 544d67407..e3d98a731 100644 --- a/libraries/export/texytext.php +++ b/libraries/export/texytext.php @@ -289,7 +289,7 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals $strAttribute = 'UNSIGNED ZEROFILL'; } if (!isset($row['Default'])) { - if ($row['Null'] != '') { + if ($row['Null'] != 'NO') { $row['Default'] = 'NULL'; } } else { @@ -308,7 +308,7 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals } $text_output .= '|' . $fmt_pre . htmlspecialchars($row['Field']) . $fmt_post; $text_output .= '|' . htmlspecialchars($type); - $text_output .= '|' . htmlspecialchars($row['Null'] == '' ? $GLOBALS['strNo'] : $GLOBALS['strYes']); + $text_output .= '|' . htmlspecialchars(($row['Null'] == '' || $row['Null'] == 'NO') ? $GLOBALS['strNo'] : $GLOBALS['strYes']); $text_output .= '|' . htmlspecialchars(isset($row['Default']) ? $row['Default'] : ''); $field_name = $row['Field'];