diff --git a/ChangeLog b/ChangeLog
index 356fd47d3..3d0e082fd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -27,6 +27,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
- bug #2740550 [interface] Using textarea CharEditing drops default values
- bug #2634827 [import] Using DELIMITER ends with infinite cycle
- bug #2729191 [config] CheckConfigurationPermissions = false is worthless
+- bug #2687046 [export] Structure export: Null always YES
3.1.3.1 (2009-03-24)
- [security] HTTP Response Splitting and file inclusion vulnerabilities
diff --git a/libraries/export/htmlword.php b/libraries/export/htmlword.php
index 02ea2489e..8ed80c623 100644
--- a/libraries/export/htmlword.php
+++ b/libraries/export/htmlword.php
@@ -299,7 +299,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 {
@@ -318,7 +318,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 f2b2c8023..61b05dc38 100644
--- a/libraries/export/latex.php
+++ b/libraries/export/latex.php
@@ -416,7 +416,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 {
@@ -425,7 +425,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 1556fc248..4a4406ffe 100644
--- a/libraries/export/odt.php
+++ b/libraries/export/odt.php
@@ -355,7 +355,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'] = '';
@@ -364,7 +364,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 f4f6f0952..56c14b8af 100644
--- a/libraries/export/texytext.php
+++ b/libraries/export/texytext.php
@@ -287,7 +287,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 {
@@ -306,7 +306,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'];