~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/data/data0data.c

  • Committer: Lee Bieber
  • Date: 2010-12-23 23:11:00 UTC
  • mfrom: (2024.1.1 clean)
  • Revision ID: kalebral@gmail.com-20101223231100-0rqirgz7ugkl10yp
Merge Brian - session list cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
306
306
/*=========*/
307
307
        const dfield_t* dfield) /*!< in: dfield */
308
308
{
 
309
        const byte*     data;
 
310
        ulint           len;
309
311
        ulint           i;
310
312
 
311
 
        ulint len = dfield_get_len(dfield);
312
 
        const byte *data = static_cast<const byte *>(dfield_get_data(dfield));
 
313
        len = dfield_get_len(dfield);
 
314
        data = dfield_get_data(dfield);
313
315
 
314
316
        if (dfield_is_null(dfield)) {
315
317
                fputs("NULL", stderr);
354
356
        ibool           print_also_hex;
355
357
 
356
358
        len = dfield_get_len(dfield);
357
 
        data = static_cast<const byte *>(dfield_get_data(dfield));
 
359
        data = dfield_get_data(dfield);
358
360
 
359
361
        if (dfield_is_null(dfield)) {
360
362
                fputs("NULL", stderr);
364
366
 
365
367
        prtype = dtype_get_prtype(dfield_get_type(dfield));
366
368
 
367
 
        ib_id_t id= 0;
368
 
        ulint val= 0;
369
 
        static const ulint UNSIGNED_MASK= 0x80000000;
370
 
 
371
369
        switch (dtype_get_mtype(dfield_get_type(dfield))) {
 
370
                ib_id_t id;
372
371
        case DATA_INT:
373
372
                switch (len) {
 
373
                        ulint   val;
374
374
                case 1:
375
375
                        val = mach_read_from_1(data);
376
376
 
407
407
                case 4:
408
408
                        val = mach_read_from_4(data);
409
409
 
 
410
                        static const ulint UNSIGNED_MASK= 0x80000000;
 
411
 
410
412
                        if (!(prtype & DATA_UNSIGNED)) {
411
413
                                val &= ~UNSIGNED_MASK;
412
414
                                fprintf(stderr, "%ld", (long) val);
484
486
                        break;
485
487
                }
486
488
 
487
 
                data = static_cast<const byte *>(dfield_get_data(dfield));
 
489
                data = dfield_get_data(dfield);
488
490
                /* fall through */
489
491
 
490
492
        case DATA_BINARY:
607
609
        heap = mem_heap_create(size + dtuple_get_n_fields(entry)
608
610
                               * sizeof(big_rec_field_t) + 1000);
609
611
 
610
 
        vector = static_cast<big_rec_t *>(mem_heap_alloc(heap, sizeof(big_rec_t)));
 
612
        vector = mem_heap_alloc(heap, sizeof(big_rec_t));
611
613
 
612
614
        vector->heap = heap;
613
 
        vector->fields = static_cast<big_rec_field_t *>(mem_heap_alloc(heap, dtuple_get_n_fields(entry)
614
 
                                        * sizeof(big_rec_field_t)));
 
615
        vector->fields = mem_heap_alloc(heap, dtuple_get_n_fields(entry)
 
616
                                        * sizeof(big_rec_field_t));
615
617
 
616
618
        /* Decide which fields to shorten: the algorithm is to look for
617
619
        a variable-length field that yields the biggest savings when
732
734
                b->data = (char*) dfield_get_data(dfield) + local_prefix_len;
733
735
 
734
736
                /* Allocate the locally stored part of the column. */
735
 
                data = static_cast<unsigned char *>(mem_heap_alloc(heap, local_len));
 
737
                data = mem_heap_alloc(heap, local_len);
736
738
 
737
739
                /* Copy the local prefix. */
738
740
                memcpy(data, dfield_get_data(dfield), local_prefix_len);
767
769
void
768
770
dtuple_convert_back_big_rec(
769
771
/*========================*/
770
 
        dict_index_t*   /*index __attribute__((unused))*/,      /*!< in: index */
 
772
        dict_index_t*   index __attribute__((unused)),  /*!< in: index */
771
773
        dtuple_t*       entry,  /*!< in: entry whose data was put to vector */
772
774
        big_rec_t*      vector) /*!< in, own: big rec vector; it is
773
775
                                freed in this function */