~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Brian Aker
  • Date: 2010-11-23 02:31:57 UTC
  • mto: This revision was merged to the branch mainline in revision 1948.
  • Revision ID: brian@tangent.org-20101123023157-zvh3deysismhsj64
Remove sessions table, there is not enough to make it unique at this point.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (C) 2000, 2010, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 2000, 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
249
249
}
250
250
 
251
251
/**************************************************************//**
252
 
Pad a column with spaces. */
253
 
UNIV_INTERN
254
 
void
255
 
row_mysql_pad_col(
256
 
/*==============*/
257
 
        ulint   mbminlen,       /*!< in: minimum size of a character,
258
 
                                in bytes */
259
 
        byte*   pad,            /*!< out: padded buffer */
260
 
        ulint   len)            /*!< in: number of bytes to pad */
261
 
{
262
 
        const byte*     pad_end;
263
 
 
264
 
        switch (UNIV_EXPECT(mbminlen, 1)) {
265
 
        default:
266
 
                ut_error;
267
 
        case 1:
268
 
                /* space=0x20 */
269
 
                memset(pad, 0x20, len);
270
 
                break;
271
 
        case 2:
272
 
                /* space=0x0020 */
273
 
                pad_end = pad + len;
274
 
                ut_a(!(len % 2));
275
 
                do {
276
 
                        *pad++ = 0x00;
277
 
                        *pad++ = 0x20;
278
 
                } while (pad < pad_end);
279
 
                break;
280
 
        case 4:
281
 
                /* space=0x00000020 */
282
 
                pad_end = pad + len;
283
 
                ut_a(!(len % 4));
284
 
                do {
285
 
                        *pad++ = 0x00;
286
 
                        *pad++ = 0x00;
287
 
                        *pad++ = 0x00;
288
 
                        *pad++ = 0x20;
289
 
                } while (pad < pad_end);
290
 
                break;
291
 
        }
292
 
}
293
 
 
294
 
/**************************************************************//**
295
252
Stores a non-SQL-NULL field given in the MySQL format in the InnoDB format.
296
253
The counterpart of this function is row_sel_field_store_in_mysql_format() in
297
254
row0sel.c.
383
340
                        /* Remove trailing spaces from old style VARCHAR
384
341
                        columns. */
385
342
 
386
 
                        /* Handle Unicode strings differently. */
 
343
                        /* Handle UCS2 strings differently. */
387
344
                        ulint   mbminlen        = dtype_get_mbminlen(dtype);
388
345
 
389
346
                        ptr = mysql_data;
390
347
 
391
 
                        switch (mbminlen) {
392
 
                        default:
393
 
                                ut_error;
394
 
                        case 4:
395
 
                                /* space=0x00000020 */
396
 
                                /* Trim "half-chars", just in case. */
397
 
                                col_len &= ~3;
398
 
 
399
 
                                while (col_len >= 4
400
 
                                       && ptr[col_len - 4] == 0x00
401
 
                                       && ptr[col_len - 3] == 0x00
402
 
                                       && ptr[col_len - 2] == 0x00
403
 
                                       && ptr[col_len - 1] == 0x20) {
404
 
                                        col_len -= 4;
405
 
                                }
406
 
                                break;
407
 
                        case 2:
 
348
                        if (mbminlen == 2) {
408
349
                                /* space=0x0020 */
409
350
                                /* Trim "half-chars", just in case. */
410
351
                                col_len &= ~1;
413
354
                                       && ptr[col_len - 1] == 0x20) {
414
355
                                        col_len -= 2;
415
356
                                }
416
 
                                break;
417
 
                        case 1:
 
357
                        } else {
 
358
                                ut_a(mbminlen == 1);
418
359
                                /* space=0x20 */
419
360
                                while (col_len > 0
420
361
                                       && ptr[col_len - 1] == 0x20) {
486
427
                                        row is used, as row may contain
487
428
                                        pointers to this record! */
488
429
{
489
 
        const mysql_row_templ_t*templ;
 
430
        mysql_row_templ_t*      templ;
490
431
        dfield_t*               dfield;
491
432
        ulint                   i;
492
433
 
618
559
                      "InnoDB: " REFMAN "forcing-recovery.html"
619
560
                      " for help.\n", stderr);
620
561
                break;
621
 
        case DB_FOREIGN_EXCEED_MAX_CASCADE:
622
 
                fprintf(stderr, "InnoDB: Cannot delete/update rows with"
623
 
                        " cascading foreign key constraints that exceed max"
624
 
                        " depth of %lu\n"
625
 
                        "Please drop excessive foreign constraints"
626
 
                        " and try again\n", (ulong) DICT_FK_MAX_RECURSIVE_LOAD);
627
 
                break;
628
562
        default:
629
563
                fprintf(stderr, "InnoDB: unknown error code %lu\n",
630
564
                        (ulong) err);
659
593
 
660
594
        heap = mem_heap_create(sizeof *prebuilt + 128);
661
595
 
662
 
        prebuilt = static_cast<row_prebuilt_t *>(mem_heap_zalloc(heap, sizeof *prebuilt));
 
596
        prebuilt = mem_heap_zalloc(heap, sizeof *prebuilt);
663
597
 
664
598
        prebuilt->magic_n = ROW_PREBUILT_ALLOCATED;
665
599
        prebuilt->magic_n2 = ROW_PREBUILT_ALLOCATED;
674
608
 
675
609
        prebuilt->select_lock_type = LOCK_NONE;
676
610
        prebuilt->stored_select_lock_type = 99999999;
677
 
        UNIV_MEM_INVALID(&prebuilt->stored_select_lock_type,
678
 
                         sizeof prebuilt->stored_select_lock_type);
679
611
 
680
612
        prebuilt->search_tuple = dtuple_create(
681
613
                heap, 2 * dict_table_get_n_cols(table));
840
772
        }
841
773
}
842
774
 
