Fixed export of '0' string (bug #1033869).

This commit is contained in:
Michal Čihař
2004-09-24 15:41:50 +00:00
parent b334f41dd4
commit 3bd2a9732f
2 changed files with 31 additions and 26 deletions

View File

@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
$Id$
$Source$
2004-09-24 Michal Čihař <michal@cihar.com>
* libraries/export/sql.php: Fixed export of '0' string (bug #1033869).
2004-09-23 Marc Delisle <lem9@users.sourceforge.net>
* all themes: item_ltr.png and item_rtl.png: new solid arrow
that looks better, thanks to Efim Shuvikov

View File

@@ -526,14 +526,16 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
// timestamp is numeric on some MySQL 4.1
} elseif ($fields_meta[$j]->numeric && $fields_meta[$j]->type != 'timestamp') {
$values[] = $row[$j];
// handle empty string special way, just to speed up things and to catch empty BLOBs
} elseif (empty($row[$j])) {
$values[] = '\'\'';
// a binary field
// Note: with mysqli, under MySQL 4.1.3, we get the flag
// "binary" for a datetime (I don't know why)
} else if (stristr($field_flags[$j], 'BINARY') && isset($GLOBALS['hexforbinary']) && $fields_meta[$j]->type != 'datetime') {
// empty blobs need to be different, but '0' is also empty :-(
if (empty($row[$j]) && $row[$j] != '0') {
$values[] = '\'\'';
} else {
$values[] = '0x' . bin2hex($row[$j]);
}
// something else -> treat as a string
} else {
$values[] = '\'' . str_replace($search, $replace, PMA_sqlAddslashes($row[$j])) . '\'';