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

Use primary key instead of LIMIT 1 if available

This commit is contained in:
Jakub Vrana
2018-02-05 11:21:19 +01:00
parent d2ed0f7810
commit 89ceb06208
3 changed files with 6 additions and 6 deletions

View File

@@ -246,7 +246,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
global $connection;
return (preg_match('~^INTO~', $query) || $connection->result("SELECT sqlite_compileoption_used('ENABLE_UPDATE_DELETE_LIMIT')")
? limit($query, $where, 1, 0, $separator)
: " $query WHERE rowid = (SELECT rowid FROM " . table($table) . $where . $separator . "LIMIT 1)"
: " $query WHERE rowid = (SELECT rowid FROM " . table($table) . $where . $separator . "LIMIT 1)" //! use primary key in tables with WITHOUT rowid
);
}