~ubuntu-branches/ubuntu/precise/mysql-5.5/precise-201203300109

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-02-14 23:59:22 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20120214235922-cux5uek1e5l0hje9
Tags: 5.5.20-0ubuntu1
* New upstream release.
* d/mysql-server-5.5.mysql.upstart: Fix stop on to make sure mysql is
  fully stopped before shutdown commences. (LP: #688541) Also simplify
  start on as it is redundant.
* d/control: Depend on upstart version which has apparmor profile load
  script to prevent failure on upgrade from lucid to precise.
  (LP: #907465)
* d/apparmor-profile: need to allow /run since that is the true path
  of /var/run files. (LP: #917542)
* d/control: mysql-server-5.5 has files in it that used to be owned
  by libmysqlclient-dev, so it must break/replace it. (LP: #912487)
* d/rules, d/control: 5.5.20 Fixes segfault on tests with gcc 4.6,
  change compiler back to system default.
* d/rules: Turn off embedded libedit/readline.(Closes: #659566)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2583
2583
        /* Get the current high water mark format. */
2584
2584
        innobase_file_format_max = (char*) trx_sys_file_format_max_get();
2585
2585
 
2586
 
        btr_search_fully_disabled = (!btr_search_enabled);
2587
2586
        DBUG_RETURN(FALSE);
2588
2587
error:
2589
2588
        DBUG_RETURN(TRUE);
5064
5063
 
5065
5064
                        switch (sql_command) {
5066
5065
                        case SQLCOM_LOAD:
5067
 
                                if ((trx->duplicates
5068
 
                                    & (TRX_DUP_IGNORE | TRX_DUP_REPLACE))) {
 
5066
                                if (trx->duplicates) {
5069
5067
 
5070
5068
                                        goto set_max_autoinc;
5071
5069
                                }
5242
5240
                        /* The field has changed */
5243
5241
 
5244
5242
                        ufield = uvect->fields + n_changed;
 
5243
                        UNIV_MEM_INVALID(ufield, sizeof *ufield);
5245
5244
 
5246
5245
                        /* Let us use a dummy dfield to make the conversion
5247
5246
                        from the MySQL column format to the InnoDB format */
5248
5247
 
5249
 
                        dict_col_copy_type(prebuilt->table->cols + i,
5250
 
                                           dfield_get_type(&dfield));
5251
 
 
5252
5248
                        if (n_len != UNIV_SQL_NULL) {
 
5249
                                dict_col_copy_type(prebuilt->table->cols + i,
 
5250
                                                   dfield_get_type(&dfield));
 
5251
 
5253
5252
                                buf = row_mysql_store_col_in_innobase_format(
5254
5253
                                        &dfield,
5255
5254
                                        (byte*)buf,
5257
5256
                                        new_mysql_row_col,
5258
5257
                                        col_pack_len,
5259
5258
                                        dict_table_is_comp(prebuilt->table));
5260
 
                                dfield_copy_data(&ufield->new_val, &dfield);
 
5259
                                dfield_copy(&ufield->new_val, &dfield);
5261
5260
                        } else {
5262
5261
                                dfield_set_null(&ufield->new_val);
5263
5262
                        }
5340
5339
            && table->next_number_field
5341
5340
            && new_row == table->record[0]
5342
5341
            && thd_sql_command(user_thd) == SQLCOM_INSERT
5343
 
            && (trx->duplicates & (TRX_DUP_IGNORE | TRX_DUP_REPLACE))
5344
 
                == TRX_DUP_IGNORE)  {
 
5342
            && trx->duplicates)  {
5345
5343
 
5346
5344
                ulonglong       auto_inc;
5347
5345
                ulonglong       col_max_value;
5701
5699
                        (byte*) key_ptr,
5702
5700
                        (ulint) key_len,
5703
5701
                        prebuilt->trx);
 
5702
                DBUG_ASSERT(prebuilt->search_tuple->n_fields > 0);
5704
5703
        } else {
5705
5704
                /* We position the cursor to the last or the first entry
5706
5705
                in the index */
5793
5792
        dict_index_t*   index = 0;
5794
5793
 
5795
5794
        DBUG_ENTER("innobase_get_index");
5796
 
        ha_statistic_increment(&SSV::ha_read_key_count);
5797
5795
 
5798
5796
        if (keynr != MAX_KEY && table->s->keys > 0) {
5799
5797
                key = table->key_info + keynr;
5807
5805
                        table. Only print message if the index translation
5808
5806
                        table exists */
5809
5807
                        if (share->idx_trans_tbl.index_mapping) {
5810
 
                                sql_print_error("InnoDB could not find "
5811
 
                                                "index %s key no %u for "
5812
 
                                                "table %s through its "
5813
 
                                                "index translation table",
5814
 
                                                key ? key->name : "NULL",
5815
 
                                                keynr,
5816
 
                                                prebuilt->table->name);
 
5808
                                sql_print_warning("InnoDB could not find "
 
5809
                                                  "index %s key no %u for "
 
5810
                                                  "table %s through its "
 
5811
                                                  "index translation table",
 
5812
                                                  key ? key->name : "NULL",
 
5813
                                                  keynr,
 
5814
                                                  prebuilt->table->name);
5817
5815
                        }
5818
5816
 
5819
5817
                        index = dict_table_get_index_on_name(prebuilt->table,
7528
7526
        mem_heap_t*     heap;
7529
7527
 
7530
7528
        DBUG_ENTER("records_in_range");
 
7529
        DBUG_ASSERT(min_key || max_key);
7531
7530
 
7532
7531
        ut_a(prebuilt->trx == thd_to_trx(ha_thd()));
7533
7532
 
7577
7576
                                         (const uchar*) 0),
7578
7577
                                (ulint) (min_key ? min_key->length : 0),
7579
7578
                                prebuilt->trx);
 
7579
        DBUG_ASSERT(min_key
 
7580
                    ? range_start->n_fields > 0
 
7581
                    : range_start->n_fields == 0);
7580
7582
 
7581
7583
        row_sel_convert_mysql_key_to_innobase(
7582
7584
                                range_end, (byte*) key_val_buff2,
7585
7587
                                         (const uchar*) 0),
7586
7588
                                (ulint) (max_key ? max_key->length : 0),
7587
7589
                                prebuilt->trx);
 
7590
        DBUG_ASSERT(max_key
 
7591
                    ? range_end->n_fields > 0
 
7592
                    : range_end->n_fields == 0);
7588
7593
 
7589
7594
        mode1 = convert_search_mode_to_innobase(min_key ? min_key->flag :
7590
7595
                                                HA_READ_KEY_EXACT);
8286
8291
                putc('\n', stderr);
8287
8292
#endif
8288
8293
 
8289
 
                if (!btr_validate_index(index, prebuilt->trx)) {
 
8294
                /* If this is an index being created, break */
 
8295
                if (*index->name == TEMP_INDEX_PREFIX) {
 
8296
                        break;
 
8297
                }  else if (!btr_validate_index(index, prebuilt->trx)) {
8290
8298
                        is_ok = FALSE;
8291
8299
 
8292
8300
                        innobase_format_name(
8835
8843
                        break;
8836
8844
                case HA_EXTRA_RESET_STATE:
8837
8845
                        reset_template(prebuilt);
 
8846
                        thd_to_trx(ha_thd())->duplicates = 0;
8838
8847
                        break;
8839
8848
                case HA_EXTRA_NO_KEYREAD:
8840
8849
                        prebuilt->read_just_key = 0;
8852
8861
                        parameters below.  We must not invoke update_thd()
8853
8862
                        either, because the calling threads may change.
8854
8863
                        CAREFUL HERE, OR MEMORY CORRUPTION MAY OCCUR! */
8855
 
                case HA_EXTRA_IGNORE_DUP_KEY:
 
8864
                case HA_EXTRA_INSERT_WITH_UPDATE:
8856
8865
                        thd_to_trx(ha_thd())->duplicates |= TRX_DUP_IGNORE;
8857
8866
                        break;
 
8867
                case HA_EXTRA_NO_IGNORE_DUP_KEY:
 
8868
                        thd_to_trx(ha_thd())->duplicates &= ~TRX_DUP_IGNORE;
 
8869
                        break;
8858
8870
                case HA_EXTRA_WRITE_CAN_REPLACE:
8859
8871
                        thd_to_trx(ha_thd())->duplicates |= TRX_DUP_REPLACE;
8860
8872
                        break;
8861
8873
                case HA_EXTRA_WRITE_CANNOT_REPLACE:
8862
8874
                        thd_to_trx(ha_thd())->duplicates &= ~TRX_DUP_REPLACE;
8863
8875
                        break;
8864
 
                case HA_EXTRA_NO_IGNORE_DUP_KEY:
8865
 
                        thd_to_trx(ha_thd())->duplicates &=
8866
 
                                ~(TRX_DUP_IGNORE | TRX_DUP_REPLACE);
8867
 
                        break;
8868
8876
                default:/* Do nothing */
8869
8877
                        ;
8870
8878
        }