1. 13 Jan, 2009 1 commit
    • marko's avatar
      branches/zip: In hash table lookups, assert that the traversed items · 2f7bcc7d
      marko authored
      satisfy some conditions when UNIV_DEBUG is defined.
      
      HASH_SEARCH(): New parameter: ASSERTION. All users will pass an appropriate
      ut_ad() or nothing.
      
      dict_table_add_to_columns(): Assert that the table being added to the data
      dictionary cache is not already being pointed to by the name_hash and
      id_hash tables.
      
      HASH_SEARCH_ALL(): New macro, for use in dict_table_add_to_columns().
      
      dict_mem_table_free(): Set ut_d(table->cached = FALSE), so that we can
      check ut_ad(table->cached) when traversing the hash tables, as in
      HASH_SEARCH(name_hash, dict_sys->table_hash, ...) and
      HASH_SEARCH(id_hash, dict_sys->table_id_hash, ...).
      
      dict_table_get_low(), dict_table_get_on_id_low(): Assert
      ut_ad(!table || table->cached).
      
      fil_space_get_by_id(): Check ut_ad(space->magic_n == FIL_SPACE_MAGIC_N)
      in HASH_SEARCH(hash, fil_system->spaces, ...).
      
      fil_space_get_by_name(): Check ut_ad(space->magic_n == FIL_SPACE_MAGIC_N)
      in HASH_SEARCH(name_hash, fil_system->name_hash, ...).
      
      buf_buddy_block_free(): Check that the blocks are in valid state in
      HASH_SEARCH(hash, buf_pool->zip_hash, ...).
      
      buf_page_hash_get(): Check that the blocks are in valid state in
      HASH_SEARCH(hash, buf_pool->page_hash, ...).
      
      get_share(), free_share(): Check ut_ad(share->use_count > 0) in
      HASH_SEARCH(table_name_hash, innobase_open_tables, ...).
      
      This was posted as rb://75 for tracking down errors similar to Issue #153.
      2f7bcc7d
  2. 28 Oct, 2008 1 commit
  3. 23 Oct, 2008 1 commit
    • sunny's avatar
      branches/zip: · 119142d2
      sunny authored
      Merge revisions 2852:2854 from branches/5.1:
      
        ------------------------------------------------------------------------
        r2854 | sunny | 2008-10-23 08:30:32 +0300 (Thu, 23 Oct 2008) | 13 lines
        Changed paths:
           M /branches/5.1/dict/dict0dict.c
           M /branches/5.1/dict/dict0mem.c
           M /branches/5.1/handler/ha_innodb.cc
           M /branches/5.1/handler/ha_innodb.h
           M /branches/5.1/include/dict0dict.h
           M /branches/5.1/include/dict0mem.h
           M /branches/5.1/row/row0mysql.c
        
        branches/5.1: Backport changes from branches/zip r2725
        
        Simplify the autoinc initialization code. This removes the
        non-determinism related to reading the table's autoinc value for the first
        time. This change has also reduced the sizeof dict_table_t by sizeof(ibool)
        bytes because we don't need the dict_table_t::autoinc_inited field anymore.
        
        Bug#39830 Table autoinc value not updated on first insert.
        Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info
        Bug#36411 Failed to read auto-increment value from storage engine" in 5.1.24 auto-inc
        rb://16
        
        
        ------------------------------------------------------------------------
      119142d2
  4. 16 Oct, 2008 1 commit
    • marko's avatar
      branches/zip: Skip the undo log size check on REDUNDANT and COMPACT tables. · bb4b3f40
      marko authored
      In ROW_FORMAT=DYNAMIC and ROW_FORMAT=COMPRESSED, column prefix indexes
      require that prefixes of externally stored columns be written to the
      undo log. This may make the undo log record bigger than the record on
      the B-tree page.  The maximum size of an undo log record is the page
      size.  That must be checked for, in dict_index_add_to_cache().
      
      dict_index_add_to_cache(): Skip the undo log size check for REDUNDANT
      and COMPACT tables. These tables store prefixes of externally stored
      columns locally within the clustered index record.  There are no special
      considerations for the undo log record size.
      
      innodb-index.test: Ensure that the check exists for ROW_FORMAT=DYNAMIC,
      but not for ROW_FORMAT=COMPACT.
      
      This fixes issue #99.  rb://28 approved by Sunny.
      bb4b3f40
  5. 04 Oct, 2008 1 commit
    • sunny's avatar
      branches/zip: Simplify the autoinc initialization code. This removes the · 0eff3d3c
      sunny authored
      non-determinism related to reading the table's autoinc value for the first
      time. This change has also reduced the sizeof dict_table_t by sizeof(ibool)
      bytes because we don't need the dict_table_t::autoinc_inited field anymore.
      
      This also fixes Bug#39830 Table autoinc value not updated on first insert.
      rb://16
      0eff3d3c
  6. 18 Sep, 2008 1 commit
    • marko's avatar
      branches/zip: When creating an index in innodb_strict_mode, check that · 75fe6fa6
      marko authored
      the maximum record size will never exceed the B-tree page size limit.
      For uncompressed tables, there should always be enough space for two
      records in an empty B-tree page.  For compressed tables, there should
      be enough space for storing two node pointer records or one data
      record in an empty page in uncompressed format.
      
      dict_build_table_def_step(): Remove the inaccurate check for table row
      size.
      
      dict_index_too_big_for_tree(): New function: check if the index
      records would be too big for a B-tree page.
      
      dict_index_add_to_cache(): Add the parameter "strict".  Invoke
      dict_index_too_big_for_tree() if it is set.
      
      trx_is_strict(), thd_is_strict(): New functions, for determining if
      innodb_strict_mode is enabled for the current transaction.
      
      dict_create_index_step(): Pass the new parameter strict of
      dict_index_add_to_cache() as trx_is_strict(trx).  All other callers
      pass it as FALSE.
      
      innodb.test: Enable innodb_strict_mode before attempting to create a
      table with a too big record size.
      
      innodb-zip.test: Remove the test of inserting random data.  Add tests
      for checking that the maximum record lengths are enforced at table
      creation time.
      75fe6fa6
  7. 17 Sep, 2008 2 commits
  8. 13 Sep, 2008 1 commit
    • inaam's avatar
      branches/zip · b5d1e283
      inaam authored
      Add missing semicolon. Introduced in r2602 which was obviously not
      compiled with UNIV_DEBUG.
      b5d1e283
  9. 09 Sep, 2008 1 commit
    • marko's avatar
      branches/zip: ha_innobase::prepare_drop_index(): When there is a · f19cbe50
      marko authored
      foreign key constraint, find a truly equivalent index for it.
      If none is available, refuse to drop the index.  MySQL can drop
      an index when creating a "stronger" index.
      
      This was reported as Mantis issue #70 and MySQL Bug #38786.
      
      innodb-index.test: Add a test case.
      
      dict_foreign_find_equiv_index(): New function, to replace the
      incorrectly written function dict_table_find_equivalent_index().
      
      dict_table_replace_index_in_foreign_list(): Simplify the implementation.
      f19cbe50
  10. 21 Aug, 2008 1 commit
    • marko's avatar
      branches/zip: Minor cleanup. · f4f81134
      marko authored
      dict_table_get_referenced_constraint(), dict_table_get_foreign_constraint():
      Simplify the iteration loop.
      
      dict_table_find_equivalent_index(): Correct the function comment.
      f4f81134
  11. 20 Aug, 2008 1 commit
  12. 15 Jul, 2008 1 commit
    • inaam's avatar
      branches/zip: Merge 2524:2537 from branches/5.1: · 208ba019
      inaam authored
        ------------------------------------------------------------------------
        r2537 | inaam | 2008-07-15 20:46:03 +0300 (Tue, 15 Jul 2008) | 12 lines
        
        branches/5.1   issue# 4
        
        Fixed a timing hole where a thread dropping an index can free the
        in-memory index struct while another thread is still using
        that structure to remove entries from adaptive hash index belonging
        to one of the pages that belongs to the index being dropped.
        
        The fix is to have a reference counter in the index struct and to
        wait for this counter to drop to zero beforing freeing the struct.
        
        Reviewed by: Heikki
        
        ------------------------------------------------------------------------
      208ba019
  13. 26 Mar, 2008 1 commit
  14. 17 Mar, 2008 2 commits
  15. 11 Mar, 2008 1 commit
  16. 05 Mar, 2008 1 commit
  17. 28 Feb, 2008 1 commit
  18. 27 Feb, 2008 1 commit
    • vasil's avatar
      branches/zip: · 26402257
      vasil authored
      Use innobase_strcasecmp() insteaed of strcasecmp() in i_s.cc and get rid
      of strings.h (that file is not present on Windows).
      
      Move the prototype of innobase_strcasecmp() from ha_innodb.cc and
      dict0dict.c to ha_prototypes.h.
      
      Approved by:	Heikki
      26402257
  19. 06 Feb, 2008 1 commit
    • marko's avatar
      branches/zip: Introduce UNIV_INTERN, a linkage specifier for InnoDB-global · 2c2b06ad
      marko authored
      symbols.  Use it for all definitions of non-static variables and functions.
      
      lexyy.c, make_flex.sh: Declare yylex as UNIV_INTERN, not static.  It is
      referenced from pars0grm.c.
      
      Actually, according to
      	nm .libs/ha_innodb.so|grep -w '[ABCE-TVXYZ]'
      the following symbols are still global:
      
      * The vtable for class ha_innodb
      * pars0grm.c: The function yyparse() and the variables yychar, yylval, yynerrs
      
      The required changes to the Bison-generated file pars0grm.c will be addressed
      in a separate commit, which will add a script similar to make_flex.sh.
      
      The class ha_innodb is renamed from class ha_innobase by a #define.  Thus,
      there will be no clash with the builtin InnoDB.  However, there will be some
      overhead for invoking virtual methods of class ha_innodb.  Ideas for making
      the vtable hidden are welcome.  -fvisibility=hidden is not available in GCC 3.
      2c2b06ad
  20. 25 Jan, 2008 1 commit
  21. 19 Dec, 2007 2 commits
    • marko's avatar
      branches/zip: Implement a limit for the size of undo log records. · 463141d1
      marko authored
      innodb-index.test: Add a test with a large number of externally stored
      columns.  Check that there may not be prefix indexes on too many columns.
      
      dict_index_too_big_for_undo(): New function: Check if the undo log may
      overflow.
      
      dict_index_add_to_cache(): Return DB_SUCCESS or DB_TOO_BIG_RECORD.
      Postpone the creation and linking of some data structures, so that
      when dict_index_too_big_for_undo() holds, it will be easier to clean up.
      Check the return status in all callers.
      463141d1
    • marko's avatar
      branches/zip: dict0dict.c: Minor cleanup. · b33d8c40
      marko authored
      dict_index_copy(): Remove the prototype, because this static function
      will be defined before its first use.  Add const qualifier to "table".
      
      dict_index_build_internal_clust(), dict_index_build_internal_non_clust():
      Add const qualifier to "table".  Correct the comment about setting indexed[].
      b33d8c40
  22. 07 Dec, 2007 1 commit
    • marko's avatar
      branches/zip: dict_table_copy_types(): Initialize all fields to the SQL NULL · 5a6cc213
      marko authored
      value.  Document this change in behaviour, and make all callers invoke
      the function right after dtuple_create().
      
      dict_create_sys_fields_tuple(): Add a missing "break" statement to the loop
      that checks if there are any column prefixes in the index.
      
      row_get_prebuilt_insert_row(): Do not set the fields to the SQL NULL value,
      now that dict_table_copy_types() takes care of it.
      5a6cc213
  23. 16 Nov, 2007 1 commit
  24. 01 Oct, 2007 1 commit
  25. 27 Sep, 2007 1 commit
  26. 26 Sep, 2007 1 commit
    • marko's avatar
      branches/zip: Minor cleanup. · d0631476
      marko authored
      dict_find_index_by_max_id(): Rename this static function to its
      only caller, dict_table_get_index_by_max_id().
      
      dict_table_get_index_by_max_id(): Copy the function comment from
      dict_find_index_by_max_id().
      d0631476
  27. 24 Sep, 2007 1 commit
  28. 05 Sep, 2007 1 commit
    • marko's avatar
      branches/zip: Simplify crash recovery in fast index creation. · 52a89286
      marko authored
      trx_t: Remove dict_undo_list and dict_redo_list.
      
      innobase_create_temporary_tablename(): Replace TEMP_TABLE_PREFIX with
      a table name suffix "#1" or "#2".  In this way, the user can restore
      precious data, should anything go wrong.  It is possible to reach an
      inconsistent state, because the creation, deletion and renaming of
      single-table tablespaces are not transactional.
      
      ut_print_namel(), fil_make_ibd_name(), innobase_rename_table(): Remove
      the special treatment of TEMP_TABLE_PREFIX.
      
      Introduce TEMP_INDEX_PREFIX == 0xff for temporary indexes.  This byte
      cannot occur in index names since MySQL 4.1.  However, it might have
      been possible to use this byte in MySQL 4.0.
      
      recv_recovery_from_checkpoint_finish(): Call the new function
      row_merge_drop_temp_indexes(), to drop all indexes whose name starts
      with the byte 0xff.
      
      row_merge_rename_indexes(): Renamed from row_merge_rename_index().
      Remove the parameter "index".
      
      row_drop_table_for_mysql(): Uncon...
      52a89286
  29. 21 Aug, 2007 1 commit
  30. 20 Aug, 2007 1 commit
  31. 16 Aug, 2007 2 commits
  32. 02 Aug, 2007 1 commit
    • marko's avatar
      branches/zip: Ensure that the dictionary updates are atomic by keeping · 11665dc3
      marko authored
      the data dictionary locked across the operations.
      
      dict_table_decrement_handle_count(), row_prebuilt_free(): Add the flag
      dict_locked, to prevent the acquisition of dict_sys->mutex.
      
      innobase_rename_table(): Rename commit_flag to lock_and_commit,
      and do not acquire dict_sys->mutex or flush the log unless the flag is set.
      Remove bogus comment about utility threads, because the threads will
      be waken up by the upper-level function ha_innobase::rename_table().
      
      ha_innobase::add_index(): After creating a primary key, hold dict_sys->mutex
      across all dictionary operations.
      11665dc3
  33. 01 Aug, 2007 2 commits
  34. 20 Jun, 2007 1 commit
    • marko's avatar
      branches/zip: Enable calls to inlined InnoDB functions in ha_innodb.cc, · f29addba
      marko authored
      now that all of InnoDB code is built from a single Makefile and it should
      not be possible to build the modules with mutually incompatible options.
      
      #define INSIDE_HA_INNOBASE_CC: Remove.
      
      srv_sizeof_trx_t_in_ha_innodb_cc: Remove.
      
      dict_table_get_low_noninlined(): Remove.  This function was unused.
      
      Remove all _noninline functions.  Remove the _noninline suffix from
      all function calls in ha_innodb.cc.
      f29addba
  35. 19 Jun, 2007 1 commit