This is an automated email from the ASF dual-hosted git repository.
adrabble pushed a commit to branch
530-order-by-size-of-ip-range-in-the-http-iploc-server
in repository https://gitbox.apache.org/repos/asf/incubator-baremaps.git
The following commit(s) were added to
refs/heads/530-order-by-size-of-ip-range-in-the-http-iploc-server by this push:
new 3f150e60 Sort SQL query by IP range start
3f150e60 is described below
commit 3f150e60c94c0b08a46f426b6054a76fbb28ab8f
Author: Antoine Drabble <[email protected]>
AuthorDate: Wed Nov 30 12:40:45 2022 +0100
Sort SQL query by IP range start
---
.../baremaps/iploc/database/InetnumLocationDaoSqliteImpl.java | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git
a/baremaps-core/src/main/java/org/apache/baremaps/iploc/database/InetnumLocationDaoSqliteImpl.java
b/baremaps-core/src/main/java/org/apache/baremaps/iploc/database/InetnumLocationDaoSqliteImpl.java
index 66f147d6..b7b86ac4 100644
---
a/baremaps-core/src/main/java/org/apache/baremaps/iploc/database/InetnumLocationDaoSqliteImpl.java
+++
b/baremaps-core/src/main/java/org/apache/baremaps/iploc/database/InetnumLocationDaoSqliteImpl.java
@@ -38,13 +38,12 @@ public final class InetnumLocationDaoSqliteImpl implements
InetnumLocationDao {
private static final String INSERT_SQL =
"INSERT INTO inetnum_locations(address, ip_start, ip_end, latitude,
longitude, network, country) VALUES(?,?,?,?,?,?,?)";
- private static final String SELECT_ALL_SQL =
- "SELECT " + "id, \n" + "address, \n" + "ip_start, \n" + "ip_end, \n" +
"latitude, \n"
- + "longitude, \n" + "network, \n" + "country \n" + " FROM
inetnum_locations;";
+ private static final String SELECT_ALL_SQL = "SELECT id, address, ip_start,
ip_end, latitude, "
+ + "longitude, network, country FROM inetnum_locations;";
- private static final String SELECT_ALL_BY_IP_SQL = "SELECT " + "id, \n" +
"address, \n"
- + "ip_start, \n" + "ip_end, \n" + "latitude, \n" + "longitude, \n" +
"network, \n"
- + "country FROM inetnum_locations WHERE ip_start <= ? AND ip_end >= ?;";
+ private static final String SELECT_ALL_BY_IP_SQL = "SELECT id, address, "
+ + "ip_start, ip_end, latitude, longitude, network, "
+ + "country FROM inetnum_locations WHERE ip_start <= ? AND ip_end >= ?
ORDER BY ip_start DESC;";
private static final Logger logger =
LoggerFactory.getLogger(InetnumLocationDaoSqliteImpl.class);