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:
@@ -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)"
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user