• unknown's avatar
    Bug #32374 crash with filesort when selecting from federated table and view. · cef31e05
    unknown authored
    filesort() uses file->estimate_rows_upper_bound() call to allocate
    internal buffers. If this function returns a value smaller than
    a number of row that will be returned later in find_all_keys(),
    that can cause server crash.
    Fixed by implementing ha_federated::estimate_rows_upper_bound() to
    return maximum possible number of rows.
    Present estimation for FEDERATED always returns 0 if the linked to the VIEW.
    
    
    mysql-test/r/federated.result:
      Bug #32374 crash with filesort when selecting from federated table and view.
      
      test result
    mysql-test/t/federated.test:
      Bug #32374 crash with filesort when selecting from federated table and view.
      
      test case
    sql/ha_federated.cc:
      Bug #32374 crash with filesort when selecting from federated table and view.
      
      ha_federated::estimate_rows_upper_bound() implemented
    sql/ha_federated.h:
      Bug #32374 crash with filesort when selecting from federated table and view.
      
      ha_federated::estimate_rows_upper_bound() interface
    cef31e05
ha_federated.cc 85.8 KB