1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

References:

https://bugs.launchpad.net/codership-mysql/+bug/1084702
  https://bugs.launchpad.net/percona-xtradb-cluster/+bug/1019473

Merged revisions 3851-3852 from lp:~codership/codership-mysql/5.5-23
This commit is contained in:
Seppo Jaakola
2013-02-26 22:19:54 +02:00
parent 2b0f16c577
commit 518ced3a78
3 changed files with 63 additions and 48 deletions

View File

@ -3452,8 +3452,9 @@ end_with_restore_list:
#ifdef WITH_WSREP
for (TABLE_LIST *table= all_tables; table; table= table->next_global)
{
if (!thd->is_current_stmt_binlog_format_row() ||
!find_temporary_table(thd, table))
if (!lex->drop_temporary &&
(!thd->is_current_stmt_binlog_format_row() ||
!find_temporary_table(thd, table)))
{
WSREP_TO_ISOLATION_BEGIN(NULL, NULL, all_tables);
break;

View File

@ -7358,6 +7358,8 @@ ha_innobase::wsrep_append_keys(
const uchar* record1) /* in: row in MySQL format */
{
DBUG_ENTER("wsrep_append_keys");
bool key_appended = false;
trx_t *trx = thd_to_trx(thd);
if (table_share && table_share->tmp_table != NO_TMP_TABLE) {
@ -7369,29 +7371,6 @@ ha_innobase::wsrep_append_keys(
DBUG_RETURN(0);
}
/* if no PK, calculate hash of full row, to be the key value */
if (prebuilt->clust_index_was_generated && wsrep_certify_nonPK) {
uchar digest[16];
int rcode;
wsrep_calc_row_hash(digest, record0, table, prebuilt, thd);
if ((rcode = wsrep_append_key(thd, trx, table_share, table,
(const char*) digest, 16,
shared))) {
DBUG_RETURN(rcode);
}
if (record1) {
wsrep_calc_row_hash(digest, record1, table, prebuilt, thd);
if ((rcode = wsrep_append_key(thd, trx, table_share,
table,
(const char*) digest,
16, shared))) {
DBUG_RETURN(rcode);
}
}
DBUG_RETURN(0);
}
if (wsrep_protocol_version == 0) {
uint len;
char keyval[WSREP_MAX_SUPPORTED_KEY_LENGTH+1] = {'\0'};
@ -7430,6 +7409,8 @@ ha_innobase::wsrep_append_keys(
if (key_info->flags & HA_NOSAME ||
referenced_by_foreign_key()) {
if (key_info->flags & HA_NOSAME || shared)
key_appended = true;
len = wsrep_store_key_val_for_row(
table, i, key0, key_info->key_length,
@ -7460,6 +7441,32 @@ ha_innobase::wsrep_append_keys(
}
}
}
/* if no PK, calculate hash of full row, to be the key value */
if (!key_appended && wsrep_certify_nonPK) {
uchar digest[16];
int rcode;
wsrep_calc_row_hash(digest, record0, table, prebuilt, thd);
if ((rcode = wsrep_append_key(thd, trx, table_share, table,
(const char*) digest, 16,
shared))) {
DBUG_RETURN(rcode);
}
if (record1) {
wsrep_calc_row_hash(
digest, record1, table, prebuilt, thd);
if ((rcode = wsrep_append_key(thd, trx, table_share,
table,
(const char*) digest,
16, shared))) {
DBUG_RETURN(rcode);
}
}
DBUG_RETURN(0);
}
DBUG_RETURN(0);
}
#endif

View File

@ -8274,6 +8274,8 @@ ha_innobase::wsrep_append_keys(
const uchar* record1) /* in: row in MySQL format */
{
DBUG_ENTER("wsrep_append_keys");
bool key_appended = false;
trx_t *trx = thd_to_trx(thd);
if (table_share && table_share->tmp_table != NO_TMP_TABLE) {
@ -8285,29 +8287,6 @@ ha_innobase::wsrep_append_keys(
DBUG_RETURN(0);
}
/* if no PK, calculate hash of full row, to be the key value */
if (prebuilt->clust_index_was_generated && wsrep_certify_nonPK) {
uchar digest[16];
int rcode;
wsrep_calc_row_hash(digest, record0, table, prebuilt, thd);
if ((rcode = wsrep_append_key(thd, trx, table_share, table,
(const char*) digest, 16,
shared))) {
DBUG_RETURN(rcode);
}
if (record1) {
wsrep_calc_row_hash(digest, record1, table, prebuilt, thd);
if ((rcode = wsrep_append_key(thd, trx, table_share,
table,
(const char*) digest,
16, shared))) {
DBUG_RETURN(rcode);
}
}
DBUG_RETURN(0);
}
if (wsrep_protocol_version == 0) {
uint len;
char keyval[WSREP_MAX_SUPPORTED_KEY_LENGTH+1] = {'\0'};
@ -8346,6 +8325,8 @@ ha_innobase::wsrep_append_keys(
if (key_info->flags & HA_NOSAME ||
referenced_by_foreign_key()) {
if (key_info->flags & HA_NOSAME || shared)
key_appended = true;
len = wsrep_store_key_val_for_row(
table, i, key0, key_info->key_length,
@ -8376,6 +8357,32 @@ ha_innobase::wsrep_append_keys(
}
}
}
/* if no PK, calculate hash of full row, to be the key value */
if (!key_appended && wsrep_certify_nonPK) {
uchar digest[16];
int rcode;
wsrep_calc_row_hash(digest, record0, table, prebuilt, thd);
if ((rcode = wsrep_append_key(thd, trx, table_share, table,
(const char*) digest, 16,
shared))) {
DBUG_RETURN(rcode);
}
if (record1) {
wsrep_calc_row_hash(
digest, record1, table, prebuilt, thd);
if ((rcode = wsrep_append_key(thd, trx, table_share,
table,
(const char*) digest,
16, shared))) {
DBUG_RETURN(rcode);
}
}
DBUG_RETURN(0);
}
DBUG_RETURN(0);
}
#endif