Skip to content

Commit c096f87

Browse files
committed
Cleaning some mess with limitQuery
1 parent bde7637 commit c096f87

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

data/xml/queries.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -749,8 +749,8 @@
749749
<delimiter query="||"/>
750750
<limit query="LIMIT %d OFFSET %d"/>
751751
<limitregexp query="\s+LIMIT\s+([\d]+)\s+OFFSET\s+([\d]+)" query2="\s+LIMIT\s+([\d]+)"/>
752-
<limitgroupstart query="1"/>
753-
<limitgroupstop query="2"/>
752+
<limitgroupstart query="2"/>
753+
<limitgroupstop query="1"/>
754754
<limitstring query=" OFFSET "/>
755755
<order query="ORDER BY %s ASC"/>
756756
<count query="COUNT(%s)"/>

lib/core/agent.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,22 +1031,18 @@ def limitQuery(self, num, query, field=None, uniqueField=None):
10311031
fromFrom = limitedQuery[fromIndex + 1:]
10321032
orderBy = None
10331033

1034-
if Backend.getIdentifiedDbms() in (DBMS.MYSQL, DBMS.PGSQL, DBMS.SQLITE, DBMS.H2, DBMS.VERTICA, DBMS.PRESTO, DBMS.MIMERSQL, DBMS.CUBRID, DBMS.EXTREMEDB, DBMS.RAIMA):
1034+
if Backend.getIdentifiedDbms() in (DBMS.MYSQL, DBMS.PGSQL, DBMS.SQLITE, DBMS.VERTICA, DBMS.PRESTO, DBMS.MIMERSQL, DBMS.CUBRID, DBMS.EXTREMEDB, DBMS.DERBY):
10351035
limitStr = queries[Backend.getIdentifiedDbms()].limit.query % (num, 1)
10361036
limitedQuery += " %s" % limitStr
10371037

1038-
elif Backend.getIdentifiedDbms() in (DBMS.H2,):
1038+
elif Backend.getIdentifiedDbms() in (DBMS.H2, DBMS.CRATEDB, DBMS.CLICKHOUSE):
10391039
limitStr = queries[Backend.getIdentifiedDbms()].limit.query % (1, num)
10401040
limitedQuery += " %s" % limitStr
10411041

10421042
elif Backend.getIdentifiedDbms() in (DBMS.ALTIBASE,):
10431043
limitStr = queries[Backend.getIdentifiedDbms()].limit.query % (num + 1, 1)
10441044
limitedQuery += " %s" % limitStr
10451045

1046-
elif Backend.getIdentifiedDbms() in (DBMS.DERBY, DBMS.CRATEDB, DBMS.CLICKHOUSE):
1047-
limitStr = queries[Backend.getIdentifiedDbms()].limit.query % (num, 1)
1048-
limitedQuery += " %s" % limitStr
1049-
10501046
elif Backend.getIdentifiedDbms() in (DBMS.FRONTBASE, DBMS.VIRTUOSO):
10511047
limitStr = queries[Backend.getIdentifiedDbms()].limit.query % (num, 1)
10521048
if query.startswith("SELECT "):

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from thirdparty.six import unichr as _unichr
2121

2222
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
23-
VERSION = "1.7.12.2"
23+
VERSION = "1.7.12.3"
2424
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2525
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2626
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

0 commit comments

Comments
 (0)