• Sergey Glukhov's avatar
    Bug#11766300 59387: FAILING ASSERTION: CURSOR->POS_STATE == 1997660512 (BTR_PCUR_IS_POSITIONE · b5c690aa
    Sergey Glukhov authored
    Bug#13639204 64111: CRASH ON SELECT SUBQUERY WITH NON UNIQUE INDEX
    The crash happened due to wrong calculation
    of key length during creation of reference for
    sort order index. The problem is that
    keyuse->used_tables can have OUTER_REF_TABLE_BIT enabled
    but used_tables parameter(create_ref_for_key() func) does
    not have it. So key parts which have OUTER_REF_TABLE_BIT
    are ommited and it could lead to incorrect key length
    calculation(zero key length).
    
    
    mysql-test/r/subselect_innodb.result:
      test result
    mysql-test/t/subselect_innodb.test:
      test case
    sql/sql_select.cc:
      added OUTER_REF_TABLE_BIT to the used_tables parameter
      for create_ref_for_key() function.
    storage/innobase/handler/ha_innodb.cc:
      added assertion, request from Inno team
    storage/innodb_plugin/handler/ha_innodb.cc:
      added assertion, request from Inno team
    b5c690aa
ha_innodb.cc 269 KB