~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Lee Bieber
  • Date: 2010-12-23 02:14:02 UTC
  • mfrom: (2021.1.2 build)
  • Revision ID: kalebral@gmail.com-20101223021402-o4zhdsv3x8s0q6pz
Merge Stewart - Update innobase plugin to be based on innodb 1.1.4 from MySQL 5.5.8 
Merge Marisa - fixed markup in 'administrative.rst', which was throwing an error in the build

Show diffs side-by-side

added added

removed removed

Lines of Context:
486
486
                                        row is used, as row may contain
487
487
                                        pointers to this record! */
488
488
{
489
 
        mysql_row_templ_t*      templ;
 
489
        const mysql_row_templ_t*templ;
490
490
        dfield_t*               dfield;
491
491
        ulint                   i;
492
492
 
914
914
        if (counter > 2000000000
915
915
            || ((ib_int64_t)counter > 16 + table->stat_n_rows / 16)) {
916
916
 
917
 
                dict_update_statistics(table);
 
917
                dict_update_statistics(table, FALSE /* update even if stats
 
918
                                                    are initialized */);
918
919
        }
919
920
}
920
921
 
1916
1917
 
1917
1918
        err = trx->error_state;
1918
1919
 
1919
 
        if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
 
1920
        switch (err) {
 
1921
        case DB_SUCCESS:
 
1922
                break;
 
1923
        case DB_OUT_OF_FILE_SPACE:
1920
1924
                trx->error_state = DB_SUCCESS;
1921
1925
                trx_general_rollback_for_mysql(trx, NULL);
1922
 
                /* TO DO: free table?  The code below will dereference
1923
 
                table->name, though. */
1924
 
        }
1925
1926
 
1926
 
        switch (err) {
1927
 
        case DB_OUT_OF_FILE_SPACE:
1928
1927
                ut_print_timestamp(stderr);
1929
1928
                fputs("  InnoDB: Warning: cannot create table ",
1930
1929
                      stderr);
1939
1938
                break;
1940
1939
 
1941
1940
        case DB_DUPLICATE_KEY:
 
1941
        default:
1942
1942
                /* We may also get err == DB_ERROR if the .ibd file for the
1943
1943
                table already exists */
1944
1944
 
 
1945
                trx->error_state = DB_SUCCESS;
 
1946
                trx_general_rollback_for_mysql(trx, NULL);
 
1947
                dict_mem_table_free(table);
1945
1948
                break;
1946
1949
        }
1947
1950
 
2817
2820
 
2818
2821
        trx->table_id = table->id;
2819
2822
 
2820
 
        /* Lock all index trees for this table, as we will
2821
 
        truncate the table/index and possibly change their metadata.
2822
 
        All DML/DDL are blocked by table level lock, with
2823
 
        a few exceptions such as queries into information schema
2824
 
        about the table, MySQL could try to access index stats
2825
 
        for this kind of query, we need to use index locks to
2826
 
        sync up */
2827
 
        dict_table_x_lock_indexes(table);
2828
 
 
2829
2823
        if (table->space && !table->dir_path_of_temp_table) {
2830
2824
                /* Discard and create the single-table tablespace. */
2831
2825
                ulint   space   = table->space;
2838
2832
 
2839
2833
                        dict_hdr_get_new_id(NULL, NULL, &space);
2840
2834
 
 
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
 
2841
2840
                        if (space == ULINT_UNDEFINED
2842
2841
                            || fil_create_new_single_table_tablespace(
2843
2842
                                    space, table->name, FALSE, flags,
2871
2870
                                        FIL_IBD_FILE_INITIAL_SIZE, &mtr);
2872
2871
                        mtr_commit(&mtr);
2873
2872
                }
 
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);
2874
2882
        }
2875
2883
 
2876
2884
        /* scan SYS_INDEXES for all indexes of the table */
2996
3004
        dict_table_autoinc_lock(table);
2997
3005
        dict_table_autoinc_initialize(table, 1);
2998
3006
        dict_table_autoinc_unlock(table);
2999
 
        dict_update_statistics(table);
 
3007
        dict_update_statistics(table, FALSE /* update even if stats are
 
3008
                                            initialized */);
3000
3009
 
3001
3010
        trx_commit_for_mysql(trx);
3002
3011