1. 15 Sep, 2006 4 commits
    • marko's avatar
      Remove dict_tree_t, which should have been removed in r453. · 7696b8dd
      marko authored
      There always was a one-to-one mapping between dict_tree_t and dict_index_t.
      
      This saves 6 machine words per B-tree index in the data dictionary
      cache plus the memory allocation overhead.  We save one mem_heap_t
      object per index (15 machine words).  Considering the internal
      fragmentation of the buddy allocator in mem_area_alloc(), this should
      save 32 machine words per index (128 bytes on 32-bit systems and 256
      bytes on 64-bit systems).  (Bug #20877)
      
      struct dict_tree_struct, dict_tree_t: Remove.
      
      struct dict_index_struct: Add page and lock.
      
      dict_tree_create(): Remove.  Replace the invocation with
      assignment to index->page and a call to rw_lock_create(&index->lock).
      
      dict_tree_free(): Remove.  Replace the invocation wtih
      a call to rw_lock_free(&index->lock).
      
      dict_index_get_tree(): Remove.
      
      dict_tree_get_space_reserve(): Rename to dict_index_get_space_reserve()
      and remove the parameter, which was unused.
      
      btr_level_list_remove(): Remove the unused parameter "tree".
      
      Replace the occurrences of "tree" with "index" in names of variables,
      functions and data types, e.g. "dict_tree_t tree" becomes
      "dict_index_t index".  Remove local variables "tree" or "index" of
      functions that needed both "tree" and "index".
      7696b8dd
    • osku's avatar
      Make dict_index_find_cols() always succeed. · b00733ad
      osku authored
      b00733ad
    • osku's avatar
      The code base was reindented in r763 and automatic .emacs indentation · a65244ad
      osku authored
      settings introduced. Some problems were found, so from this commit on one
      additional indentation rule is introduced:
      
       (add-to-list 'c-offsets-alist '(arglist-intro . +))
      
      Note that fixing some of the unfortunate line-splits done in r764 will be
      done in a future change.
      a65244ad
    • sunny's avatar
      row_search_for_mysql(): Skip setting the next-key lock on an already · 4bbef222
      sunny authored
      delete-marked record in a clustered index where the search criteria is 
      unique, within the same transaction (Bug #13544).
      4bbef222
  2. 14 Sep, 2006 9 commits
    • marko's avatar
      Reduce the size of btr_search_t from 13 machine words to 7. This · 0bedf4d9
      marko authored
      structure is reserved for every index in the data dictionary cache.
      (Bug #20877)
      
      We could shrink the structure further to three 32-bit words or two
      64-bit words by turning the remaining fields to bit-fields.
      Unfortunately, the fields are not protected by any mutex, and thus we
      would better keep each field aligned to a machine word.
      
      btr_search_t, buf_block_t: Rename "ulint side" to "ibool left_side".
      Remove BTR_SEARCH_LEFT_SIDE and BTR_SEARCH_RIGHT_SIDE, and also rename
      some local variables and function parameters from "ulint side" to
      "ibool left_side".
      
      btr_search_t: Remove the unused fields last_search, n_direction, direction,
      and modify_clock.  Remove the unused constants BTR_SEA_NO_DIRECTION,
      BTR_SEA_LEFT, BTR_SEA_RIGHT, and BTR_SEA_SAME_REC.
      
      btr_search_t: Remove magic_n unless #defined UNIV_DEBUG.  Turn an assertion
      about the magic number into a debug assertion.
      0bedf4d9
    • marko's avatar
      Minor cleanup related to Bug #20877. · adcb90a0
      marko authored
      btr_print_recursive(): Replace tree->tree_indexes with tree->index.
      This should have been done in r453.
      
      univ.i: Add UNIV_BTR_PRINT.
      
      rw_lock_t: Reduce writer_is_wait_ex to a bit and move it close to
      other bitfields.  Change the types to unsigned, in case ulint or ibool
      bitfields will not work.
      adcb90a0
    • marko's avatar
      Turn ha_innobase::build_template() from a non-static member function · 5df36be6
      marko authored
      to a static plain function.
      5df36be6
    • marko's avatar
      dict_table_t: Rename the integer field max_row_size · b6540f6b
      marko authored
      to the Boolean field big_rows.  (Bug #20877)
      
      BIG_ROW_SIZE: Move the definition from row0sel.c to dict_table_add_to_cache().
      b6540f6b
    • marko's avatar
      Remove dict_col_t::clust_pos. · 9ac21cde
      marko authored
      dict_col_get_clust_pos(): Add parameter clust_index.  Replace the
      look-up with a linear search of all columns in the clustered index.
      
      row_upd_index_replace_new_col_vals(): Compute clust_index outside
      the loops.  Compute clust_pos outside the inner loop.
      
      row_upd_changes_ord_field_binary(), row_upd_changes_first_fields_binary():
      Compute clust_index outside the loops.  Declare the auxiliary variables
      inside the loop scope.
      9ac21cde
    • marko's avatar
      dict_col_t: Reduce ord_part to one bit. · 4a1c7668
      marko authored
      dict_index_add_to_cache(): Instead of incrementing ord_part, set it.
      
      dict_index_remove_from_cache(): Do not touch ord_part.
      
      dtype_t: Reduce mbminlen from 3 to 2 bits.
      
      row_upd(): Add a UNIV_LIKELY hint around node->in_mysql_interface.
      4a1c7668
    • marko's avatar
      Remove dict_col_t::hash, dict_col_t::table, · e50acec9
      marko authored
      dict_sys->col_hash, and DICT_POOL_PER_COL_HASH.  (Bug #20877)
      
      The col->table pointer was only needed for maintaining a hash table of
      all defined columns in all tables.  The hash table was only looked up
      in dict_index_find_cols().  Removing the col->hash and col->table
      pointers reduces the size of a table column by two machine words
      (usually 8 or 16 bytes).
      
      dict_col_add_to_cache(), dict_col_reposition_in_cache(),
      dict_col_remove_from_cache(): Remove.  These only updated dict_sys->col_hash.
      
      dict_index_find_cols(): Use a linear search instead of the hash table.
      The time complexity is affected, but this function is only invoked by
      dict_index_add_to_cache(), and we only search the columns of a single
      table (typically at most a few dozen) as opposed to all columns of all
      tables.
      e50acec9
    • osku's avatar
      btr0pcur.h: Change FIXME to TODO. · 18df0db0
      osku authored
      18df0db0
    • osku's avatar
      Remove more remnants of mixed indexes. · 8b68f259
      osku authored
      8b68f259
  3. 13 Sep, 2006 2 commits
  4. 12 Sep, 2006 1 commit
    • marko's avatar
      Reduce the size of the data dictionary cache. (Bug #20877) · 0245fe4a
      marko authored
      dtype_t: Remove unused field "prec", which was supposed to be used for
      the precision of decimal columns in stand-alone InnoDB.
      
      dtype_get_prec(): Remove.
      
      dtype_set(), dict_mem_table_add_col(): Remove parameter "prec".
      
      dtype_t: Turn all fields (mtype, prtype, len, mbminlen, mbmaxlen, len)
      into bit-fields.
      
      dict_table_t, dict_index_t, dict_tree_t: Omit magic_n from non-debug builds.
      
      dict_col_t: Turn ind, clust_pos, and ord_part into bit-fields.
      
      Replace the default clust_pos value ULINT_UNDEFINED with
      REC_MAX_N_FIELDS and replace all references to clust_pos with calls to
      the accessor function dict_col_get_clust_pos().
      
      dict_field_t: Turn prefix_len and fixed_len into bit-fields.
      
      dict_tree_t: Remove pad[64].
      
      dict_table_t: Turn the fields ibd_file_missing, tablespace_discarded,
      cached, flags, stat_initialized, and autoinc_inited into bit-fields.
      Remove does_not_fit_in_memory from non-debug builds.
      
      dict_index_t: Turn the fields trx_id_offset, n_user_defined_cols,
      n_uniq, n_def, n_fields, n_nullable, and cached into bit-fields.
      
      dict_foreign_struct: Turn n_fields and type into bit-fields.
      
      rw_lock_t: Turn cline, last_s_line, and last_x_line into bit-fields.
      Omit level unless #defined UNIV_SYNC_DEBUG.
      
      Move REC_MAX_N_FIELDS (and REC_MAX_HEAP_NO and REC_MAX_N_OWNED)
      from rem0rec.c to rem0types.h, as they are needed in dict0dict.ic.
      dict_col_get_clust_pos(): Map REC_MAX_N_FIELDS to ULINT_UNDEFINED.
      0245fe4a
  5. 11 Sep, 2006 2 commits
    • marko's avatar
      Merge code cleanup from MySQL AB: · db256d89
      marko authored
      ChangeSet
        2006/09/07 08:23:58-07:00 brian@zim.(none) 
        Moves Innodb handler to the Innodb storage directory.
      
      storage/innobase/handler/ha_innodb.cc
        2006/09/07 08:23:53-07:00 brian@zim.(none) +2 -3
        Adjusted include files, also disabled replication code which was not
        being used.
      
      ChangeSet
        2006/09/07 12:34:12-07:00 brian@zim.(none) 
        Fix for a compile problem in Windows. 
      
      storage/innobase/handler/ha_innodb.cc
        2006/09/07 12:34:10-07:00 brian@zim.(none) +0 -28
        Removed some dead code (Marko approved)
      db256d89
    • marko's avatar
      Move ha_innodb.cc and ha_innodb.h from sql to storage/innobase/handler. · 7cf4bf45
      marko authored
      This was submitted by Marko to MySQL AB and merged to the MySQL tree by
      Brian Aker in the following two changesets:
      
      ChangeSet
        2006/09/07 08:23:58-07:00 brian@zim.(none) 
        Moves Innodb handler to the Innodb storage directory.
      
      ChangeSet
        2006/09/07 16:17:16-07:00 brian@zim.(none) 
        Warning fixes for Windows, and an include fix for Windows for Innodb.
      
      storage/innobase/CMakeLists.txt
        2006/09/07 16:17:13-07:00 brian@zim.(none) +6 -1
        Fixed includes for Windows
      7cf4bf45
  6. 06 Sep, 2006 1 commit
    • marko's avatar
      On data tuples being updated or inserted (but not searched for), · 8a1caecc
      marko authored
      set type->len to the prefix_len of the index column, if it is a prefix index.
      This should prevent bugs similar to Bug #21638 from occurring.
      
      dict_index_copy_types(): Set type->len to prefix_len if prefix_len != 0.
      
      row_build_index_entry(): Set type->len to prefix_len if prefix_len != 0,
      also when the column in the tuple is SQL NULL, because the type information
      may be used for interpreting other records during btr_page_reorganize().
      8a1caecc
  7. 05 Sep, 2006 4 commits
  8. 04 Sep, 2006 4 commits
    • marko's avatar
    • marko's avatar
      Merge code from MySQL AB: · 97a199b3
      marko authored
      ChangeSet
        2006/08/25 13:31:15-07:00 brian@zim.(none) 
        Cleanup of unused variables.
      
      sql/ha_innodb.h
        2006/08/25 13:31:11-07:00 brian@zim.(none) +0 -6
        Unused variable
      97a199b3
    • marko's avatar
      Merge code from MySQL AB: · 489ada03
      marko authored
      ChangeSet
        2006/08/22 16:24:12-07:00 brian@zim.(none) 
        This changest:
        Plugins now when compiled or not compiled work correctly with status variables. 
        Status variables from plugins now set their own names (removed bit where plugin name was pre-appended this broke Innodb and Cluster)
        A few Makefile cleanups. 
      
      sql/ha_innodb.cc
        2006/08/22 16:24:08-07:00 brian@zim.(none) +16 -6
        Cleanup to make status variables directly in engine
      489ada03
    • marko's avatar
      ha_innodb.cc: Adjust the comment related to r784. Apparently it was · 2570bfa1
      marko authored
      changed after review on the MySQL side.
      2570bfa1
  9. 01 Sep, 2006 2 commits
    • marko's avatar
      Merge a patch from MySQL AB: · 0af6b4a2
      marko authored
      ChangeSet@1.2288, 2006-08-29 15:35:05+02:00, guilhem@gbichot3.local +2 -0
        Fix for BUG#20866 "show table status on innodb raises assertion"
        and its duplicate BUG#19057 "Test 'rpl_row_func003' fails on SuSE SLES9 x86".
        It was an assertion failure, only in debug builds, not present
        in released versions (nothing to document).
        It happened when doing SHOW TABLE STATUS on an InnoDB table
        having an auto_increment column, right after creating the table.
      
        sql/ha_innodb.cc@1.288, 2006-08-29 15:35:02+02:00, guilhem@gbichot3.local +7 -1
          Before a val_() calls on a Field object, if that field was not marked
          for read, we need to mark it. This is explained here:
          ChangeSet 1.2119.601.1 2006/06/04 18:52:22 monty@mysql.com
          quoting the changeset's comment:
          
            - If a handler needs to call Field->val() or Field->store() on columns
              that are not used in the query, one should install a temporary
              all-columns-used map while doing so. For this, we provide the following
              functions:
            
              my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set);
              field->val();
              dbug_tmp_restore_column_map(table->read_set, old_map);
            
              and similar for the write map:
            
              my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->write_set);
              field->val();
              dbug_tmp_restore_column_map(table->write_set, old_map);
            
              If this is not done, you will sooner or later hit a DBUG_ASSERT
              in the field store() / val() functions.
              (For not DBUG binaries, the dbug_tmp_restore_column_map() and
              dbug_tmp_restore_column_map() are inline dummy functions and should
              be optimized away be the compiler).
          
          Note that I verified that the bug didn't exist in non-debug builds.
      0af6b4a2
    • marko's avatar
      Revert the hunk on ha_innobase::innobase_read_and_init_auto_inc() · cc69e944
      marko authored
      that was accidentally committed in r782.
      cc69e944
  10. 31 Aug, 2006 6 commits
  11. 30 Aug, 2006 1 commit
    • marko's avatar
      Merge changes from MySQL AB: · 71cdd575
      marko authored
      ChangeSet
        2006/08/23 13:59:16-07:00 brian@zim.(none) 
        This patch removes need for a innodb to have its own configure. 
      
      univ.i: Replace ../ib_config.h with config.h.
      
      Makefile.i, Makefile.am: Change directory paths.
      
      configure.in: Delete.
      
      plug.in: New file, included from the top-level configure.in.
      
      setup.sh: Replace configure.in with plug.in.
      71cdd575
  12. 29 Aug, 2006 3 commits
  13. 28 Aug, 2006 1 commit
    • marko's avatar
      Reindent the code base (except for ha_innodb.{cc,h} and generated parser · e8435b3e
      marko authored
      and lexer files).  From now on, the following Emacs cc-mode settings apply
      when indenting C function bodies in InnoDB:
      
      (setq c-basic-offset 8)
      (setq c-label-minimum-indentation 0)
      (add-to-list 'c-offsets-alist '(c . 0))
      (add-to-list 'c-offsets-alist '(label . [0]))
      
      The indentation rules for function declarations still have not been
      formalized, and they must be formatted manually.
      
      Try to limit all lines to at most 79 characters (assuming TAB stops every
      8 characters) by splitting lines before opening parenthesis, or at
      string constants.
      
      Fix some grammar mistakes in diagnostic output:
       match to, match with -> match
       found from -> found in
       trying rename -> trying to rename
      
      Fix an error in page_check_dir(): it said "supremum not pointed to"
      when the infimum was not pointed to.
      
      Enclose commented-out code snippets in #if 0 ... #endif instead of /* ... */.
      Add (void*) casts to some %p parameters in fprintf() calls.  Try to
      split lines before a binary operator, not after one.  (These three fixes
      were not made everywhere.)
      e8435b3e