bug #2687046 [export] Structure export: Null always YES
This commit is contained in:
@@ -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 .= '<td class="print">' . $fmt_pre . htmlspecialchars($row['Field']) . $fmt_post . '</td>';
|
||||
$schema_insert .= '<td class="print">' . htmlspecialchars($type) . '</td>';
|
||||
$schema_insert .= '<td class="print">' . htmlspecialchars($row['Null'] == '' ? $GLOBALS['strNo'] : $GLOBALS['strYes']) . '</td>';
|
||||
$schema_insert .= '<td class="print">' . htmlspecialchars(($row['Null'] == '' || $row['Null'] == 'NO') ? $GLOBALS['strNo'] : $GLOBALS['strYes']) . '</td>';
|
||||
$schema_insert .= '<td class="print">' . htmlspecialchars(isset($row['Default']) ? $row['Default'] : '') . '</td>';
|
||||
|
||||
$field_name = $row['Field'];
|
||||
|
@@ -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";
|
||||
|
@@ -356,7 +356,7 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
|
||||
. '<text:p>' . htmlspecialchars($type) . '</text:p>'
|
||||
. '</table:table-cell>';
|
||||
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'] .= '<table:table-cell office:value-type="string">'
|
||||
. '<text:p>' . htmlspecialchars(($row['Null'] == '') ? $GLOBALS['strNo'] : $GLOBALS['strYes']) . '</text:p>'
|
||||
. '<text:p>' . htmlspecialchars(($row['Null'] == '' || $row['Null'] == 'NO') ? $GLOBALS['strNo'] : $GLOBALS['strYes']) . '</text:p>'
|
||||
. '</table:table-cell>';
|
||||
$GLOBALS['odt_buffer'] .= '<table:table-cell office:value-type="string">'
|
||||
. '<text:p>' . htmlspecialchars($row['Default']) . '</text:p>'
|
||||
|
@@ -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'];
|
||||
|
Reference in New Issue
Block a user