diff options
author | heikki@hundin.mysql.fi <> | 2004-02-27 16:54:16 +0200 |
---|---|---|
committer | heikki@hundin.mysql.fi <> | 2004-02-27 16:54:16 +0200 |
commit | 86932a0b79cb2866fee4f70388d52ff7076ac7f4 (patch) | |
tree | 947e0f0a329033ed12fc67308707a8d84e8211b5 /innobase | |
parent | 3d750efcb1dc3566df708261b61e8f55b8a46b56 (diff) | |
download | mariadb-git-86932a0b79cb2866fee4f70388d52ff7076ac7f4.tar.gz |
row0upd.c:
Fix bug: in a FOREIGN KEY, ON UPDATE CASCADE was not triggered if the update changed a string to another value identical in alphabetical ordering, e.g., abc -> aBc
Diffstat (limited to 'innobase')
-rw-r--r-- | innobase/row/row0upd.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/innobase/row/row0upd.c b/innobase/row/row0upd.c index e3725c8b39e..ae373dfc621 100644 --- a/innobase/row/row0upd.c +++ b/innobase/row/row0upd.c @@ -77,8 +77,8 @@ index record. This is only used in foreign key checks and we can assume that index does not contain column prefixes. */ static ibool -row_upd_changes_first_fields( -/*=========================*/ +row_upd_changes_first_fields_binary( +/*================================*/ /* out: TRUE if changes */ dtuple_t* entry, /* in: old value of index entry */ dict_index_t* index, /* in: index of entry */ @@ -196,7 +196,7 @@ row_upd_check_references_constraints( if (foreign->referenced_index == index && (node->is_delete - || row_upd_changes_first_fields(entry, index, + || row_upd_changes_first_fields_binary(entry, index, node->update, foreign->n_fields))) { if (foreign->foreign_table == NULL) { @@ -1048,8 +1048,8 @@ index record. This is only used in foreign key checks and we can assume that index does not contain column prefixes. */ static ibool -row_upd_changes_first_fields( -/*=========================*/ +row_upd_changes_first_fields_binary( +/*================================*/ /* out: TRUE if changes */ dtuple_t* entry, /* in: index entry */ dict_index_t* index, /* in: index of entry */ @@ -1074,15 +1074,16 @@ row_upd_changes_first_fields( col = dict_field_get_col(ind_field); col_pos = dict_col_get_clust_pos(col); + ut_a(ind_field->prefix_len == 0); + for (j = 0; j < n_upd_fields; j++) { upd_field = upd_get_nth_field(update, j); if (col_pos == upd_field->field_no - && (ind_field->prefix_len > 0 - || 0 != cmp_dfield_dfield( + && !dfield_datas_are_binary_equal( dtuple_get_nth_field(entry, i), - &(upd_field->new_val)))) { + &(upd_field->new_val))) { return(TRUE); } } |