~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Brian Aker
  • Date: 2010-12-27 20:04:50 UTC
  • mto: (2060.2.1 clean)
  • mto: This revision was merged to the branch mainline in revision 2063.
  • Revision ID: brian@tangent.org-20101227200450-dmxpemwyfmlinlnm
Merge in first pass.

Show diffs side-by-side

added added

removed removed

Lines of Context:
659
659
 
660
660
        heap = mem_heap_create(sizeof *prebuilt + 128);
661
661
 
662
 
        prebuilt = static_cast<row_prebuilt_t *>(mem_heap_zalloc(heap, sizeof *prebuilt));
 
662
        prebuilt = mem_heap_zalloc(heap, sizeof *prebuilt);
663
663
 
664
664
        prebuilt->magic_n = ROW_PREBUILT_ALLOCATED;
665
665
        prebuilt->magic_n2 = ROW_PREBUILT_ALLOCATED;
869
869
                prebuilt->ins_node = node;
870
870
 
871
871
                if (prebuilt->ins_upd_rec_buff == NULL) {
872
 
                        prebuilt->ins_upd_rec_buff = static_cast<byte *>(mem_heap_alloc(
873
 
                                prebuilt->heap, prebuilt->mysql_row_len));
 
872
                        prebuilt->ins_upd_rec_buff = mem_heap_alloc(
 
873
                                prebuilt->heap, prebuilt->mysql_row_len);
874
874
                }
875
875
 
876
876
                row = dtuple_create(prebuilt->heap,
880
880
 
881
881
                ins_node_set_new_row(node, row);
882
882
 
883
 
                prebuilt->ins_graph = static_cast<que_fork_t *>(que_node_get_parent(
 
883
                prebuilt->ins_graph = que_node_get_parent(
884
884
                        pars_complete_graph_for_exec(node,
885
885
                                                     prebuilt->trx,
886
 
                                                     prebuilt->heap)));
 
886
                                                     prebuilt->heap));
887
887
                prebuilt->ins_graph->state = QUE_FORK_ACTIVE;
888
888
        }
889
889
 
1066
1066
        trx_start_if_not_started(trx);
1067
1067
 
1068
1068
        if (table) {
1069
 
                err = lock_table(0, table, static_cast<lock_mode>(mode), thr);
 
1069
                err = lock_table(0, table, mode, thr);
1070
1070
        } else {
1071
1071
                err = lock_table(0, prebuilt->table,
1072
 
                                 static_cast<lock_mode>(prebuilt->select_lock_type), thr);
 
1072
                                 prebuilt->select_lock_type, thr);
1073
1073
        }
1074
1074
 
1075
1075
        trx->error_state = err;
1244
1244
 
1245
1245
                node = sel_node_create(prebuilt->heap);
1246
1246
 
1247
 
                prebuilt->sel_graph = static_cast<que_fork_t *>(que_node_get_parent(
 
1247
                prebuilt->sel_graph = que_node_get_parent(
1248
1248
                        pars_complete_graph_for_exec(node,
1249
1249
                                                     prebuilt->trx,
1250
 
                                                     prebuilt->heap)));
 
1250
                                                     prebuilt->heap));
1251
1251
 
1252
1252
                prebuilt->sel_graph->state = QUE_FORK_ACTIVE;
1253
1253
        }
1315
1315
 
1316
1316
                prebuilt->upd_node = node;
1317
1317
 
1318
 
                prebuilt->upd_graph = static_cast<que_fork_t *>(que_node_get_parent(
 
1318
                prebuilt->upd_graph = que_node_get_parent(
1319
1319
                        pars_complete_graph_for_exec(node,
1320
1320
                                                     prebuilt->trx,
1321
 
                                                     prebuilt->heap)));
 
1321
                                                     prebuilt->heap));
1322
1322
                prebuilt->upd_graph->state = QUE_FORK_ACTIVE;
1323
1323
        }
1324
1324
 
1605
1605
                        index = btr_pcur_get_btr_cur(pcur)->index;
1606
1606
 
1607
1607
                        lock_rec_unlock(trx, btr_pcur_get_block(pcur),
1608
 
                                        rec, static_cast<lock_mode>(prebuilt->select_lock_type));
 
