mirror of
https://github.com/vrana/adminer.git
synced 2025-08-06 06:37:33 +02:00
Skip dump of generated columns
This commit is contained in:
@@ -831,6 +831,7 @@ class Adminer {
|
||||
$insert = "";
|
||||
$buffer = "";
|
||||
$keys = array();
|
||||
$generated = array();
|
||||
$suffix = "";
|
||||
$fetch_function = ($table != '' ? 'fetch_assoc' : 'fetch_row');
|
||||
while ($row = $result->$fetch_function()) {
|
||||
@@ -838,6 +839,10 @@ class Adminer {
|
||||
$values = array();
|
||||
foreach ($row as $val) {
|
||||
$field = $result->fetch_field();
|
||||
if ($fields[$field->name]['generated']) {
|
||||
$generated[$field->name] = true;
|
||||
continue;
|
||||
}
|
||||
$keys[] = $field->name;
|
||||
$key = idf_escape($field->name);
|
||||
$values[] = "$key = VALUES($key)";
|
||||
@@ -855,6 +860,10 @@ class Adminer {
|
||||
$insert = "INSERT INTO " . table($table) . " (" . implode(", ", array_map('idf_escape', $keys)) . ") VALUES";
|
||||
}
|
||||
foreach ($row as $key => $val) {
|
||||
if ($generated[$key]) {
|
||||
unset($row[$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)))
|
||||
|
@@ -2,6 +2,7 @@ Adminer 4.9.0-dev:
|
||||
Validate connection to server in HTTP based drivers
|
||||
Elasticsearch 5: Make unusable driver usable again, move it to plugins
|
||||
Add new Elasticsearch 7 driver
|
||||
MySQL: Skip dump of generated columns
|
||||
|
||||
Adminer 4.8.2:
|
||||
Support multi-line table comments
|
||||
|
Reference in New Issue
Block a user