mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
MDEV-6424: MariaDB server crashes with assertion failure in file ha_innodb.c line 11652
This is not a fix, this is instrumentation to find out is MySQL frm dictionary and InnoDB data dictionary really out-of-sync when this assertion is fired, or is there some other reason (bug).
This commit is contained in:
parent
42a398b59b
commit
03ddc19ab2
2 changed files with 140 additions and 12 deletions
|
|
@ -1998,11 +1998,16 @@ innobase_get_stmt(
|
||||||
THD* thd, /*!< in: MySQL thread handle */
|
THD* thd, /*!< in: MySQL thread handle */
|
||||||
size_t* length) /*!< out: length of the SQL statement */
|
size_t* length) /*!< out: length of the SQL statement */
|
||||||
{
|
{
|
||||||
LEX_STRING* stmt;
|
const char* query = NULL;
|
||||||
|
LEX_STRING *stmt = NULL;
|
||||||
stmt = thd_query_string(thd);
|
if (thd) {
|
||||||
*length = stmt->length;
|
stmt = thd_query_string(thd);
|
||||||
return(stmt->str);
|
if (stmt) {
|
||||||
|
*length = stmt->length;
|
||||||
|
query = stmt->str;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (query);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************************************************************//**
|
/**********************************************************************//**
|
||||||
|
|
@ -6616,7 +6621,66 @@ build_template_field(
|
||||||
UNIV_MEM_INVALID(templ, sizeof *templ);
|
UNIV_MEM_INVALID(templ, sizeof *templ);
|
||||||
templ->col_no = i;
|
templ->col_no = i;
|
||||||
templ->clust_rec_field_no = dict_col_get_clust_pos(col, clust_index);
|
templ->clust_rec_field_no = dict_col_get_clust_pos(col, clust_index);
|
||||||
ut_a(templ->clust_rec_field_no != ULINT_UNDEFINED);
|
|
||||||
|
/* If clustered index record field is not found, lets print out
|
||||||
|
field names and all the rest to understand why field is not found. */
|
||||||
|
if (templ->clust_rec_field_no == ULINT_UNDEFINED) {
|
||||||
|
const char* tb_col_name = dict_table_get_col_name(clust_index->table, i);
|
||||||
|
dict_field_t* field=NULL;
|
||||||
|
size_t size = 0;
|
||||||
|
|
||||||
|
for(ulint j=0; j < clust_index->n_user_defined_cols; j++) {
|
||||||
|
dict_field_t* ifield = &(clust_index->fields[j]);
|
||||||
|
if (ifield && !memcmp(tb_col_name, ifield->name,
|
||||||
|
strlen(tb_col_name))) {
|
||||||
|
field = ifield;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ib_logf(IB_LOG_LEVEL_INFO,
|
||||||
|
"Looking for field %lu name %s from table %s",
|
||||||
|
i,
|
||||||
|
(tb_col_name ? tb_col_name : "NULL"),
|
||||||
|
clust_index->table->name);
|
||||||
|
|
||||||
|
|
||||||
|
for(ulint j=0; j < clust_index->n_user_defined_cols; j++) {
|
||||||
|
dict_field_t* ifield = &(clust_index->fields[j]);
|
||||||
|
ib_logf(IB_LOG_LEVEL_INFO,
|
||||||
|
"InnoDB Table %s field %lu name %s",
|
||||||
|
clust_index->table->name,
|
||||||
|
j,
|
||||||
|
(ifield ? ifield->name : "NULL"));
|
||||||
|
}
|
||||||
|
|
||||||
|
for(ulint j=0; j < table->s->stored_fields; j++) {
|
||||||
|
ib_logf(IB_LOG_LEVEL_INFO,
|
||||||
|
"MySQL table %s field %lu name %s",
|
||||||
|
table->s->table_name.str,
|
||||||
|
j,
|
||||||
|
table->field[j]->field_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
ib_logf(IB_LOG_LEVEL_ERROR,
|
||||||
|
"Clustered record field for column %lu"
|
||||||
|
" not found table n_user_defined %d"
|
||||||
|
" index n_user_defined %d"
|
||||||
|
" InnoDB table %s field name %s"
|
||||||
|
" MySQL table %s field name %s n_fields %d"
|
||||||
|
" query %s",
|
||||||
|
i,
|
||||||
|
clust_index->n_user_defined_cols,
|
||||||
|
clust_index->table->n_cols - DATA_N_SYS_COLS,
|
||||||
|
clust_index->table->name,
|
||||||
|
(field ? field->name : "NULL"),
|
||||||
|
table->s->table_name.str,
|
||||||
|
(tb_col_name ? tb_col_name : "NULL"),
|
||||||
|
table->s->stored_fields,
|
||||||
|
innobase_get_stmt(current_thd, &size));
|
||||||
|
|
||||||
|
ut_a(templ->clust_rec_field_no != ULINT_UNDEFINED);
|
||||||
|
}
|
||||||
|
|
||||||
if (dict_index_is_clust(index)) {
|
if (dict_index_is_clust(index)) {
|
||||||
templ->rec_field_no = templ->clust_rec_field_no;
|
templ->rec_field_no = templ->clust_rec_field_no;
|
||||||
|
|
|
||||||
|
|
@ -2355,11 +2355,16 @@ innobase_get_stmt(
|
||||||
THD* thd, /*!< in: MySQL thread handle */
|
THD* thd, /*!< in: MySQL thread handle */
|
||||||
size_t* length) /*!< out: length of the SQL statement */
|
size_t* length) /*!< out: length of the SQL statement */
|
||||||
{
|
{
|
||||||
LEX_STRING* stmt;
|
const char* query = NULL;
|
||||||
|
LEX_STRING *stmt = NULL;
|
||||||
stmt = thd_query_string(thd);
|
if (thd) {
|
||||||
*length = stmt->length;
|
stmt = thd_query_string(thd);
|
||||||
return(stmt->str);
|
if (stmt) {
|
||||||
|
*length = stmt->length;
|
||||||
|
query = stmt->str;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (query);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************************************************************//**
|
/**********************************************************************//**
|
||||||
|
|
@ -7517,7 +7522,66 @@ build_template_field(
|
||||||
UNIV_MEM_INVALID(templ, sizeof *templ);
|
UNIV_MEM_INVALID(templ, sizeof *templ);
|
||||||
templ->col_no = i;
|
templ->col_no = i;
|
||||||
templ->clust_rec_field_no = dict_col_get_clust_pos(col, clust_index);
|
templ->clust_rec_field_no = dict_col_get_clust_pos(col, clust_index);
|
||||||
ut_a(templ->clust_rec_field_no != ULINT_UNDEFINED);
|
|
||||||
|
/* If clustered index record field is not found, lets print out
|
||||||
|
field names and all the rest to understand why field is not found. */
|
||||||
|
if (templ->clust_rec_field_no == ULINT_UNDEFINED) {
|
||||||
|
const char* tb_col_name = dict_table_get_col_name(clust_index->table, i);
|
||||||
|
dict_field_t* field=NULL;
|
||||||
|
size_t size = 0;
|
||||||
|
|
||||||
|
for(ulint j=0; j < clust_index->n_user_defined_cols; j++) {
|
||||||
|
dict_field_t* ifield = &(clust_index->fields[j]);
|
||||||
|
if (ifield && !memcmp(tb_col_name, ifield->name,
|
||||||
|
strlen(tb_col_name))) {
|
||||||
|
field = ifield;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ib_logf(IB_LOG_LEVEL_INFO,
|
||||||
|
"Looking for field %lu name %s from table %s",
|
||||||
|
i,
|
||||||
|
(tb_col_name ? tb_col_name : "NULL"),
|
||||||
|
clust_index->table->name);
|
||||||
|
|
||||||
|
|
||||||
|
for(ulint j=0; j < clust_index->n_user_defined_cols; j++) {
|
||||||
|
dict_field_t* ifield = &(clust_index->fields[j]);
|
||||||
|
ib_logf(IB_LOG_LEVEL_INFO,
|
||||||
|
"InnoDB Table %s field %lu name %s",
|
||||||
|
clust_index->table->name,
|
||||||
|
j,
|
||||||
|
(ifield ? ifield->name : "NULL"));
|
||||||
|
}
|
||||||
|
|
||||||
|
for(ulint j=0; j < table->s->stored_fields; j++) {
|
||||||
|
ib_logf(IB_LOG_LEVEL_INFO,
|
||||||
|
"MySQL table %s field %lu name %s",
|
||||||
|
table->s->table_name.str,
|
||||||
|
j,
|
||||||
|
table->field[j]->field_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
ib_logf(IB_LOG_LEVEL_ERROR,
|
||||||
|
"Clustered record field for column %lu"
|
||||||
|
" not found table n_user_defined %d"
|
||||||
|
" index n_user_defined %d"
|
||||||
|
" InnoDB table %s field name %s"
|
||||||
|
" MySQL table %s field name %s n_fields %d"
|
||||||
|
" query %s",
|
||||||
|
i,
|
||||||
|
clust_index->n_user_defined_cols,
|
||||||
|
clust_index->table->n_cols - DATA_N_SYS_COLS,
|
||||||
|
clust_index->table->name,
|
||||||
|
(field ? field->name : "NULL"),
|
||||||
|
table->s->table_name.str,
|
||||||
|
(tb_col_name ? tb_col_name : "NULL"),
|
||||||
|
table->s->stored_fields,
|
||||||
|
innobase_get_stmt(current_thd, &size));
|
||||||
|
|
||||||
|
ut_a(templ->clust_rec_field_no != ULINT_UNDEFINED);
|
||||||
|
}
|
||||||
|
|
||||||
if (dict_index_is_clust(index)) {
|
if (dict_index_is_clust(index)) {
|
||||||
templ->rec_field_no = templ->clust_rec_field_no;
|
templ->rec_field_no = templ->clust_rec_field_no;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue