• Sergei Petrunia's avatar
    MDEV-16154: Server crashes in in myrocks::ha_rocksdb::load_auto_incr_value_from_index · 7e7592ad
    Sergei Petrunia authored
    Backport the fix from the upstream and add our testcase.
    Backported cset:
    commit 997a979bf5e2f75ab88781d9d3fd22dddc1fc21f
    Author: Manuel Ung <mung@fb.com>
    Date:   Thu Feb 15 08:38:12 2018 -0800
    
        Fix crashes in autoincrement code paths
    
        Summary:
        There are two issues related to autoincrement that can lead to crashes:
    
        1. The max value for double/float type for autoincrement was not implemented in MyRocks, and can lead to assertions. The fix is to add them in.
        2. If we try to set auto_increment via alter table on a table without an auto_increment column defined, we segfault because there is no index from which to read the last value. The fix is to perform a check to see if autoincrement exists before reading from index (similar to code ha_rocksdb::open).
    
        Fixes https://github.com/facebook/mysql-5.6/issues/792
        Closes https://github.com/facebook/mysql-5.6/pull/794
    
        Differential Revision: D6995096
    
        Pulled By: lth
    
        fbshipit-source-id: 1130ce1
    7e7592ad
ha_rocksdb.cc 455 KB