• Alexey Botchkov's avatar
    Bug#38005 Partitions: error with insert select. · b93962e0
    Alexey Botchkov authored
    MyISAM blocks index usage for bulk insert into zero-records tables.
    See ha_myisam::start_bulk_insert() lines from
    ...
        if (file->state->records == 0 ...
    ...
    
    That causes problems for partition engine when some partitions have records some not
    as the engine uses same access method for all partitions.
    
    Now partition engine doesn't call index_first/index_last
    for empty tables.
    
    per-file comments:
      mysql-test/r/partition.result
            Bug#38005 Partitions: error with insert select.
            test result
    
      mysql-test/t/partition.test
            Bug#38005 Partitions: error with insert select.
            test case
    
      sql/ha_partition.cc
            Bug#38005 Partitions: error with insert select.
            ha_engine::index_first and
            ha_engine::index_last not called for empty tables.
    b93962e0
ha_partition.cc 183 KB