mirror of
https://github.com/vrana/adminer.git
synced 2025-08-13 10:04:07 +02:00
PostgreSQL: Limit rows in data manipulation without unique key
This commit is contained in:
@@ -147,7 +147,7 @@ if (isset($_GET["firebird"])) {
|
||||
return $return;
|
||||
}
|
||||
|
||||
function limit1($query, $where) {
|
||||
function limit1($table, $query, $where) {
|
||||
return limit($query, $where, 1);
|
||||
}
|
||||
|
||||
|
@@ -308,7 +308,7 @@ if (isset($_GET["mssql"])) {
|
||||
return ($limit !== null ? " TOP (" . ($limit + $offset) . ")" : "") . " $query$where"; // seek later
|
||||
}
|
||||
|
||||
function limit1($query, $where) {
|
||||
function limit1($table, $query, $where) {
|
||||
return limit($query, $where, 1);
|
||||
}
|
||||
|
||||
|
@@ -362,11 +362,12 @@ if (!defined("DRIVER")) {
|
||||
}
|
||||
|
||||
/** Formulate SQL modification query with limit 1
|
||||
* @param string
|
||||
* @param string everything after UPDATE or DELETE
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
function limit1($query, $where) {
|
||||
function limit1($table, $query, $where) {
|
||||
return limit($query, $where, 1);
|
||||
}
|
||||
|
||||
|
@@ -175,8 +175,8 @@ if (isset($_GET["oracle"])) {
|
||||
));
|
||||
}
|
||||
|
||||
function limit1($query, $where) {
|
||||
return " $query$where";
|
||||
function limit1($table, $query, $where) {
|
||||
return " $query$where"; //! limit
|
||||
}
|
||||
|
||||
function db_collation($db, $collations) {
|
||||
|
@@ -226,8 +226,8 @@ if (isset($_GET["pgsql"])) {
|
||||
return " $query$where" . ($limit !== null ? $separator . "LIMIT $limit" . ($offset ? " OFFSET $offset" : "") : "");
|
||||
}
|
||||
|
||||
function limit1($query, $where) {
|
||||
return " $query$where";
|
||||
function limit1($table, $query, $where) {
|
||||
return (preg_match('~^INTO~', $query) ? limit($query, $where, 1) : "$query WHERE ctid = (SELECT ctid FROM " . table($table) . "$where LIMIT 1)");
|
||||
}
|
||||
|
||||
function db_collation($db, $collations) {
|
||||
|
@@ -242,9 +242,9 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
||||
return " $query$where" . ($limit !== null ? $separator . "LIMIT $limit" . ($offset ? " OFFSET $offset" : "") : "");
|
||||
}
|
||||
|
||||
function limit1($query, $where) {
|
||||
function limit1($table, $query, $where) {
|
||||
global $connection;
|
||||
return ($connection->result("SELECT sqlite_compileoption_used('ENABLE_UPDATE_DELETE_LIMIT')") ? limit($query, $where, 1) : " $query$where");
|
||||
return ($connection->result("SELECT sqlite_compileoption_used('ENABLE_UPDATE_DELETE_LIMIT')") ? limit($query, $where, 1) : " $query$where"); //! limit
|
||||
}
|
||||
|
||||
function db_collation($db, $collations) {
|
||||
|
Reference in New Issue
Block a user