summaryrefslogtreecommitdiff
path: root/storage/maria/ma_search.c
diff options
context:
space:
mode:
authorMichael Widenius <monty@mysql.com>2008-08-24 16:29:34 +0300
committerMichael Widenius <monty@mysql.com>2008-08-24 16:29:34 +0300
commitd145362edf0c6c640b46eb08db18e2781d128075 (patch)
treef829b8540ad6517c6641c38210a4ca3717c7a63d /storage/maria/ma_search.c
parent57e0bdb30672ff576cb91aa3d16a75c0fbce40d0 (diff)
downloadmariadb-git-d145362edf0c6c640b46eb08db18e2781d128075.tar.gz
Fix for bug#38484 DELETE causes crash or index corruption
There is no test cases as it's not trivial to do a test case for this. The new code for Maria is however executed by the test case in the bug report. mysql-test/mysql-test-run.pl: Avoid warnings when running with --extern storage/maria/ha_maria.cc: Disable not complete assert until Sanja can push a proper fix storage/maria/ma_delete.c: Fix that pageflag for page is calculated based on original values storage/maria/ma_search.c: Ensure that prev_length structure variable is properly reset when not used storage/myisam/mi_search.c: Ensure that prev_length structure variable is properly reset when not used
Diffstat (limited to 'storage/maria/ma_search.c')
-rw-r--r--storage/maria/ma_search.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/storage/maria/ma_search.c b/storage/maria/ma_search.c
index 8b0c0426f1b..cf7ec5f9724 100644
--- a/storage/maria/ma_search.c
+++ b/storage/maria/ma_search.c
@@ -2194,9 +2194,10 @@ int _ma_calc_bin_pack_key_length(const MARIA_KEY *int_key,
if (next_length > ref_length)
{
- /* We put a key with different case between two keys with the same prefix
- Extend next key to have same prefix as
- this key */
+ /*
+ We put a key with different case between two keys with the same prefix
+ Extend next key to have same prefix as this key
+ */
s_temp->n_ref_length= ref_length;
s_temp->prev_length= next_length-ref_length;
s_temp->prev_key+= ref_length;
@@ -2206,13 +2207,13 @@ int _ma_calc_bin_pack_key_length(const MARIA_KEY *int_key,
}
/* Check how many characters are identical to next key */
key= s_temp->key+next_length;
+ s_temp->prev_length= 0;
while (*key++ == *next_key++) ;
if ((ref_length= (uint) (key - s_temp->key)-1) == next_length)
{
s_temp->next_key_pos=0;
return (s_temp->move_length= length); /* Can't pack next key */
}
- s_temp->prev_length=0;
s_temp->n_ref_length=ref_length;
return s_temp->move_length= (int) (length-(ref_length - next_length) -
next_length_pack +