Fixed export of '0' string (bug #1033869).
This commit is contained in:
@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
|
|||||||
$Id$
|
$Id$
|
||||||
$Source$
|
$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>
|
2004-09-23 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* all themes: item_ltr.png and item_rtl.png: new solid arrow
|
* all themes: item_ltr.png and item_rtl.png: new solid arrow
|
||||||
that looks better, thanks to Efim Shuvikov
|
that looks better, thanks to Efim Shuvikov
|
||||||
|
@@ -526,14 +526,16 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
|
|||||||
// timestamp is numeric on some MySQL 4.1
|
// timestamp is numeric on some MySQL 4.1
|
||||||
} elseif ($fields_meta[$j]->numeric && $fields_meta[$j]->type != 'timestamp') {
|
} elseif ($fields_meta[$j]->numeric && $fields_meta[$j]->type != 'timestamp') {
|
||||||
$values[] = $row[$j];
|
$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
|
// a binary field
|
||||||
// Note: with mysqli, under MySQL 4.1.3, we get the flag
|
// Note: with mysqli, under MySQL 4.1.3, we get the flag
|
||||||
// "binary" for a datetime (I don't know why)
|
// "binary" for a datetime (I don't know why)
|
||||||
} else if (stristr($field_flags[$j], 'BINARY') && isset($GLOBALS['hexforbinary']) && $fields_meta[$j]->type != 'datetime') {
|
} 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]);
|
$values[] = '0x' . bin2hex($row[$j]);
|
||||||
|
}
|
||||||
// something else -> treat as a string
|
// something else -> treat as a string
|
||||||
} else {
|
} else {
|
||||||
$values[] = '\'' . str_replace($search, $replace, PMA_sqlAddslashes($row[$j])) . '\'';
|
$values[] = '\'' . str_replace($search, $replace, PMA_sqlAddslashes($row[$j])) . '\'';
|
||||||
|
Reference in New Issue
Block a user