843
 
dtuple_t* row_get_prebuilt_insert_row(row_prebuilt_t*   prebuilt);
844
 
 
845
775
/*********************************************************************//**
846
776
Gets pointer to a prebuilt dtuple used in insertions. If the insert graph
847
777
has not yet been built in the prebuilt struct, then this function first
848
778
builds it.
849
779
@return prebuilt dtuple; the column type information is also set in it */
 
780
static
850
781
dtuple_t*
851
782
row_get_prebuilt_insert_row(
852
783
/*========================*/
869
800
                prebuilt->ins_node = node;
870
801
 
871
802
                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));
 
803
                        prebuilt->ins_upd_rec_buff = mem_heap_alloc(
 
804
                                prebuilt->heap, prebuilt->mysql_row_len);
874
805
                }
875
806
 
876
807
                row = dtuple_create(prebuilt->heap,
880
811
 
881
812
                ins_node_set_new_row(node, row);
882
813
 
883
 
                prebuilt->ins_graph = static_cast<que_fork_t *>(que_node_get_parent(
 
814
                prebuilt->ins_graph = que_node_get_parent(
884
815
                        pars_complete_graph_for_exec(node,
885
816
                                                     prebuilt->trx,
886
 
                                                     prebuilt->heap)));
 
817
                                                     prebuilt->heap));
887
818
                prebuilt->ins_graph->state = QUE_FORK_ACTIVE;
888
819
        }
889
820
 
914
845
        if (counter > 2000000000
915
846
            || ((ib_int64_t)counter > 16 + table->stat_n_rows / 16)) {
916
847
 
917
 
                dict_update_statistics(table, FALSE /* update even if stats
918
 
                                                    are initialized */);
 
848
                dict_update_statistics(table);
919
849
        }
920
850
}
921
851
 
1066
996
        trx_start_if_not_started(trx);
1067
997
 
1068
998
        if (table) {
1069
 
                err = lock_table(0, table, static_cast<lock_mode>(mode), thr);
 
999
                err = lock_table(0, table, mode, thr);
1070
1000
        } else {
1071
1001
                err = lock_table(0, prebuilt->table,
1072
 
                                 static_cast<lock_mode>(prebuilt->select_lock_type), thr);
 
1002
                                 prebuilt->select_lock_type, thr);
1073
1003
        }
1074
1004
 
1075
1005
        trx->error_state = err;
1244
1174
 
1245
1175
                node = sel_node_create(prebuilt->heap);
1246
1176
 
1247
 
                prebuilt->sel_graph = static_cast<que_fork_t *>(que_node_get_parent(
 
1177
                prebuilt->sel_graph = que_node_get_parent(
1248
1178
                        pars_complete_graph_for_exec(node,
1249
1179
                                                     prebuilt->trx,
1250
 
                                                     prebuilt->heap)));
 
1180
                                                     prebuilt->heap));
1251
1181
 
1252
1182
                prebuilt->sel_graph->state = QUE_FORK_ACTIVE;
1253
1183
        }
1315
1245
 
