~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Stewart Smith
  • Author(s): Jimmy Yang, Stewart Smith
  • Date: 2010-12-03 03:58:24 UTC
  • mto: (2021.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1986.
  • Revision ID: stewart@flamingspork.com-20101203035824-tb3kvq1pvgzwox2r
Merge Revision revid:jimmy.yang@oracle.com-20100804103744-vbpeghipkz6pyc9z from MySQL InnoDB

Original revid:jimmy.yang@oracle.com-20100804103744-vbpeghipkz6pyc9z

Original Authors: Jimmy Yang <jimmy.yang@oracle.com>
Original commit message:
Fix bug #54678, InnoDB, TRUNCATE, ALTER, I_S SELECT, crash or deadlock

rb://399 approved by Sunny Bains

Show diffs side-by-side

added added

removed removed

Lines of Context:
2779
2779
 
2780
2780
        trx->table_id = table->id;
2781
2781
 
 
2782
        /* Lock all index trees for this table, as we will
 
2783
        truncate the table/index and possibly change their metadata.
 
2784
        All DML/DDL are blocked by table level lock, with
 
2785
        a few exceptions such as queries into information schema
 
2786
        about the table, MySQL could try to access index stats
 
2787
        for this kind of query, we need to use index locks to
 
2788
        sync up */
 
2789
        dict_table_x_lock_indexes(table);
 
2790
 
2782
2791
        if (table->space && !table->dir_path_of_temp_table) {
2783
2792
                /* Discard and create the single-table tablespace. */
2784
2793
                ulint   space   = table->space;
2795
2804
                            || fil_create_new_single_table_tablespace(
2796
2805
                                    space, table->name, FALSE, flags,
2797
2806
                                    FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {
 
2807
                                dict_table_x_unlock_indexes(table);
2798
2808
                                ut_print_timestamp(stderr);
2799
2809
                                fprintf(stderr,
2800
2810
                                        "  InnoDB: TRUNCATE TABLE %s failed to"
2898
2908
 
2899
2909
        mem_heap_free(heap);
2900
2910
 
 
2911
        /* Done with index truncation, release index tree locks,
 
2912
        subsequent work relates to table level metadata change */
 
2913
        dict_table_x_unlock_indexes(table);
 
2914
 
2901
2915
        dict_hdr_get_new_id(&new_id, NULL, NULL);
2902
2916
 
2903
2917
        info = pars_info_create();