• Sergei Golubchik's avatar
    Revert "MDEV-10713: signal 11 error on multi-table update - crash in... · ab65db6d
    Sergei Golubchik authored
    Revert "MDEV-10713: signal 11 error on multi-table update - crash in handler::increment_statistics or in make_select or assertion failure pfs_thread == ((PFS_thread*) pthread_getspecific((THR_PFS)))"
    
    This reverts commit 035a5ac6.
    
    Two minor problems and one regression:
    1. caching the value in str_result. Other Item methods may use it,
       destroying the cache. See, for example, Item::save_in_field, where
       str_result is moved to use a local buffer (this failed main.grant)
    2. Item_func_conv_charset::safe is now set too late, it's initialized
       only in val_str() but checked before that, this failed many tests
       in optimized builds.
    
    to fix 1 - use tmp_result instead of str_result, to fix 2, use
    the else branch in the Item_func_conv_charset constructor to set
    safe purely from charset properties.
    
    But this introduces a regression, constant strings can no longer be
    converted, say, from utf8 to latin1 (because 'safe' will be false).
    This fails few tests too. There is no way to fix it without reverting
    the commit and converting constants, as before, in the constructor.
    ab65db6d
item_strfunc.h 28.4 KB