1316
1246
                prebuilt->upd_node = node;
1317
1247
 
1318
 
                prebuilt->upd_graph = static_cast<que_fork_t *>(que_node_get_parent(
 
1248
                prebuilt->upd_graph = que_node_get_parent(
1319
1249
                        pars_complete_graph_for_exec(node,
1320
1250
                                                     prebuilt->trx,
1321
 
                                                     prebuilt->heap)));
 
1251
                                                     prebuilt->heap));
1322
1252
                prebuilt->upd_graph->state = QUE_FORK_ACTIVE;
1323
1253
        }
1324
1254
 
1432
1362
run_again:
1433
1363
        thr->run_node = node;
1434
1364
        thr->prev_node = node;
1435
 
        thr->fk_cascade_depth = 0;
1436
1365
 
1437
1366
        row_upd_step(thr);
1438
1367
 
1439
 
        /* The recursive call for cascading update/delete happens
1440
 
        in above row_upd_step(), reset the counter once we come
1441
 
        out of the recursive call, so it does not accumulate for
1442
 
        different row deletes */
1443
 
        thr->fk_cascade_depth = 0;
1444
 
 
1445
1368
        err = trx->error_state;
1446
1369
 
1447
 
        /* Reset fk_cascade_depth back to 0 */
1448
 
        thr->fk_cascade_depth = 0;
1449
 
 
1450
1370
        if (err != DB_SUCCESS) {
1451
1371
                que_thr_stop_for_mysql(thr);
1452
1372
 
1483
1403
                srv_n_rows_updated++;
1484
1404
        }
1485
1405
 
1486
 
        /* We update table statistics only if it is a DELETE or UPDATE
1487
 
        that changes indexed columns, UPDATEs that change only non-indexed
1488
 
        columns would not affect statistics. */
1489
 
        if (node->is_delete || !(node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
1490
 
                row_update_statistics_if_needed(prebuilt->table);
1491
 
        }
 
1406
        row_update_statistics_if_needed(prebuilt->table);
1492
1407
 
1493
1408
        trx->op_info = "";
1494
1409
 
1496
1411
}
1497
1412
 
1498
1413
/*********************************************************************//**
1499
 
This can only be used when srv_locks_unsafe_for_binlog is TRUE or this
1500
 
session is using a READ COMMITTED or READ UNCOMMITTED isolation level.
1501
 
Before calling this function row_search_for_mysql() must have
1502
 
initialized prebuilt->new_rec_locks to store the information which new
1503
 
record locks really were set. This function removes a newly set
1504
 
clustered index record lock under prebuilt->pcur or
1505
 
prebuilt->clust_pcur.  Thus, this implements a 'mini-rollback' that
1506
 
releases the latest clustered index record lock we set.
1507
 
@return error code or DB_SUCCESS */
 
1414
This can only be used when srv_locks_unsafe_for_binlog is TRUE or
 
1415
this session is using a READ COMMITTED isolation level. Before
 
1416
calling this function we must use trx_reset_new_rec_lock_info() and
 
1417
trx_register_new_rec_lock() to store the information which new record locks
 
1418
really were set. This function removes a newly set lock under prebuilt->pcur,
 
1419
and also under prebuilt->clust_pcur. Currently, this is only used and tested
 
1420
in the case of an UPDATE or a DELETE statement, where the row lock is of the
 
1421
LOCK_X type.
 
1422
Thus, this implements a 'mini-rollback' that releases the latest record
 
1423
locks we set.
 
1424
@return error code or DB_SUCCESS */
1508
1425
UNIV_INTERN
1509
1426
int
1510
1427
row_unlock_for_mysql(
1511
1428
/*=================*/
1512
 
        row_prebuilt_t* prebuilt,       /*!< in/out: prebuilt struct in MySQL
 
1429
        row_prebuilt_t* prebuilt,       /*!< in: prebuilt struct in MySQL
1513
1430
                                        handle */
1514
 
        ibool           has_latches_on_recs)/*!< in: TRUE if called so
1515
 
                                        that we have the latches on
1516
 
                                        the records under pcur and
1517
 
                                        clust_pcur, and we do not need
1518
 
                                        to reposition the cursors. */
 
1431
        ibool           has_latches_on_recs)/*!< TRUE if called so that we have
 
1432
                                        the latches on the records under pcur
 
1433
                                        and clust_pcur, and we do not need to
 
1434
                                        reposition the cursors. */
