@@ -562,4 +562,17 @@ var testGeo = func(t *testing.T, configs util.KvrocksServerConfigs) {
562562 rdb .GeoRadiusStore (ctx , "points" , 13.361389 , 38.115556 , & redis.GeoRadiusQuery {Radius : 500 , Unit : "km" , Store : "points2" })
563563 require .EqualValues (t , rdb .ZRange (ctx , "points" , 0 , - 1 ).Val (), rdb .ZRange (ctx , "points2" , 0 , - 1 ).Val ())
564564 })
565+
566+ t .Run ("GEORADIUS DESC with equal distances should not crash" , func (t * testing.T ) {
567+ require .NoError (t , rdb .Del (ctx , "geokey" ).Err ())
568+ require .NoError (t , rdb .GeoAdd (ctx , "geokey" ,
569+ & redis.GeoLocation {Name : "A" , Longitude : 13.361389 , Latitude : 38.115556 },
570+ & redis.GeoLocation {Name : "B" , Longitude : 13.361389 , Latitude : 38.115556 },
571+ & redis.GeoLocation {Name : "C" , Longitude : 13.361389 , Latitude : 38.115556 },
572+ & redis.GeoLocation {Name : "D" , Longitude : 15.087269 , Latitude : 37.502669 },
573+ ).Err ())
574+ results := rdb .GeoRadius (ctx , "geokey" , 13.361389 , 38.115556 ,
575+ & redis.GeoRadiusQuery {Radius : 500 , Unit : "km" , Sort : "DESC" }).Val ()
576+ require .Len (t , results , 4 )
577+ })
565578}
0 commit comments