mirror of
https://github.com/vrana/adminer.git
synced 2025-08-31 18:11:52 +02:00
Skip dump of generated columns
This commit is contained in:
@@ -841,6 +841,7 @@ class Adminer {
|
|||||||
$insert = "";
|
$insert = "";
|
||||||
$buffer = "";
|
$buffer = "";
|
||||||
$keys = array();
|
$keys = array();
|
||||||
|
$generatedKeys = array();
|
||||||
$suffix = "";
|
$suffix = "";
|
||||||
$fetch_function = ($table != '' ? 'fetch_assoc' : 'fetch_row');
|
$fetch_function = ($table != '' ? 'fetch_assoc' : 'fetch_row');
|
||||||
while ($row = $result->$fetch_function()) {
|
while ($row = $result->$fetch_function()) {
|
||||||
@@ -848,6 +849,10 @@ class Adminer {
|
|||||||
$values = array();
|
$values = array();
|
||||||
foreach ($row as $val) {
|
foreach ($row as $val) {
|
||||||
$field = $result->fetch_field();
|
$field = $result->fetch_field();
|
||||||
|
if (!empty($fields[$field->name]['generated'])) {
|
||||||
|
$generatedKeys[$field->name] = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$keys[] = $field->name;
|
$keys[] = $field->name;
|
||||||
$key = idf_escape($field->name);
|
$key = idf_escape($field->name);
|
||||||
$values[] = "$key = VALUES($key)";
|
$values[] = "$key = VALUES($key)";
|
||||||
@@ -865,6 +870,10 @@ class Adminer {
|
|||||||
$insert = "INSERT INTO " . table($table) . " (" . implode(", ", array_map('idf_escape', $keys)) . ") VALUES";
|
$insert = "INSERT INTO " . table($table) . " (" . implode(", ", array_map('idf_escape', $keys)) . ") VALUES";
|
||||||
}
|
}
|
||||||
foreach ($row as $key => $val) {
|
foreach ($row as $key => $val) {
|
||||||
|
if (isset($generatedKeys[$key])) {
|
||||||
|
unset($row[$key]);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$field = $fields[$key];
|
$field = $fields[$key];
|
||||||
$row[$key] = ($val !== null
|
$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)))
|
? unconvert_field($field, preg_match(number_type(), $field["type"]) && !preg_match('~\[~', $field["full_type"]) && is_numeric($val) ? $val : q(($val === false ? 0 : $val)))
|
||||||
|
@@ -9,6 +9,7 @@ Adminer 4.9.0-dev:
|
|||||||
- Improve URL and email detection.
|
- Improve URL and email detection.
|
||||||
- Fix AdminerVersionNoverify plugin blocking other plugins to modify HTML head.
|
- Fix AdminerVersionNoverify plugin blocking other plugins to modify HTML head.
|
||||||
- Fix several bugs and security issues in AdminerFileUpload plugin.
|
- Fix several bugs and security issues in AdminerFileUpload plugin.
|
||||||
|
- Skip dump of generated columns.
|
||||||
- Update composer.json.
|
- Update composer.json.
|
||||||
|
|
||||||
Adminer 4.8.2 (released 2024-03-16):
|
Adminer 4.8.2 (released 2024-03-16):
|
||||||
|
1
todo.txt
1
todo.txt
@@ -20,7 +20,6 @@ Joining tables - PRIMARY KEY (table, joining)
|
|||||||
Rank, Tree structure
|
Rank, Tree structure
|
||||||
|
|
||||||
MySQL:
|
MySQL:
|
||||||
Generated columns (MySQL >= 5.7.6)
|
|
||||||
Data longer than max_allowed_packet can be sent by mysqli_stmt_send_long_data()
|
Data longer than max_allowed_packet can be sent by mysqli_stmt_send_long_data()
|
||||||
|
|
||||||
MariaDB:
|
MariaDB:
|
||||||
|
Reference in New Issue
Block a user