Commit a70b8961 authored by Jan Lindström's avatar Jan Lindström

MDEV-9424: Server crashes when slave works with partitioned tables copied from Windows to Linux

Add check to avoid NULL-pointer access and added warning if share->ib_table
is not what expected.
parent c0b6c27d
...@@ -7563,7 +7563,13 @@ ha_innobase::write_row( ...@@ -7563,7 +7563,13 @@ ha_innobase::write_row(
ha_statistic_increment(&SSV::ha_write_count); ha_statistic_increment(&SSV::ha_write_count);
if (UNIV_UNLIKELY(share->ib_table->is_corrupt)) { if (share->ib_table != prebuilt->table) {
fprintf(stderr,
"InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.",
share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
}
if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
DBUG_RETURN(HA_ERR_CRASHED); DBUG_RETURN(HA_ERR_CRASHED);
} }
...@@ -7799,7 +7805,13 @@ report_error: ...@@ -7799,7 +7805,13 @@ report_error:
func_exit: func_exit:
innobase_active_small(); innobase_active_small();
if (UNIV_UNLIKELY(share->ib_table->is_corrupt)) { if (share->ib_table != prebuilt->table) {
fprintf(stderr,
"InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.",
share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
}
if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
DBUG_RETURN(HA_ERR_CRASHED); DBUG_RETURN(HA_ERR_CRASHED);
} }
...@@ -8131,7 +8143,13 @@ ha_innobase::update_row( ...@@ -8131,7 +8143,13 @@ ha_innobase::update_row(
ha_statistic_increment(&SSV::ha_update_count); ha_statistic_increment(&SSV::ha_update_count);
if (UNIV_UNLIKELY(share->ib_table->is_corrupt)) { if (share->ib_table != prebuilt->table) {
fprintf(stderr,
"InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.",
share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
}
if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
DBUG_RETURN(HA_ERR_CRASHED); DBUG_RETURN(HA_ERR_CRASHED);
} }
...@@ -8228,7 +8246,13 @@ func_exit: ...@@ -8228,7 +8246,13 @@ func_exit:
innobase_active_small(); innobase_active_small();
if (UNIV_UNLIKELY(share->ib_table->is_corrupt)) { if (share->ib_table != prebuilt->table) {
fprintf(stderr,
"InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.",
share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
}
if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
DBUG_RETURN(HA_ERR_CRASHED); DBUG_RETURN(HA_ERR_CRASHED);
} }
...@@ -11097,7 +11121,13 @@ ha_innobase::truncate() ...@@ -11097,7 +11121,13 @@ ha_innobase::truncate()
update_thd(ha_thd()); update_thd(ha_thd());
if (UNIV_UNLIKELY(share->ib_table->is_corrupt)) { if (share->ib_table != prebuilt->table) {
fprintf(stderr,
"InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.",
share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
}
if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
DBUG_RETURN(HA_ERR_CRASHED); DBUG_RETURN(HA_ERR_CRASHED);
} }
...@@ -11112,7 +11142,13 @@ ha_innobase::truncate() ...@@ -11112,7 +11142,13 @@ ha_innobase::truncate()
err = row_truncate_table_for_mysql(prebuilt->table, prebuilt->trx); err = row_truncate_table_for_mysql(prebuilt->table, prebuilt->trx);
if (UNIV_UNLIKELY(share->ib_table->is_corrupt)) { if (share->ib_table != prebuilt->table) {
fprintf(stderr,
"InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.",
share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
}
if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
DBUG_RETURN(HA_ERR_CRASHED); DBUG_RETURN(HA_ERR_CRASHED);
} }
...@@ -12407,7 +12443,13 @@ ha_innobase::analyze( ...@@ -12407,7 +12443,13 @@ ha_innobase::analyze(
{ {
int ret; int ret;
if (UNIV_UNLIKELY(share->ib_table->is_corrupt)) { if (share->ib_table != prebuilt->table) {
fprintf(stderr,
"InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.",
share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
}
if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
return(HA_ADMIN_CORRUPT); return(HA_ADMIN_CORRUPT);
} }
...@@ -12417,7 +12459,13 @@ ha_innobase::analyze( ...@@ -12417,7 +12459,13 @@ ha_innobase::analyze(
HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE, HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE,
true /* this is ANALYZE */); true /* this is ANALYZE */);
if (UNIV_UNLIKELY(share->ib_table->is_corrupt)) { if (share->ib_table != prebuilt->table) {
fprintf(stderr,
"InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.",
share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
}
if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
return(HA_ADMIN_CORRUPT); return(HA_ADMIN_CORRUPT);
} }
...@@ -13585,7 +13633,13 @@ ha_innobase::transactional_table_lock( ...@@ -13585,7 +13633,13 @@ ha_innobase::transactional_table_lock(
update_thd(thd); update_thd(thd);
if (UNIV_UNLIKELY(share->ib_table->is_corrupt)) { if (share->ib_table != prebuilt->table) {
fprintf(stderr,
"InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.",
share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
}
if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
DBUG_RETURN(HA_ERR_CRASHED); DBUG_RETURN(HA_ERR_CRASHED);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment