~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/row/row0sel.cc

  • Committer: Monty Taylor
  • Date: 2010-12-26 03:15:44 UTC
  • mto: This revision was merged to the branch mainline in revision 2038.
  • Revision ID: mordred@inaugust.com-20101226031544-1cf3raipu53fnmyj
Through page.

Show diffs side-by-side

added added

removed removed

Lines of Context:
258
258
{
259
259
        sel_node_t*     node;
260
260
 
261
 
        node = static_cast<sel_node_t *>(mem_heap_alloc(heap, sizeof(sel_node_t)));
 
261
        node = mem_heap_alloc(heap, sizeof(sel_node_t));
262
262
        node->common.type = QUE_NODE_SELECT;
263
263
        node->state = SEL_NODE_OPEN;
264
264
 
338
338
                eval_node_copy_val(var->alias, exp);
339
339
 
340
340
                exp = que_node_get_next(exp);
341
 
                var = static_cast<sym_node_t *>(que_node_get_next(var));
 
341
                var = que_node_get_next(var);
342
342
        }
343
343
}
344
344
 
355
355
 
356
356
        ut_ad(node->is_aggregate);
357
357
 
358
 
        func_node = static_cast<func_node_t *>(node->select_list);
 
358
        func_node = node->select_list;
359
359
 
360
360
        while (func_node) {
361
361
                eval_node_set_int_val(func_node, 0);
362
362
 
363
 
                func_node = static_cast<func_node_t *>(que_node_get_next(func_node));
 
363
                func_node = que_node_get_next(func_node);
364
364
        }
365
365
 
366
366
        node->aggregate_already_fetched = FALSE;
486
486
 
487
487
        ut_ad(que_node_get_type(column) == QUE_NODE_SYMBOL);
488
488
 
489
 
        column->prefetch_buf = static_cast<sel_buf_t *>(mem_alloc(SEL_MAX_N_PREFETCH
490
 
                                                                  * sizeof(sel_buf_t)));
 
489
        column->prefetch_buf = mem_alloc(SEL_MAX_N_PREFETCH
 
490
                                         * sizeof(sel_buf_t));
491
491
        for (i = 0; i < SEL_MAX_N_PREFETCH; i++) {
492
492
                sel_buf = column->prefetch_buf + i;
493
493
 
566
566
                column values to be able to free it later: therefore
567
567
                we swap the values for sel_buf and val */
568
568
 
569
 
                sel_buf->data = static_cast<byte *>(dfield_get_data(val));
 
569
                sel_buf->data = dfield_get_data(val);
570
570
                sel_buf->len = dfield_get_len(val);
571
571
                sel_buf->val_buf_size = que_node_get_val_buf_size(column);
572
572
 
634
634
 
635
635
                val = que_node_get_val(column);
636
636
 
637
 
                data = static_cast<byte *>(dfield_get_data(val));
 
637
                data = dfield_get_data(val);
638
638
                len = dfield_get_len(val);
639
639
                val_buf_size = que_node_get_val_buf_size(column);
640
640
 
746
746
                /* Evaluate the left side of the comparison, i.e., get the
747
747
                column value if there is an indirection */
748
748
 
749
 
          eval_sym(static_cast<sym_node_t *>(cond->args));
 
749
                eval_sym(cond->args);
750
750
 
751
751
                /* Do the comparison */
752
752
 
882
882
                err = lock_clust_rec_read_check_and_lock(
883
883
                        0, btr_pcur_get_block(&plan->clust_pcur),
884
884
                        clust_rec, index, offsets,
885
 
                        static_cast<lock_mode>(node->row_lock_mode), lock_type, thr);
 
885
                        node->row_lock_mode, lock_type, thr);
886
886
 
887
887
                switch (err) {
888
888
                case DB_SUCCESS:
989
989
        }
990
990
 
991
991
        if (dict_index_is_clust(index)) {
992
 
                err = lock_clust_rec_read_check_and_lock(0, block, rec, index,
993
 
                                                         offsets, static_cast<lock_mode>(mode), type, thr);
 
992
                err = lock_clust_rec_read_check_and_lock(
 
993
                        0, block, rec, index, offsets, mode, type, thr);
994
994
        } else {
995
 
                err = lock_sec_rec_read_check_and_lock(0, block, rec, index,
996
 
                                                       offsets, static_cast<lock_mode>(mode), type, thr);
 
995
                err = lock_sec_rec_read_check_and_lock(
 
996
                        0, block, rec, index, offsets, mode, type, thr);
997
997
        }
998
998
 
999
999
        return(err);
2023
2023
 
2024
2024
        ut_ad(thr);
2025
2025
 
2026
 
        node = static_cast<sel_node_t *>(thr->run_node);
 
2026
        node = thr->run_node;
2027
2027
 
2028
2028
        ut_ad(que_node_get_type(node) == QUE_NODE_SELECT);
2029
2029
 
2060
2060
 
2061
2061
                        while (table_node) {
2062
2062
                                err = lock_table(0, table_node->table,
2063
 
                                                 static_cast<lock_mode>(i_lock_mode), thr);
 
2063
                                                 i_lock_mode, thr);
2064
2064
                                if (err != DB_SUCCESS) {
2065
2065
                                        thr_get_trx(thr)->error_state = err;
2066
2066
 
2067
2067
                                        return(NULL);
2068
2068
                                }
2069
2069
 
2070
 
                                table_node = static_cast<sym_node_t *>(que_node_get_next(table_node));
 
2070
                                table_node = que_node_get_next(table_node);
2071
2071
                        }
2072
2072
                }
2073
2073
 
2124
2124
 
2125
2125
        ut_ad(thr);
2126
2126
 
2127
 
        node = static_cast<fetch_node_t *>(thr->run_node);
 
2127
        node = thr->run_node;
2128
2128
        sel_node = node->cursor_def;
2129
2129
 
2130
2130
        ut_ad(que_node_get_type(node) == QUE_NODE_FETCH);
2183
2183
        void*   row,            /*!< in:  sel_node_t* */
2184
2184
        void*   user_arg)       /*!< in:  not used */
2185
2185
{
2186
 
        sel_node_t *node = static_cast<sel_node_t *>(row);
 
2186
        sel_node_t*     node = row;
2187
2187
        que_node_t*     exp;
2188
2188
        ulint           i = 0;
2189
2189
 
2232
2232
 
2233
2233
        ut_ad(thr);
2234
2234
 
2235
 
        node = static_cast<row_printf_node_t *>(thr->run_node);
 
2235
        node = thr->run_node;
2236
2236
 
2237
2237
        sel_node = node->sel_node;
2238
2238
 
2801
2801
                                                UNIV_PAGE_SIZE);
2802
2802
                                }
2803
2803
 
2804
 
                                data = static_cast<byte *>(memcpy(mem_heap_alloc(
 
2804
                                data = memcpy(mem_heap_alloc(
2805
2805
                                                prebuilt->blob_heap, len),
2806
 
                                                                  data, len));
 
2806
                                                data, len);
2807
2807
                        }
2808
2808
                }
2809
2809
 
2985
2985
                err = lock_clust_rec_read_check_and_lock(
2986
2986
                        0, btr_pcur_get_block(prebuilt->clust_pcur),
2987
2987
                        clust_rec, clust_index, *offsets,
2988
 
                        static_cast<lock_mode>(prebuilt->select_lock_type),
2989
 
                        LOCK_REC_NOT_GAP, thr);
 
2988
                        prebuilt->select_lock_type, LOCK_REC_NOT_GAP, thr);
2990
2989
                switch (err) {
2991
2990
                case DB_SUCCESS:
2992
2991
                case DB_SUCCESS_LOCKED_REC:
3010
3009
 
3011
3010
                        /* The following call returns 'offsets' associated with
3012
3011
                        'old_vers' */
3013
 
                  err = static_cast<db_err>(row_sel_build_prev_vers_for_mysql(
 
3012
                        err = row_sel_build_prev_vers_for_mysql(
3014
3013
                                trx->read_view, clust_index, prebuilt,
3015
3014
                                clust_rec, offsets, offset_heap, &old_vers,
3016
 
                                mtr));
 
3015
                                mtr);
3017
3016
 
3018
3017
                        if (err != DB_SUCCESS || old_vers == NULL) {
3019
3018
 
3234
3233
                        buffers in Linux. Put magic numbers there to help
3235
3234
                        to track a possible bug. */
3236
3235
 
3237
 
                        buf = static_cast<byte *>(mem_alloc(prebuilt->mysql_row_len + 8));
 
3236
                        buf = mem_alloc(prebuilt->mysql_row_len + 8);
3238
3237
 
3239
3238
                        prebuilt->fetch_cache[i] = buf + 4;
3240
3239