1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-13 10:04:07 +02:00

PostgreSQL: Fix clone after e395fe5

This commit is contained in:
Jakub Vrana
2025-03-22 20:55:51 +01:00
parent 359fdf3d07
commit 9b162e8291
3 changed files with 14 additions and 15 deletions

View File

@@ -239,11 +239,11 @@ if (isset($_GET["pgsql"])) {
$this->types[lang('User types')] = array_flip($types);
}
function insertSql($table, $set) {
function insertReturning($table) {
$auto_increment = array_filter(fields($table), function ($field) {
return $field['auto_increment'];
});
return parent::insertSql($table, $set) . (count($auto_increment) == 1 ? " RETURNING " . idf_escape(key($auto_increment)) : "");
return (count($auto_increment) == 1 ? " RETURNING " . idf_escape(key($auto_increment)) : "");
}
function insertUpdate($table, $rows, $primary) {
@@ -783,7 +783,7 @@ ORDER BY SPECIFIC_NAME');
}
function last_id($result) {
return (is_object($result) ? $result->fetch_column(0) : 0);
return (is_object($result) && $result->num_rows ? $result->fetch_column(0) : 0);
}
function explain($connection, $query) {