~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/row/row0row.c

  • Committer: Lee Bieber
  • Date: 2010-11-14 23:15:42 UTC
  • mfrom: (1929.1.42 warning-stack-frame)
  • Revision ID: kalebral@gmail.com-20101114231542-fnnu6ydd2p17n582
Merge Monty - fix bug 672372: some functions use > 32k stack

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (C) 1996, 2010, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved.
4
4
 
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
55
55
ulint
56
56
row_get_trx_id_offset(
57
57
/*==================*/
58
 
        const rec_t*    /*rec __attribute__((unused))*/,
 
58
        const rec_t*    rec __attribute__((unused)),
59
59
                                /*!< in: record */
60
60
        dict_index_t*   index,  /*!< in: clustered index */
61
61
        const ulint*    offsets)/*!< in: rec_get_offsets(rec, index) */
156
156
                }
157
157
 
158
158
                len = dtype_get_at_most_n_mbchars(
159
 
                        col->prtype, col->mbminmaxlen,
160
 
                        ind_field->prefix_len, len, static_cast<const char *>(dfield_get_data(dfield)));
 
159
                        col->prtype, col->mbminlen, col->mbmaxlen,
 
160
                        ind_field->prefix_len, len, dfield_get_data(dfield));
161
161
                dfield_set_len(dfield, len);
162
162
        }
163
163
 
233
233
 
234
234
        if (type != ROW_COPY_POINTERS) {
235
235
                /* Take a copy of rec to heap */
236
 
                buf = static_cast<byte *>(mem_heap_alloc(heap, rec_offs_size(offsets)));
 
236
                buf = mem_heap_alloc(heap, rec_offs_size(offsets));
237
237
                rec = rec_copy(buf, rec, offsets);
238
238
                /* Avoid a debug assertion in rec_offs_validate(). */
239
239
                rec_offs_make_valid(rec, index, (ulint*) offsets);
252
252
        n_fields = rec_offs_n_fields(offsets);
253
253
        n_ext_cols = rec_offs_n_extern(offsets);
254
254
        if (n_ext_cols) {
255
 
                ext_cols = static_cast<ulint *>(mem_heap_alloc(heap, n_ext_cols * sizeof *ext_cols));
 
255
                ext_cols = mem_heap_alloc(heap, n_ext_cols * sizeof *ext_cols);
256
256
        }
257
257
 
258
258
        for (i = j = 0; i < n_fields; i++) {
294
294
 
295
295
        ut_ad(dtuple_check_typed(row));
296
296
 
297
 
        if (!ext) {
298
 
                /* REDUNDANT and COMPACT formats store a local
299
 
                768-byte prefix of each externally stored
300
 
                column. No cache is needed. */
301
 
                ut_ad(dict_table_get_format(index->table)
302
 
                      < DICT_TF_FORMAT_ZIP);
303
 
        } else if (j) {
 
297
        if (j) {
304
298
                *ext = row_ext_create(j, ext_cols, row,
305
299
                                      dict_table_zip_size(index->table),
306
300
                                      heap);
411
405
 
412
406
        if (type == ROW_COPY_DATA) {
413
407
                /* Take a copy of rec to heap */
414
 
                buf = static_cast<byte *>(mem_heap_alloc(heap, rec_offs_size(offsets)));
 
408
                buf = mem_heap_alloc(heap, rec_offs_size(offsets));
415
409
                rec = rec_copy(buf, rec, offsets);
416
410
                /* Avoid a debug assertion in rec_offs_validate(). */
417
411
                rec_offs_make_valid(rec, index, offsets);
475
469
        if (type == ROW_COPY_DATA) {
476
470
                /* Take a copy of rec to heap */
477
471
 
478
 
                buf = static_cast<byte *>(mem_heap_alloc(heap, rec_offs_size(offsets)));
 
472
                buf = mem_heap_alloc(heap, rec_offs_size(offsets));
479
473
 
480
474
                rec = rec_copy(buf, rec, offsets);
481
475
                /* Avoid a debug assertion in rec_offs_validate(). */
520
514
                                dfield_set_len(dfield,
521
515
                                               dtype_get_at_most_n_mbchars(
522
516
                                                       dtype->prtype,
523
 
                                                       dtype->mbminmaxlen,
 
517
                                                       dtype->mbminlen,
 
518
                                                       dtype->mbmaxlen,
524
519
                                                       clust_col_prefix_len,
525
520
                                                       len, (char*) field));
526
521
                        }
634
629
                                dfield_set_len(dfield,
635
630
                                               dtype_get_at_most_n_mbchars(
636
631
                                                       dtype->prtype,
637
 
                                                       dtype->mbminmaxlen,
 
632
                                                       dtype->mbminlen,
 
633
                                                       dtype->mbmaxlen,
638
634
                                                       clust_col_prefix_len,
639
635
                                                       len, (char*) field));
640
636
                        }
734
730
 
735
731
/***************************************************************//**
736
732
Searches an index record.
737
 
@return whether the record was found or buffered */
 
733
@return TRUE if found */
738
734
UNIV_INTERN
739
 
enum row_search_result
 
735
ibool
740
736
row_search_index_entry(
741
737
/*===================*/
742
738
        dict_index_t*   index,  /*!< in: index */
753
749
        ut_ad(dtuple_check_typed(entry));
754
750
 
755
751
        btr_pcur_open(index, entry, PAGE_CUR_LE, mode, pcur, mtr);
756
 
 
757
 
        switch (btr_pcur_get_btr_cur(pcur)->flag) {
758
 
        case BTR_CUR_DELETE_REF:
759
 
                ut_a(mode & BTR_DELETE);
760
 
                return(ROW_NOT_DELETED_REF);
761
 
 
762
 
        case BTR_CUR_DEL_MARK_IBUF:
763
 
        case BTR_CUR_DELETE_IBUF:
764
 
        case BTR_CUR_INSERT_TO_IBUF:
765
 
                return(ROW_BUFFERED);
766
 
 
767
 
        case BTR_CUR_HASH:
768
 
        case BTR_CUR_HASH_FAIL:
769
 
        case BTR_CUR_BINARY:
770
 
                break;
771
 
        }
772
 
 
773
752
        low_match = btr_pcur_get_low_match(pcur);
774
753
 
775
754
        rec = btr_pcur_get_rec(pcur);
776
755
 
777
756
        n_fields = dtuple_get_n_fields(entry);
778
757
 
779
 
        if (page_rec_is_infimum(rec)) {
780
 
 
781
 
                return(ROW_NOT_FOUND);
782
 
        } else if (low_match != n_fields) {
783
 
 
784
 
                return(ROW_NOT_FOUND);
785
 
        }
786
 
 
787
 
        return(ROW_FOUND);
 
758
        return(!page_rec_is_infimum(rec) && low_match == n_fields);
788
759
}
789
760
 
790
761
#if !defined(BUILD_DRIZZLE)