Skip to content

Commit

Permalink
ogr_sql_rfc28.py: better testing of ORDER BY ... LIMIT 1
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.osgeo.org/gdal/trunk@37569 f0d54148-0727-0410-94bb-9a71ac55c965
  • Loading branch information
rouault committed Mar 3, 2017
1 parent c259adb commit 277ab88
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion autotest/ogr/ogr_sql_rfc28.py
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,27 @@ def ogr_rfc28_47():
gdaltest.post_reason('fail')
return 'fail'

lyr = gdaltest.ds.ExecuteSQL( "SELECT * FROM POLY WHERE 0 LIMIT 1" )
lyr = gdaltest.ds.ExecuteSQL( "SELECT * FROM POLY ORDER BY EAS_ID LIMIT 1" )
if lyr.GetFeatureCount() != 1:
gdaltest.post_reason('fail')
return 'fail'
tr = ogrtest.check_features_against_list( lyr, 'EAS_ID', [158] )
gdaltest.ds.ReleaseResultSet( lyr )
if not tr:
gdaltest.post_reason('fail')
return 'fail'

lyr = gdaltest.ds.ExecuteSQL( "SELECT * FROM POLY ORDER BY PRFEDEA LIMIT 1" )
if lyr.GetFeatureCount() != 1:
gdaltest.post_reason('fail')
return 'fail'
tr = ogrtest.check_features_against_list( lyr, 'PRFEDEA', ['35043369'] )
gdaltest.ds.ReleaseResultSet( lyr )
if not tr:
gdaltest.post_reason('fail')
return 'fail'

lyr = gdaltest.ds.ExecuteSQL( "SELECT * FROM POLY WHERE 0 ORDER BY EAS_ID LIMIT 1" )
if lyr.GetNextFeature() is not None:
gdaltest.post_reason('fail')
return 'fail'
Expand Down

0 comments on commit 277ab88

Please sign in to comment.