1519
1435
{
1520
1436
        btr_pcur_t*     pcur            = prebuilt->pcur;
1521
1437
        btr_pcur_t*     clust_pcur      = prebuilt->clust_pcur;
1598
1514
                        }
1599
1515
                }
1600
1516
 
1601
 
                if (rec_trx_id != trx->id) {
 
1517
                if (ut_dulint_cmp(rec_trx_id, trx->id) != 0) {
1602
1518
                        /* We did not update the record: unlock it */
1603
1519
 
1604
1520
                        rec = btr_pcur_get_rec(pcur);
1605
1521
                        index = btr_pcur_get_btr_cur(pcur)->index;
1606
1522
 
1607
1523
                        lock_rec_unlock(trx, btr_pcur_get_block(pcur),
1608
 
                                        rec, static_cast<lock_mode>(prebuilt->select_lock_type));
 
1524
                                        rec, prebuilt->select_lock_type);
1609
1525
 
1610
1526
                        if (prebuilt->new_rec_locks >= 2) {
1611
1527
                                rec = btr_pcur_get_rec(clust_pcur);
1614
1530
                                lock_rec_unlock(trx,
1615
1531
                                                btr_pcur_get_block(clust_pcur),
1616
1532
                                                rec,
1617
 
                                                static_cast<lock_mode>(prebuilt->select_lock_type));
 
1533
                                                prebuilt->select_lock_type);
1618
1534
                        }
1619
1535
                }
1620
1536
no_unlock:
1642
1558
        trx_t*  trx;
1643
1559
 
1644
1560
        trx = thr_get_trx(thr);
1645
 
 
1646
 
        /* Increment fk_cascade_depth to record the recursive call depth on
1647
 
        a single update/delete that affects multiple tables chained
1648
 
        together with foreign key relations. */
1649
 
        thr->fk_cascade_depth++;
1650
 
 
1651
 
        if (thr->fk_cascade_depth > FK_MAX_CASCADE_DEL) {
1652
 
                return (DB_FOREIGN_EXCEED_MAX_CASCADE);
1653
 
        }
1654
1561
run_again:
1655
1562
        thr->run_node = node;
1656
1563
        thr->prev_node = node;
1657
1564
 
1658
1565
        row_upd_step(thr);
1659
1566
 
1660
 
        /* The recursive call for cascading update/delete happens
1661
 
        in above row_upd_step(), reset the counter once we come
1662
 
        out of the recursive call, so it does not accumulate for
1663
 
        different row deletes */
1664
 
        thr->fk_cascade_depth = 0;
1665
 
 
1666
1567
        err = trx->error_state;
1667
1568
 
1668
1569
        /* Note that the cascade node is a subnode of another InnoDB
1912
1813
 
1913
1814
        thr = pars_complete_graph_for_exec(node, trx, heap);
1914
1815
 
1915
 
        ut_a(thr == que_fork_start_command(static_cast<que_fork_t *>(que_node_get_parent(thr))));
 
1816
        ut_a(thr == que_fork_start_command(que_node_get_parent(thr)));
1916
1817
        que_run_threads(thr);
1917
1818
 
1918
1819
        err = trx->error_state;
1919
1820
 
 
1821
        if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
 
1822
                trx->error_state = DB_SUCCESS;
 
1823
                trx_general_rollback_for_mysql(trx, NULL);
 
1824
                /* TO DO: free table?  The code below will dereference
 
1825
                table->name, though. */
 
1826
        }
 
1827
 
1920
1828
        switch (err) {
1921
 
        case DB_SUCCESS:
1922
 
                break;
1923
1829
        case DB_OUT_OF_FILE_SPACE:
1924
 
                trx->error_state = DB_SUCCESS;
1925
 
                trx_general_rollback_for_mysql(trx, NULL);
1926
 
 
1927
1830
                ut_print_timestamp(stderr);
1928
1831
                fputs("  InnoDB: Warning: cannot create table ",
1929
1832
                      stderr);
1938
1841
                break;
1939
1842
 
1940
1843
        case DB_DUPLICATE_KEY:
1941
 
        default:
1942
1844
                /* We may also get err == DB_ERROR if the .ibd file for the
1943
1845
                table already exists */
1944
1846
 
1945
 
                trx->error_state = DB_SUCCESS;
1946
 
                trx_general_rollback_for_mysql(trx, NULL);
1947
 
                dict_mem_table_free(table);
1948
1847
                break;
1949
1848
        }
1950
1849
 
2053
1952
 
2054
1953
        thr = pars_complete_graph_for_exec(node, trx, heap);
