• unknown's avatar
    Bug #30286 spatial index cause corruption and server crash! · 6d54b577
    unknown authored
    As the result of DOUBLE claculations can be bigger
    than DBL_MAX constant we use in code, we shouldn't use this constatn
    as a biggest possible value.
    Particularly the rtree_pick_key function set 'min_area= DBL_MAX' relying
    that any rtree_area_increase result will be less so we return valid
    key. Though in rtree_area_increase function we calculate the area
    of the rectangle, so the result can be 'inf' if the rectangle is
    huge enough, which is bigger than DBL_MAX.
    
    Code of the rtree_pick_key modified so we always return a valid key.
    
    
    myisam/rt_index.c:
      Bug #30286 spatial index cause corruption and server crash!
      
      always set the best_key with the first key we get, so we always return
      somthing valid.
    myisam/rt_mbr.c:
      Bug #30286 spatial index cause corruption and server crash!
      
      function comment extended
    mysql-test/r/gis-rtree.result:
      Bug #30286 spatial index cause corruption and server crash!
      test result
    mysql-test/t/gis-rtree.test:
      Bug #30286 spatial index cause corruption and server crash!
      test case
    6d54b577
rt_mbr.c 21.1 KB