mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-19 10:20:17 -06:00
sqlitemodel: fix select statements with limit/offset using expressions
This commit is contained in:
@@ -363,7 +363,7 @@ void SqliteTableModel::fetchData(unsigned int from, unsigned to)
|
||||
QString queryTemp = rtrimChar(m_sQuery, ';');
|
||||
|
||||
// If the query ends with a LIMIT statement take it as it is, if not append our own LIMIT part for lazy population
|
||||
if(queryTemp.contains(QRegExp("LIMIT\\s+\\d+\\s*((,|\\b(OFFSET)\\b)\\s*\\d+\\s*)?$", Qt::CaseInsensitive)))
|
||||
if(queryTemp.contains(QRegExp("LIMIT\\s+.+\\s*((,|\\b(OFFSET)\\b)\\s*.+\\s*)?$", Qt::CaseInsensitive)))
|
||||
sLimitQuery = queryTemp;
|
||||
else
|
||||
sLimitQuery = QString("%1 LIMIT %2, %3;").arg(queryTemp).arg(from).arg(to-from);
|
||||
|
||||
Reference in New Issue
Block a user