2055
1954
 
2056
 
        ut_a(thr == que_fork_start_command(static_cast<que_fork_t *>(que_node_get_parent(thr))));
 
1955
        ut_a(thr == que_fork_start_command(que_node_get_parent(thr)));
2057
1956
        que_run_threads(thr);
2058
1957
 
2059
1958
        err = trx->error_state;
2127
2026
                                              name, reject_fks);
2128
2027
        if (err == DB_SUCCESS) {
2129
2028
                /* Check that also referencing constraints are ok */
2130
 
                err = dict_load_foreigns(name, FALSE, TRUE);
 
2029
                err = dict_load_foreigns(name, TRUE);
2131
2030
        }
2132
2031
 
2133
2032
        if (err != DB_SUCCESS) {
2326
2225
                drop = UT_LIST_GET_NEXT(row_mysql_drop_list, drop);
2327
2226
        }
2328
2227
 
2329
 
        drop = static_cast<row_mysql_drop_t *>(mem_alloc(sizeof(row_mysql_drop_t)));
 
2228
        drop = mem_alloc(sizeof(row_mysql_drop_t));
2330
2229
 
2331
2230
        drop->table_name = mem_strdup(name);
2332
2231
 
2354
2253
        trx_t*          trx)    /*!< in: transaction handle */
