Skip to content

Commit

Permalink
Remove duplicated line
Browse files Browse the repository at this point in the history
  • Loading branch information
geographika committed Feb 21, 2020
1 parent fbc6f88 commit f56b120
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mapmssql2008.c
Original file line number Diff line number Diff line change
Expand Up @@ -1488,11 +1488,13 @@ static int prepare_database(layerObj *layer, rectObj rect, char **query_string)
if (paging_query) {
paging_query = msStringConcatenate(paging_query, "[geom], [id] FROM (");
query = msStringConcatenate(query, "]) 'id', row_number() over (");
if (layerinfo->sort_spec) {
query = msStringConcatenate(query, layerinfo->sort_spec);
}

if (layer->sortBy.nProperties > 0) {
tmp = msLayerBuildSQLOrderBy(layer);
if (layerinfo->sort_spec) {
query = msStringConcatenate(query, layerinfo->sort_spec);
query = msStringConcatenate(query, ", ");
}
else {
Expand All @@ -1502,10 +1504,8 @@ static int prepare_database(layerObj *layer, rectObj rect, char **query_string)
msFree(tmp);
}
else {
if (layerinfo->sort_spec) {
query = msStringConcatenate(query, layerinfo->sort_spec);
}
else {
if (!layerinfo->sort_spec) {
// use the unique Id as the default sort for paging
query = msStringConcatenate(query, "ORDER BY ");
query = msStringConcatenate(query, layerinfo->urid_name);
}
Expand Down

0 comments on commit f56b120

Please sign in to comment.