• unknown's avatar
    Fixed stack overrun with some INSERT ... SELECT ... GROUP BY queries (Bug #3265) · b0a8fde8
    unknown authored
    Ensure that raid_chunks is not set to higher than 255 as this could cause problems with DROP DATABASE. (Bug #3182)
    
    
    mysql-test/r/raid.result:
      Test of raid_chunks > 255
    mysql-test/t/raid.test:
      Test of raid_chunks > 255
    sql/item.cc:
      Fixed wrong usage of str_value in Item::save_in_field
      This could caused a stack overrun with some very special INSERT ... SELECT ... GROUP BY queries where the GROUP BY value was an expression that generated a NULL value. (Bug #3265)
      The Item_copy_string::save_in_field() function is from 4.1 and helps optimized this case a bit
    sql/item.h:
      Fixed wrong usage of str_value in Item_copy_string::save_in_field
    sql/sql_insert.cc:
      More debug information
    sql/table.cc:
      Ensure that raid_chunks is not set to higher than 255 as this could cause problems with DROP DATABASE.
      Another problem with values > 255 is that in the .frm file we store the chunks value in one byte.
      (Bug #3182)
    b0a8fde8
table.cc 36.9 KB