2355
2254
{
2356
2255
        dict_foreign_t* foreign;
2357
 
        table_id_t      new_id;
 
2256
        dulint          new_id;
2358
2257
        dict_table_t*   table;
2359
2258
        ibool           success;
2360
2259
        ulint           err;
2476
2375
        info = pars_info_create();
2477
2376
 
2478
2377
        pars_info_add_str_literal(info, "table_name", name);
2479
 
        pars_info_add_ull_literal(info, "new_id", new_id);
 
2378
        pars_info_add_dulint_literal(info, "new_id", new_id);
2480
2379
 
2481
2380
        err = que_eval_sql(info,
2482
2381
                           "PROCEDURE DISCARD_TABLESPACE_PROC () IS\n"
2690
2589
        dict_index_t*   sys_index;
2691
2590
        btr_pcur_t      pcur;
2692
2591
        mtr_t           mtr;
2693
 
        table_id_t      new_id;
 
2592
        dulint          new_id;
2694
2593
        ulint           recreate_space = 0;
2695
2594
        pars_info_t*    info = NULL;
2696
2595
 
2832
2731
 
2833
2732
                        dict_hdr_get_new_id(NULL, NULL, &space);
2834
2733
 
2835
 
                        /* Lock all index trees for this table. We must
2836
 
                        do so after dict_hdr_get_new_id() to preserve
2837
 
                        the latch order */
2838
 
                        dict_table_x_lock_indexes(table);
2839
 
 
2840
2734
                        if (space == ULINT_UNDEFINED
2841
2735
                            || fil_create_new_single_table_tablespace(
2842
2736
                                    space, table->name, FALSE, flags,
2843
2737
                                    FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {
2844
 
                                dict_table_x_unlock_indexes(table);
2845
2738
                                ut_print_timestamp(stderr);
2846
2739
                                fprintf(stderr,
2847
2740
                                        "  InnoDB: TRUNCATE TABLE %s failed to"
2870
2763
                                        FIL_IBD_FILE_INITIAL_SIZE, &mtr);
2871
2764
                        mtr_commit(&mtr);
2872
2765
                }
2873
 
        } else {
2874
 
                /* Lock all index trees for this table, as we will
2875
 
                truncate the table/index and possibly change their metadata.
2876
 
                All DML/DDL are blocked by table level lock, with
2877
 
                a few exceptions such as queries into information schema
2878
 
                about the table, MySQL could try to access index stats
2879
 
                for this kind of query, we need to use index locks to
2880
 
                sync up */
2881
 
                dict_table_x_lock_indexes(table);
2882
2766
        }
2883
2767
 
2884
2768
        /* scan SYS_INDEXES for all indexes of the table */
2887
2771
        tuple = dtuple_create(heap, 1);
2888
2772
        dfield = dtuple_get_nth_field(tuple, 0);
2889
2773
 
2890
 
        buf = static_cast<byte *>(mem_heap_alloc(heap, 8));
 
2774
        buf = mem_heap_alloc(heap, 8);
2891
2775
        mach_write_to_8(buf, table->id);
2892
2776
 
2893
2777
        dfield_set_data(dfield, buf, 8);
2954
2838
 
2955
2839
        mem_heap_free(heap);
2956
2840
 
2957
 
        /* Done with index truncation, release index tree locks,
2958
 
        subsequent work relates to table level metadata change */
2959
 
        dict_table_x_unlock_indexes(table);
2960
 
 
2961
2841
        dict_hdr_get_new_id(&new_id, NULL, NULL);
2962
2842
 
2963
2843
        info = pars_info_create();
2964
2844
 
2965
2845
        pars_info_add_int4_literal(info, "space", (lint) table->space);
2966
 
        pars_info_add_ull_literal(info, "old_id", table->id);
2967
 
        pars_info_add_ull_literal(info, "new_id", new_id);
 
2846
        pars_info_add_dulint_literal(info, "old_id", table->id);
 
2847
        pars_info_add_dulint_literal(info, "new_id", new_id);
2968
2848
 
2969
2849
        err = que_eval_sql(info,
2970
2850
                           "PROCEDURE RENUMBER_TABLESPACE_PROC () IS\n"
3004
2884
        dict_table_autoinc_lock(table);
3005
2885
        dict_table_autoinc_initialize(table, 1);
3006
2886
        dict_table_autoinc_unlock(table);
3007
 
        dict_update_statistics(table, FALSE /* update even if stats are
3008
 
                                            initialized */);
 
2887
        dict_update_statistics(table);
3009
2888
 
3010
2889
        trx_commit_for_mysql(trx);
3011
2890
 
3213
3092
 
3214
3093
        if (table->n_foreign_key_checks_running > 0) {
3215
3094
 
3216
 
                const char*     i_table_name = table->name;
 
3095
                const char*     table_name = table->name;
3217
3096
                ibool           added;
3218
3097
 
3219
 
                added = row_add_table_to_background_drop_list(i_table_name);
 
3098
                added = row_add_table_to_background_drop_list(table_name);
3220
3099
 
3221
3100
                if (added) {
3222
3101
                        ut_print_timestamp(stderr);
3223
3102
                        fputs("  InnoDB: You are trying to drop table ",
3224
3103
                              stderr);
3225
 
                        ut_print_name(stderr, trx, TRUE, i_table_name);
 
3104
                        ut_print_name(stderr, trx, TRUE, table_name);
3226
3105
                        fputs("\n"
3227
3106
                              "InnoDB: though there is a"
3228
3107
                              " foreign key check running on it.\n"
3352
3231
 
3353
3232
                dict_table_remove_from_cache(table);
3354
3233
 
3355
 
                if (dict_load_table(name, TRUE) != NULL) {
 
3234
                if (dict_load_table(name) != NULL) {
3356
3235
                        ut_print_timestamp(stderr);
3357
3236
                        fputs("  InnoDB: Error: not able to remove table ",
3358
3237
                              stderr);
3498
3377
                btr_pcur_store_position(&pcur, &mtr);
3499
3378
                btr_pcur_commit_specify_mtr(&pcur, &mtr);
3500
3379
 
3501
 
                table = dict_load_table(table_name, TRUE);
 
3380
                table = dict_load_table(table_name);
3502
3381
 
3503
3382
                if (table) {
3504
3383
                        row_drop_table_for_mysql(table_name, trx, FALSE);
4010
3889
                an ALTER, not in a RENAME. */
4011
3890
 
4012
3891
                err = dict_load_foreigns(
4013
 
                        new_name, FALSE, !old_is_tmp || trx->check_foreigns);
 
3892
                        new_name, !old_is_tmp || trx->check_foreigns);
4014
3893
 
4015
3894
                if (err != DB_SUCCESS) {
4016
3895
                        ut_print_timestamp(stderr);
4095
3974
 
4096
3975
        *n_rows = 0;
4097
3976
 
4098
 
        buf = static_cast<byte *>(mem_alloc(UNIV_PAGE_SIZE));
 
3977
        buf = mem_alloc(UNIV_PAGE_SIZE);
4099
3978
        heap = mem_heap_create(100);
4100
3979
 
4101
3980
        cnt = 1000;
4196
4075
                                * sizeof *offsets;
4197
4076
 
4198
4077
                        tmp_heap = mem_heap_create(size);
4199
 
                        offsets = static_cast<ulint *>(mem_heap_dup(tmp_heap, offsets, size));
 
4078
                        offsets = mem_heap_dup(tmp_heap, offsets, size);
4200
4079
                }
4201
4080
 
4202
4081
                mem_heap_empty(heap);