fix
This commit is contained in:
parent
1f14b418ee
commit
1177e98b3f
|
@ -850,6 +850,7 @@ class Adminer {
|
|||
$insert = "";
|
||||
$buffer = "";
|
||||
$keys = array();
|
||||
$generatedKeys = array();
|
||||
$suffix = "";
|
||||
$fetch_function = ($table != '' ? 'fetch_assoc' : 'fetch_row');
|
||||
while ($row = $result->$fetch_function()) {
|
||||
|
@ -857,6 +858,10 @@ class Adminer {
|
|||
$values = array();
|
||||
foreach ($row as $val) {
|
||||
$field = $result->fetch_field();
|
||||
if (!empty($fields[$field->name]['generated'])) {
|
||||
$generatedKeys[$field->name] = true;
|
||||
continue;
|
||||
}
|
||||
$keys[] = $field->name;
|
||||
$key = idf_escape($field->name);
|
||||
$values[] = "$key = VALUES($key)";
|
||||
|
@ -874,6 +879,9 @@ class Adminer {
|
|||
$insert = "INSERT INTO " . table($table) . " (" . implode(", ", array_map('idf_escape', $keys)) . ") VALUES";
|
||||
}
|
||||
foreach ($row as $key => $val) {
|
||||
if (isset($generatedKeys[$key])) {
|
||||
continue;
|
||||
}
|
||||
$field = $fields[$key];
|
||||
$row[$key] = ($val !== null
|
||||
? unconvert_field($field, preg_match(number_type(), $field["type"]) && !preg_match('~\[~', $field["full_type"]) && is_numeric($val) ? $val : q(($val === false ? 0 : $val)))
|
||||
|
|
Loading…
Reference in a new issue