• gkodinov/kgeorge@macbook.gmz's avatar
    Bug #22367: Optimizer uses ref join type instead of eq_ref for simple join on · a1310d84
    gkodinov/kgeorge@macbook.gmz authored
                 strings
    MySQL is setting the flag HA_END_SPACE_KEYS for all the keys that reference
    text or varchar columns with collation different than binary.
    This was done to handle correctly the situation where a lookup on such a key
    may return more than 1 row because of the presence of many rows that differ
    only by the amount of trailing space in the table's string column.
    Inserting such values however appears to violate the unique checks on 
    INSERT/UPDATE. Thus that flag must not be set as it will prevent the optimizer
    from choosing a faster access method.
    This fix removes the setting of the HA_END_SPACE_KEYS flag.
    a1310d84
func_str.result 52 KB