1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-17 20:01:25 +02:00

Improve export of binary data types (bug #3526494)

This commit is contained in:
Jakub Vrana
2013-04-26 22:57:44 -07:00
parent 2afd915f00
commit 7541ceb1ca
5 changed files with 30 additions and 16 deletions

View File

@@ -638,7 +638,8 @@ username.form['auth[driver]'].onchange();
$buffer = "";
$keys = array();
$suffix = "";
while ($row = $result->fetch_row()) {
$fetch_function = ($table != '' ? 'fetch_assoc' : 'fetch_row');
while ($row = $result->$fetch_function()) {
if (!$keys) {
$values = array();
foreach ($row as $val) {
@@ -660,8 +661,9 @@ username.form['auth[driver]'].onchange();
$insert = "INSERT INTO " . table($table) . " (" . implode(", ", array_map('idf_escape', $keys)) . ") VALUES";
}
foreach ($row as $key => $val) {
$field = $fields[$key];
$row[$key] = ($val !== null
? (ereg('(^|[^o])int|float|double|decimal|bit', $fields[$keys[$key]]["type"]) && $val != '' ? $val : q($val)) //! columns looking like functions
? unconvert_field($field, ereg('(^|[^o])int|float|double|decimal', $field["type"]) && $val != '' ? $val : q($val))
: "NULL"
);
}