Fix LIMIT OFFSET order sensitivity (MySQL is kind of dumb...)

This commit is contained in:
Mike Primm 2022-07-29 23:10:27 -05:00
parent 7dabbab8c9
commit bf8d5eb6cf

View File

@ -798,7 +798,7 @@ public class MySQLMapStorage extends MapStorage {
while (!done) {
// Query tiles for given mapkey
Statement stmt = c.createStatement();
ResultSet rs = stmt.executeQuery(String.format("SELECT x,y,zoom,Format FROM %s WHERE MapID=%d OFFSET %d LIMIT %d;", tableTiles, mapkey, offset, limit));
ResultSet rs = stmt.executeQuery(String.format("SELECT x,y,zoom,Format FROM %s WHERE MapID=%d LIMIT %d OFFSET %d;", tableTiles, mapkey, limit, offset));
int cnt = 0;
while (rs.next()) {
StorageTile st = new StorageTile(world, map, rs.getInt("x"), rs.getInt("y"), rs.getInt("zoom"), var);