1608
                                        rec, prebuilt->select_lock_type);
1609
1609
 
1610
1610
                        if (prebuilt->new_rec_locks >= 2) {
1611
1611
                                rec = btr_pcur_get_rec(clust_pcur);
1614
1614
                                lock_rec_unlock(trx,
1615
1615
                                                btr_pcur_get_block(clust_pcur),
1616
1616
                                                rec,
1617
 
                                                static_cast<lock_mode>(prebuilt->select_lock_type));
 
1617
                                                prebuilt->select_lock_type);
1618
1618
                        }
1619
1619
                }
1620
1620
no_unlock:
1912
1912
 
1913
1913
        thr = pars_complete_graph_for_exec(node, trx, heap);
1914
1914
 
1915
 
        ut_a(thr == que_fork_start_command(static_cast<que_fork_t *>(que_node_get_parent(thr))));
 
1915
        ut_a(thr == que_fork_start_command(que_node_get_parent(thr)));
1916
1916
        que_run_threads(thr);
1917
1917
 
1918
1918
        err = trx->error_state;
2053
2053
 
2054
2054
        thr = pars_complete_graph_for_exec(node, trx, heap);
2055
2055
 
2056
 
        ut_a(thr == que_fork_start_command(static_cast<que_fork_t *>(que_node_get_parent(thr))));
 
2056
        ut_a(thr == que_fork_start_command(que_node_get_parent(thr)));
2057
2057
        que_run_threads(thr);
2058
2058
 
2059
2059
        err = trx->error_state;
2326
2326
                drop = UT_LIST_GET_NEXT(row_mysql_drop_list, drop);
2327
2327
        }
2328
2328
 
2329
 
        drop = static_cast<row_mysql_drop_t *>(mem_alloc(sizeof(row_mysql_drop_t)));
 
2329
        drop = mem_alloc(sizeof(row_mysql_drop_t));
2330
2330
 
2331
2331
        drop->table_name = mem_strdup(name);
2332
2332
 
2887
2887
        tuple = dtuple_create(heap, 1);
2888
2888
        dfield = dtuple_get_nth_field(tuple, 0);
2889
2889
 
2890
 
        buf = static_cast<byte *>(mem_heap_alloc(heap, 8));
 
2890
        buf = mem_heap_alloc(heap, 8);
2891
2891
        mach_write_to_8(buf, table->id);
2892
2892
 
2893
2893
        dfield_set_data(dfield, buf, 8);
3213
3213
 
3214
3214
        if (table->n_foreign_key_checks_running > 0) {
3215
3215
 
3216
 
                const char*     i_table_name = table->name;
 
3216
                const char*     table_name = table->name;
3217
3217
                ibool           added;
3218
3218
 
3219
 
                added = row_add_table_to_background_drop_list(i_table_name);
 
3219
                added = row_add_table_to_background_drop_list(table_name);
3220
3220
 
3221
3221
                if (added) {
3222
3222
                        ut_print_timestamp(stderr);
3223
3223
                        fputs("  InnoDB: You are trying to drop table ",
3224
3224
                              stderr);
3225
 
                        ut_print_name(stderr, trx, TRUE, i_table_name);
 
3225
                        ut_print_name(stderr, trx, TRUE, table_name);
3226
3226
                        fputs("\n"
3227
3227
                              "InnoDB: though there is a"
3228
3228
                              " foreign key check running on it.\n"
4095
4095
 
4096
4096
        *n_rows = 0;
4097
4097
 
4098
 
        buf = static_cast<byte *>(mem_alloc(UNIV_PAGE_SIZE));
 
4098
        buf = mem_alloc(UNIV_PAGE_SIZE);
4099
4099
        heap = mem_heap_create(100);
4100
4100
 
4101
4101
        cnt = 1000;
4196
4196
                                * sizeof *offsets;
4197
4197
 
4198
4198
                        tmp_heap = mem_heap_create(size);
4199
 
                        offsets = static_cast<ulint *>(mem_heap_dup(tmp_heap, offsets, size));
 
4199
                        offsets = mem_heap_dup(tmp_heap, offsets, size);
4200
4200
                }
4201
4201
 
4202
4202
                mem_heap_empty(heap);