~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Stewart Smith
  • Date: 2010-11-07 04:22:31 UTC
  • mto: (1911.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1912.
  • Revision ID: stewart@flamingspork.com-20101107042231-ola4sl7j0qvg58tz
fix ARCHIVE storage engine calling exit (lintian warning). Was because we were linking in libinternal into libazio, which links into archive plugin. Just link libinternal into the command line utilities.

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, 2009, 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)
947
918
 
948
919
                ret = row_raw_format_int(data, data_len, prtype,
949
920
                                         buf, buf_size, &format_in_hex);
950
 
                if (format_in_hex) {
951
 
 
952
 
                        goto format_in_hex;
953
 
                }
954
921
                break;
955
922
        case DATA_CHAR:
956
923
        case DATA_VARCHAR:
959
926
 
960
927
                ret = row_raw_format_str(data, data_len, prtype,
961
928
                                         buf, buf_size, &format_in_hex);
962
 
                if (format_in_hex) {
963
 
 
964
 
                        goto format_in_hex;
965
 
                }
966
 
 
967
929
                break;
968
930
        /* XXX support more data types */
969
931
        default:
970
 
        format_in_hex:
 
932
 
 
933
                format_in_hex = TRUE;
 
934
        }
 
935
 
 
936
        if (format_in_hex) {
971
937
 
972
938
                if (UNIV_LIKELY(buf_size > 2)) {
973
939