~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/handler/ha_innodb.cc

  • Committer: Brian Aker
  • Date: 2009-01-06 09:02:30 UTC
  • mfrom: (758.1.5 devel)
  • Revision ID: brian@tangent.org-20090106090230-ov94my79hsiz4bes
Merge from Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
1464
1464
        }
1465
1465
 
1466
1466
        if (trx->has_search_latch) {
1467
 
                sql_print_error("The calling thread is holding the adaptive "
 
1467
                errmsg_printf(ERRMSG_LVL_ERROR, "The calling thread is holding the adaptive "
1468
1468
                                "search, latch though calling "
1469
1469
                                "innobase_query_caching_of_table_permitted.");
1470
1470
 
1814
1814
 
1815
1815
#ifdef MYSQL_DYNAMIC_PLUGIN
1816
1816
        if (!innodb_plugin_init()) {
1817
 
                sql_print_error("InnoDB plugin init failed.");
 
1817
                errmsg_printf(ERRMSG_LVL_ERROR, "InnoDB plugin init failed.");
1818
1818
                DBUG_RETURN(-1);
1819
1819
        }
1820
1820
 
1867
1867
                        || strcmp(test_tablename
1868
1868
                        + sizeof srv_mysql50_table_name_prefix,
1869
1869
                        test_filename)) {
1870
 
                sql_print_error("tablename encoding has been changed");
 
1870
                errmsg_printf(ERRMSG_LVL_ERROR, "tablename encoding has been changed");
1871
1871
                goto error;
1872
1872
        }
1873
1873
#endif /* UNIV_DEBUG */
1875
1875
        /* Check that values don't overflow on 32-bit systems. */
1876
1876
        if (sizeof(ulint) == 4) {
1877
1877
                if (innobase_buffer_pool_size > UINT_MAX32) {
1878
 
                        sql_print_error(
 
1878
                        errmsg_printf(ERRMSG_LVL_ERROR, 
1879
1879
                                "innobase_buffer_pool_size can't be over 4GB"
1880
1880
                                " on 32-bit systems");
1881
1881
 
1883
1883
                }
1884
1884
 
1885
1885
                if (innobase_log_file_size > UINT_MAX32) {
1886
 
                        sql_print_error(
 
1886
                        errmsg_printf(ERRMSG_LVL_ERROR, 
1887
1887
                                "innobase_log_file_size can't be over 4GB"
1888
1888
                                " on 32-bit systems");
1889
1889
 
1952
1952
                                &srv_auto_extend_last_data_file,
1953
1953
                                &srv_last_file_size_max);
1954
1954
        if (ret == FALSE) {
1955
 
                sql_print_error(
 
1955
                errmsg_printf(ERRMSG_LVL_ERROR, 
1956
1956
                        "InnoDB: syntax error in innodb_data_file_path");
1957
1957
                my_free(internal_innobase_data_file_path,
1958
1958
                                                MYF(MY_ALLOW_ZERO_PTR));
1982
1982
                                                &srv_log_group_home_dirs);
1983
1983
 
1984
1984
        if (ret == FALSE || innobase_mirrored_log_groups != 1) {
1985
 
          sql_print_error("syntax error in innodb_log_group_home_dir, or a "
 
1985
          errmsg_printf(ERRMSG_LVL_ERROR, "syntax error in innodb_log_group_home_dir, or a "
1986
1986
                          "wrong number of mirrored log groups");
1987
1987
 
1988
1988
                my_free(internal_innobase_data_file_path,
1998
1998
 
1999
1999
                if (format_id > DICT_TF_FORMAT_MAX) {
2000
2000
 
2001
 
                        sql_print_error("InnoDB: wrong innodb_file_format.");
 
2001
                        errmsg_printf(ERRMSG_LVL_ERROR, "InnoDB: wrong innodb_file_format.");
2002
2002
 
2003
2003
                        my_free(internal_innobase_data_file_path,
2004
2004
                                MYF(MY_ALLOW_ZERO_PTR));
2033
2033
                if (!innobase_file_format_check_validate(
2034
2034
                        innobase_file_format_check)) {
2035
2035
 
2036
 
                        sql_print_error("InnoDB: invalid "
 
2036
                        errmsg_printf(ERRMSG_LVL_ERROR, "InnoDB: invalid "
2037
2037
                                        "innodb_file_format_check value: "
2038
2038
                                        "should be either 'on' or 'off' or "
2039
2039
                                        "any value up to %s or its "
2327
2327
        if (trx->active_trans == 0
2328
2328
                && trx->conc_state != TRX_NOT_STARTED) {
2329
2329
 
2330
 
                sql_print_error("trx->active_trans == 0, but"
 
2330
                errmsg_printf(ERRMSG_LVL_ERROR, "trx->active_trans == 0, but"
2331
2331
                        " trx->conc_state != TRX_NOT_STARTED");
2332
2332
        }
2333
2333
        if (all
2624
2624
        if (trx->active_trans == 0
2625
2625
                && trx->conc_state != TRX_NOT_STARTED) {
2626
2626
 
2627
 
                sql_print_error("trx->active_trans == 0, but"
 
2627
                errmsg_printf(ERRMSG_LVL_ERROR, "trx->active_trans == 0, but"
2628
2628
                        " trx->conc_state != TRX_NOT_STARTED");
2629
2629
        }
2630
2630
 
2631
2631
 
2632
2632
        if (trx->conc_state != TRX_NOT_STARTED &&
2633
2633
                global_system_variables.log_warnings) {
2634
 
                sql_print_warning(
 
2634
                errmsg_printf(ERRMSG_LVL_WARN, 
2635
2635
                        "MySQL is closing a connection that has an active "
2636
2636
                        "InnoDB transaction.  %lu row modifications will "
2637
2637
                        "roll back.",
2948
2948
                }
2949
2949
 
2950
2950
                if (is_part) {
2951
 
                        sql_print_error("Failed to open table %s after "
 
2951
                        errmsg_printf(ERRMSG_LVL_ERROR, "Failed to open table %s after "
2952
2952
                                        "%lu attemtps.\n", norm_name,
2953
2953
                                        retries);
2954
2954
                }
2955
2955
 
2956
 
                sql_print_error("Cannot find or open table %s from\n"
 
2956
                errmsg_printf(ERRMSG_LVL_ERROR, "Cannot find or open table %s from\n"
2957
2957
                                "the internal data dictionary of InnoDB "
2958
2958
                                "though the .frm file for the\n"
2959
2959
                                "table exists. Maybe you have deleted and "
2976
2976
        }
2977
2977
 
2978
2978
        if (ib_table->ibd_file_missing && !thd_tablespace_op(thd)) {
2979
 
                sql_print_error("MySQL is trying to open a table handle but "
 
2979
                errmsg_printf(ERRMSG_LVL_ERROR, "MySQL is trying to open a table handle but "
2980
2980
                                "the .ibd file for\ntable %s does not exist.\n"
2981
2981
                                "Have you deleted the .ibd file from the "
2982
2982
                                "database directory under\nthe MySQL datadir, "
3009
3009
 
3010
3010
        if (!row_table_got_default_clust_index(ib_table)) {
3011
3011
                if (primary_key >= MAX_KEY) {
3012
 
                  sql_print_error("Table %s has a primary key in InnoDB data "
 
3012
                  errmsg_printf(ERRMSG_LVL_ERROR, "Table %s has a primary key in InnoDB data "
3013
3013
                                  "dictionary, but not in MySQL!", name);
3014
3014
                }
3015
3015
 
3024
3024
                ref_length = table->key_info[primary_key].key_length;
3025
3025
        } else {
3026
3026
                if (primary_key != MAX_KEY) {
3027
 
                  sql_print_error("Table %s has no primary key in InnoDB data "
 
3027
                  errmsg_printf(ERRMSG_LVL_ERROR, "Table %s has no primary key in InnoDB data "
3028
3028
                                  "dictionary, but has one in MySQL! If you "
3029
3029
                                  "created the table with a MySQL version < "
3030
3030
                                  "3.23.54 and did not define a primary key, "
3048
3048
                and it will never be updated anyway. */
3049
3049
 
3050
3050
                if (key_used_on_scan != MAX_KEY) {
3051
 
                        sql_print_warning(
 
3051
                        errmsg_printf(ERRMSG_LVL_WARN, 
3052
3052
                                "Table %s key_used_on_scan is %lu even "
3053
3053
                                "though there is no primary key inside "
3054
3054
                                "InnoDB.", name, (ulong) key_used_on_scan);
3248
3248
                        charset = get_charset(charset_number, MYF(MY_WME));
3249
3249
 
3250
3250
                        if (charset == NULL) {
3251
 
                          sql_print_error("InnoDB needs charset %lu for doing "
 
3251
                          errmsg_printf(ERRMSG_LVL_ERROR, "InnoDB needs charset %lu for doing "
3252
3252
                                          "a comparison, but MySQL cannot "
3253
3253
                                          "find that charset.",
3254
3254
                                          (ulong) charset_number);
4082
4082
        DBUG_ENTER("ha_innobase::write_row");
4083
4083
 
4084
4084
        if (prebuilt->trx != trx) {
4085
 
          sql_print_error("The transaction object for the table handle is at "
 
4085
          errmsg_printf(ERRMSG_LVL_ERROR, "The transaction object for the table handle is at "
4086
4086
                          "%p, but for the current thread it is at %p",
4087
4087
                          (const void*) prebuilt->trx, (const void*) trx);
4088
4088
 
5002
5002
        }
5003
5003
 
5004
5004
        if (!index) {
5005
 
                sql_print_error(
 
5005
                errmsg_printf(ERRMSG_LVL_ERROR, 
5006
5006
                        "Innodb could not find key n:o %u with name %s "
5007
5007
                        "from dict cache for table %s",
5008
5008
                        keynr, key ? key->name : "NULL",
5033
5033
        prebuilt->index = innobase_get_index(keynr);
5034
5034
 
5035
5035
        if (UNIV_UNLIKELY(!prebuilt->index)) {
5036
 
                sql_print_warning("InnoDB: change_active_index(%u) failed",
 
5036
                errmsg_printf(ERRMSG_LVL_WARN, "InnoDB: change_active_index(%u) failed",
5037
5037
                                  keynr);
5038
5038
                DBUG_RETURN(1);
5039
5039
        }
5397
5397
        table. */
5398
5398
 
5399
5399
        if (len != ref_length) {
5400
 
          sql_print_error("Stored ref len is %lu, but table ref len is %lu",
 
5400
          errmsg_printf(ERRMSG_LVL_ERROR, "Stored ref len is %lu, but table ref len is %lu",
5401
5401
                          (ulong) len, (ulong) ref_length);
5402
5402
        }
5403
5403
}
5620
5620
                                || col_type == DATA_FLOAT
5621
5621
                                || col_type == DATA_DOUBLE
5622
5622
                                || col_type == DATA_DECIMAL) {
5623
 
                                sql_print_error(
 
5623
                                errmsg_printf(ERRMSG_LVL_ERROR, 
5624
5624
                                        "MySQL is trying to create a column "
5625
5625
                                        "prefix index field, on an "
5626
5626
                                        "inappropriate data type. Table "
5909
5909
 
5910
5910
                if ((name[1] == ':')
5911
5911
                    || (name[0] == '\\' && name[1] == '\\')) {
5912
 
                        sql_print_error("Cannot create table %s\n", name);
 
5912
                        errmsg_printf(ERRMSG_LVL_ERROR, "Cannot create table %s\n", name);
5913
5913
                        DBUG_RETURN(HA_ERR_GENERIC);
5914
5914
                }
5915
5915
        }
7009
7009
 
7010
7010
                for (i = 0; i < table->s->keys; i++) {
7011
7011
                        if (index == NULL) {
7012
 
                                sql_print_error("Table %s contains fewer "
 
7012
                                errmsg_printf(ERRMSG_LVL_ERROR, "Table %s contains fewer "
7013
7013
                                                "indexes inside InnoDB than "
7014
7014
                                                "are defined in the MySQL "
7015
7015
                                                ".frm file. Have you mixed up "
7024
7024
                        for (j = 0; j < table->key_info[i].key_parts; j++) {
7025
7025
 
7026
7026
                                if (j + 1 > index->n_uniq) {
7027
 
                                        sql_print_error(
 
7027
                                        errmsg_printf(ERRMSG_LVL_ERROR, 
7028
7028
"Index %s of %s has %lu columns unique inside InnoDB, but MySQL is asking "
7029
7029
"statistics for %lu columns. Have you mixed up .frm files from different "
7030
7030
"installations? "
8873
8873
 
8874
8874
        if (trx->active_trans == 0 && trx->conc_state != TRX_NOT_STARTED) {
8875
8875
 
8876
 
          sql_print_error("trx->active_trans == 0, but trx->conc_state != "
 
8876
          errmsg_printf(ERRMSG_LVL_ERROR, "trx->active_trans == 0, but trx->conc_state != "
8877
8877
                          "TRX_NOT_STARTED");
8878
8878
        }
8879
8879
 
9264
9264
                message if they did so. */
9265
9265
 
9266
9266
                if (innobase_file_format_check_on_off(file_format_input)) {
9267
 
                        sql_print_warning(
 
9267
                        errmsg_printf(ERRMSG_LVL_WARN, 
9268
9268
                                "InnoDB: invalid innodb_file_format_check "
9269
9269
                                "value; on/off can only be set at startup or "
9270
9270
                                "in the configuration file");
9283
9283
                        return(0);
9284
9284
 
9285
9285
                } else {
9286
 
                        sql_print_warning(
 
9286
                        errmsg_printf(ERRMSG_LVL_WARN, 
9287
9287
                                "InnoDB: invalid innodb_file_format_check "
9288
9288
                                "value; can be any format up to %s "
9289
9289
                                "or its equivalent numeric id",