summaryrefslogtreecommitdiff
path: root/innobase/btr
diff options
context:
space:
mode:
authorheikki@hundin.mysql.fi <>2003-07-22 02:44:55 +0300
committerheikki@hundin.mysql.fi <>2003-07-22 02:44:55 +0300
commit8e96f029831fdefa4b6f2fd121cdf8609dd85b3a (patch)
tree91371cbd854211b4b2403c82a97aaebad3e2af54 /innobase/btr
parent7a646f305c2259b812588a6131de50a57cf5d083 (diff)
downloadmariadb-git-8e96f029831fdefa4b6f2fd121cdf8609dd85b3a.tar.gz
btr0cur.c:
Fix bug reported by Dyego Souza do Carmo: if a row becomes too long, > 8000 bytes, in an update, then InnoDB simply removes the clustered index record and does not report of table handler error 139
Diffstat (limited to 'innobase/btr')
-rw-r--r--innobase/btr/btr0cur.c42
1 files changed, 22 insertions, 20 deletions
diff --git a/innobase/btr/btr0cur.c b/innobase/btr/btr0cur.c
index 8402993e971..c0fc9566c80 100644
--- a/innobase/btr/btr0cur.c
+++ b/innobase/btr/btr0cur.c
@@ -1784,6 +1784,28 @@ btr_cur_pessimistic_update(
trx->id);
}
+ /* We have to set appropriate extern storage bits in the new
+ record to be inserted: we have to remember which fields were such */
+
+ ext_vect = mem_heap_alloc(heap, sizeof(ulint) * rec_get_n_fields(rec));
+ n_ext_vect = btr_push_update_extern_fields(ext_vect, rec, update);
+
+ if ((rec_get_converted_size(new_entry) >=
+ page_get_free_space_of_empty() / 2)
+ || (rec_get_converted_size(new_entry) >= REC_MAX_DATA_SIZE)) {
+
+ big_rec_vec = dtuple_convert_big_rec(index, new_entry,
+ ext_vect, n_ext_vect);
+ if (big_rec_vec == NULL) {
+
+ mem_heap_free(heap);
+
+ err = DB_TOO_BIG_RECORD;
+
+ goto return_after_reservations;
+ }
+ }
+
page_cursor = btr_cur_get_page_cur(cursor);
/* Store state of explicit locks on rec on the page infimum record,
@@ -1813,30 +1835,10 @@ btr_cur_pessimistic_update(
TRUE, mtr);
}
- /* We have to set appropriate extern storage bits in the new
- record to be inserted: we have to remember which fields were such */
-
- ext_vect = mem_heap_alloc(heap, sizeof(ulint) * rec_get_n_fields(rec));
- n_ext_vect = btr_push_update_extern_fields(ext_vect, rec, update);
-
page_cur_delete_rec(page_cursor, mtr);
page_cur_move_to_prev(page_cursor);
- if ((rec_get_converted_size(new_entry) >=
- page_get_free_space_of_empty() / 2)
- || (rec_get_converted_size(new_entry) >= REC_MAX_DATA_SIZE)) {
-
- big_rec_vec = dtuple_convert_big_rec(index, new_entry,
- ext_vect, n_ext_vect);
- if (big_rec_vec == NULL) {
-
- mem_heap_free(heap);
-
- goto return_after_reservations;
- }
- }
-
rec = btr_cur_insert_if_possible(cursor, new_entry,
&dummy_reorganized, mtr);
ut_a(rec || optim_err != DB_UNDERFLOW);