1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 15:47:00 +02:00

Use separator in limit1

This commit is contained in:
Jakub Vrana
2018-02-01 18:53:53 +01:00
parent 0866c79afb
commit 685bf29abc
7 changed files with 15 additions and 14 deletions

View File

@@ -242,11 +242,11 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
return " $query$where" . ($limit !== null ? $separator . "LIMIT $limit" . ($offset ? " OFFSET $offset" : "") : "");
}
function limit1($table, $query, $where) {
function limit1($table, $query, $where, $separator = "\n") {
global $connection;
return (preg_match('~^INTO~', $query) || $connection->result("SELECT sqlite_compileoption_used('ENABLE_UPDATE_DELETE_LIMIT')")
? limit($query, $where, 1)
: " $query WHERE rowid = (SELECT rowid FROM " . table($table) . "$where LIMIT 1)"
? limit($query, $where, 1, 0, $separator)
: " $query WHERE rowid = (SELECT rowid FROM " . table($table) . $where . $separator . "LIMIT 1)"
);
}