1. 11 Jan, 2008 1 commit
  2. 10 Jan, 2008 8 commits
    • unknown's avatar
      Added --loose-skip-maria to MYSQLD_BOOTSTRAP_CMD to get bootstrap.test to work · 266fde77
      unknown authored
      Allow one to run bootstrap even if --skip-maria is used (needed for bootstrap.test)
      Fixed lots of compiler warnings
      
      NOTE:
      maria-big and maria-recover tests failes becasue of bugs in transaction log handling.
      Sanja knows about this and is working on it!
      
      
      mysql-test/mysql-test-run.pl:
        Added --loose-skip-maria to MYSQLD_BOOTSTRAP_CMD to get bootstrap.test to work
      mysql-test/r/maria-recovery.result:
        Updated results
      mysql-test/t/bootstrap.test:
        Removed not needed empty line
      mysql-test/t/change_user.test:
        Fixed results for 32 bit systems
      mysql-test/t/maria-big.test:
        Only run this when you use --big
      mysql-test/t/maria-recovery.test:
        Added test case for recovery with big blobs
      mysys/my_uuid.c:
        Fixed compiler warning
      sql/mysqld.cc:
        Allow one to run bootstrap even if --skip-maria is used (needed for bootstrap.test)
      sql/set_var.cc:
        Compare max_join_size with ULONG_MAX instead of HA_POS_ERROR as we set max_join_size to ULONG_MAX by default
      storage/maria/ma_bitmap.c:
        Added __attribute((unused)) to fix compiler warning
      storage/maria/ma_blockrec.c:
        Added casts to remove compiler warnings
        Change variable types to avoid compiler warnings
      storage/maria/ma_check.c:
        Added casts to remove compiler warnings
      storage/maria/ma_checkpoint.c:
        Change variable types to avoid compiler warnings
      storage/maria/ma_create.c:
        Change variable types to avoid compiler warnings
      storage/maria/ma_delete.c:
        Added casts to remove compiler warnings
      storage/maria/ma_key_recover.c:
        Added casts to remove compiler warnings
      storage/maria/ma_loghandler.c:
        Moved initiazation of prev_buffer first as this could otherwise not be set in case of errors
      storage/maria/ma_page.c:
        Added casts to remove compiler warnings
      storage/maria/ma_pagecache.c:
        Added __attribute((unused)) to fix compiler warning
      storage/maria/ma_pagecrc.c:
        Added #ifndef DBUG_OFF to remove compiler warning
      storage/maria/ma_recovery.c:
        Added casts to remove compiler warnings
      storage/maria/ma_write.c:
        Added casts to remove compiler warnings
      storage/maria/maria_chk.c:
        Split long string into two to avoid compiler warnings
      storage/myisam/ft_boolean_search.c:
        Added LINT_INIT() to remove compiler warning
      support-files/compiler_warnings.supp:
        Suppress wrong compiler warning
      unittest/mytap/tap.c:
        Fixed declaration to match prototypes to remove compiler warnings
      266fde77
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-maria · 674f0198
      unknown authored
      into  mysql.com:/home/my/mysql-maria
      
      
      sql/mysqld.cc:
        Auto merged
      storage/maria/ma_check.c:
        Auto merged
      storage/maria/ma_create.c:
        Auto merged
      storage/maria/ma_recovery.c:
        Auto merged
      storage/maria/ma_test2.c:
        Auto merged
      storage/maria/maria_def.h:
        Auto merged
      storage/maria/maria_pack.c:
        Auto merged
      storage/myisam/mi_test2.c:
        Auto merged
      storage/maria/ma_pagecache.c:
        Auto merged
      storage/maria/ha_maria.cc:
        Manual (trival) merge
      674f0198
    • unknown's avatar
      Added --with-maria-tmp-tables (default one) to allow on to configure if Maria... · 5ad477f6
      unknown authored
      Added --with-maria-tmp-tables (default one) to allow on to configure if Maria should be used for internal temporary tables
      Abort mysqld if Maria engine didn't start and we are using Maria for temporary tables
      Fixed bug that caused update of big blobs to crash
      Use pagecache_page_no_t as type for pages (to get rid of compiler warnings)
      Added cast to get rid of compiler warning
      Fixed wrong types of variables and arguments that caused lost information
      Fixed wrong DBUG_ASSERT() that caused REDO of big blobs to fail
      Removed some historical ifdefs that caused problem with windows compilations
      
      
      BUILD/SETUP.sh:
        Added --with-maria-tmp-tables
      include/maria.h:
        Use pagecache_page_no_t as type for pages
        Use my_bool as parameter for 'rep_quick' option
      include/my_base.h:
        Added comment
      mysql-test/r/maria-big.result:
        Added test that uses big blobs
      mysql-test/t/maria-big.test:
        Added test that uses big blobs
      sql/mysqld.cc:
        Abort mysqld if Maria engine didn't start and we are using Maria for temporary tables
      sql/sql_class.h:
        Don't use Maria for temporary tables if --with-maria-tmp-tables is not defined
      sql/sql_select.cc:
        Don't use Maria for temporary tables if --with-maria-tmp-tables is not defined
      storage/maria/ha_maria.cc:
        Fixed compiler warnings reported by MCC
        - Fixed usage of wrong types that caused data loss
        - Changed parameter for rep_quick to my_bool
        - Added safe casts
        
        Fixed indentation
      storage/maria/ma_bitmap.c:
        Use pagecache_page_no_t as type for pages
        Fixed compiler warnings
        Fixed bug that caused update of big blobs to crash
      storage/maria/ma_blockrec.c:
        Use pagecache_page_no_t as type for pages
        Use my_bool as parameter for 'rep_quick' option
        Fixed compiler warnings
        Fixed wrong DBUG_ASSERT()
      storage/maria/ma_blockrec.h:
        Use pagecache_page_no_t as type for pages
      storage/maria/ma_check.c:
        Fixed some wrong parameters where we didn't get all bits for test_flag
        Changed rep_quick to be of type my_bool
        Use pagecache_page_no_t as type for pages
        Added cast's to get rid of compiler warnings
        Changed type of record_pos to get rid of compiler warning
      storage/maria/ma_create.c:
        Added safe cast's to get rid of compiler warnings
      storage/maria/ma_dynrec.c:
        Fixed usage of wrong type
      storage/maria/ma_key.c:
        Fixed compiler warning
      storage/maria/ma_key_recover.c:
        Use pagecache_page_no_t as type for pages
      storage/maria/ma_loghandler_lsn.h:
        Added cast's to get rid of compiler warnings
      storage/maria/ma_page.c:
        Changed variable name from 'page' to 'pos' as it was an offset and not a page address
        Moved page_size inside block to get rid of compiler warning
      storage/maria/ma_pagecache.c:
        Fixed compiler warnings
        Replaced compile time assert with TODO
      storage/maria/ma_pagecache.h:
        Use pagecache_page_no_t as type for pages
      storage/maria/ma_pagecrc.c:
        Allow bitmap pages that is all zero
      storage/maria/ma_preload.c:
        Added cast to get rid of compiler warning
      storage/maria/ma_recovery.c:
        Changed types to get rid of compiler warnings
        Use bool for quick_repair to get rid of compiler warning
        Fixed some variables that was wrongly declared (not enough precission)
        Added cast to get rid of compiler warning
      storage/maria/ma_test2.c:
        Remove historical undefs
      storage/maria/maria_chk.c:
        Changed rep_quick to bool
        Fixed wrong parameter to maria_chk_data_link()
      storage/maria/maria_def.h:
        Use pagecache_page_no_t as type for pages
      storage/maria/maria_pack.c:
        Renamed isam -> maria
      storage/maria/plug.in:
        Added option --with-maria-tmp-tables
      storage/maria/trnman.c:
        Added cast to get rid of compiler warning
      storage/myisam/mi_test2.c:
        Remove historical undefs
      5ad477f6
    • unknown's avatar
      Merge vvaintroub@bk-internal.mysql.com:/home/bk/mysql-maria · 65395ead
      unknown authored
      into  vaio.:C:/bk/maria-wlad
      
      
      65395ead
    • unknown's avatar
      7ecafcd1
    • unknown's avatar
      Merge desktop.sanja.is.com.ua:/home/bell/mysql/bk/mysql-maria · 73c29e82
      unknown authored
      into  desktop.sanja.is.com.ua:/home/bell/mysql/bk/work-maria-pin
      
      
      storage/maria/ma_loghandler.c:
        Auto merged
      73c29e82
    • unknown's avatar
      Fixed syncronization of buffer flush. · 9dd2d08c
      unknown authored
      Debug asserts/prints from Monty.
      No check of mutex operations (by Monty).
      
      
      storage/maria/ma_control_file.c:
        New external function to check mutex ownership.
      storage/maria/ma_loghandler.h:
        No check of mutex operations (by Monty).
        New external function to check mutex ownership.
      9dd2d08c
    • unknown's avatar
      Windows fixes · ce8de7af
      unknown authored
      -new option WITH_MARIA_STORAGE_ENGINE for config.js
      -correct build errors
      -build test executables
      -downport changes for atomic functions from 5.2
      -remove LOCK_uuid_generator from C++ files to avoid linker errors
      -new function my_uuid2str()
      
      
      BitKeeper/deleted/.del-x86-msvc.h:
        Delete: include/atomic/x86-msvc.h
      CMakeLists.txt:
        Windows fixes:
        -New option WITH_MARIA_STORAGE_ENGINE
        -Add unit tests
      include/Makefile.am:
        replace x86-msvc.h with generic-msvc.h
      include/config-win.h:
        my_chmod() support
      include/my_atomic.h:
        Downport my_atomic from 5.2 tree
      include/my_bit.h:
        Correct unresolved symbol errors on Windows
      include/my_pthread.h:
        pthread_mutex_unlock now returns 0 (was void previously)
        defined PTHREAD_STACK_MIN
      include/my_sys.h:
        New function my_uuid2str()
        define MY_UUID_STRING_LENGTH
      include/atomic/nolock.h:
        Downport my_atomic from 5.2 tree
      libmysqld/CMakeLists.txt:
        New option WITH_MARIA_STORAGE_ENGINE
      mysys/CMakeLists.txt:
        Add missing files
      mysys/lf_dynarray.c:
        Fix compiler errors on Windows
      mysys/my_getncpus.c:
        Windows port
      mysys/my_uuid.c:
        Windows fixes: there is no random() on Windows, use ANSI rand()
        New function my_uuid2str()
      mysys/my_winthread.c:
        Downport from 5.2 tree
        -Call my_thread_end() before pthread_exit()
        -Avoid crash if pthread_create is called with NULL attributes
      sql/CMakeLists.txt:
        Link mysqld with Maria storage engine
      sql/item_func.cc:
        Remove LOCK_uuid_generator from C++ to avoid linker errors.
        Use dedicated mutex for short uuids
      sql/item_strfunc.cc:
        Use my_uuid() and my_uuid2str() functions from mysys.
      sql/item_strfunc.h:
        Define MY_UUID_STRING_LENGTH in my_sys.h
      sql/mysql_priv.h:
        LOCK_uuid_generator must be declared as extern "C"
      sql/mysqld.cc:
        Init and destroy LOCK_uuid_short mutex
      storage/maria/CMakeLists.txt:
        -Use the same source files as in Makefile.am
        -Build test binaries
      storage/maria/ha_maria.cc:
        snprintf->my_snprintf
      storage/maria/lockman.c:
        Fix compiler error on Windows
      storage/maria/ma_check.c:
        Fix compiler error on Windows
      storage/maria/ma_loghandler.c:
        Fix compile errors
        my_open()/my_sync() do not work for directories on Windows
      storage/maria/ma_recovery.c:
        Fix compile error on Windows
      storage/maria/ma_test2.c:
        Rename variable to avoid naming conflict with Microsoft C runtime 
        function
      storage/maria/ma_test3.c:
        Fix build errors on Windows
      storage/maria/tablockman.c:
        Fix build errors on Windows
      storage/maria/unittest/Makefile.am:
        Add CMakeLists.txt
      storage/maria/unittest/ma_pagecache_consist.c:
        Fix build errors on Windows
        remove loop from get_len()
      storage/maria/unittest/ma_pagecache_single.c:
        Fix build errors on Windows
      storage/maria/unittest/ma_test_loghandler-t.c:
        Windows fixes
        -Avoid division by 0 in expressions like
        x/(RAND_MAX/y), where y is larger than RAND_MAX(==0x7fff on Windows)
      storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
        Windows fixes
        -Avoid division by 0 in expressions like
        x/(RAND_MAX/y), where y is larger than RAND_MAX(==0x7fff on Windows)
        -remove loop in get_len()
      storage/maria/unittest/ma_test_loghandler_multithread-t.c:
        Windows fixes
        -Avoid division by 0 in expressions like
        x/(RAND_MAX/y), where y is larger than RAND_MAX(==0x7fff on Windows)
        -remove loop in get_len()
      storage/maria/unittest/ma_test_loghandler_noflush-t.c:
        Fix build errors on Windows
      storage/maria/unittest/test_file.c:
        Correct the code to get file size on Windows. 
        stat() information can be outdated and thus cannot be trusted.
        On Vista,stat() returns file size=0 until the file is closed at the
        first time.
      storage/myisam/CMakeLists.txt:
        Fix compiler errors on Windows
        Build test executables
      storage/myisam/mi_test2.c:
        Rename variable to avoid naming conflict with Microsoft C runtime 
        function
      storage/myisam/mi_test3.c:
        Fix build errors on Windows
      strings/CMakeLists.txt:
        Add missing file
      unittest/unit.pl:
        Windows:
        downport unittest changes from 5.2 bk tree
      unittest/mysys/Makefile.am:
        Windows:
        downport unittest changes from 5.2 bk tree
      unittest/mysys/my_atomic-t.c:
        Windows:
        downport unittest changes from 5.2 bk tree
      unittest/mytap/Makefile.am:
        Windows:
        downport unittest changes from 5.2 bk tree
      unittest/mytap/tap.c:
        Windows:
        downport unittest changes from 5.2 bk tree
      win/configure.js:
        Add WITH_MARIA_STORAGE_ENGINE configure option
      unittest/mytap/CMakeLists.txt:
        Add missing file
      unittest/mysys/CMakeLists.txt:
        Add missing file
      storage/maria/unittest/CMakeLists.txt:
        Add missing file
      BitKeeper/etc/ignore:
        Added comments maria-win.patch to the ignore list
      include/atomic/generic-msvc.h:
        Implement atomic operations with MSVC intrinsics
      ce8de7af
  3. 09 Jan, 2008 4 commits
  4. 08 Jan, 2008 5 commits
    • unknown's avatar
      New version of ma_test_all · 4bfd35c1
      unknown authored
      
      storage/maria/ma_test_all.sh:
        Added possibility to call ma_test_all-t directly with the old script.
        If any options were passed (such as --verbose) the script will
        be called directly.
      storage/maria/unittest/ma_test_all-t:
        Added new options --number-of-tests and --run-tests=...
        
        More verbose output
      4bfd35c1
    • unknown's avatar
      Added unlocking without unpinning to page cache. · 62d9e3eb
      unknown authored
      
      storage/maria/ma_pagecache.c:
        Support of unpinning unlocked file.
      storage/maria/unittest/ma_pagecache_single.c:
        Fixed layout.
        Added test of new schema of using pagecache:
          unlocking without unpinning.
      62d9e3eb
    • unknown's avatar
      5d68fbc1
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-maria · 543071b2
      unknown authored
      into  mysql.com:/home/my/mysql-maria
      
      
      543071b2
    • unknown's avatar
      Use LOGREC_REDO_NEW_ROW_HEAD and LOGREC_REDO_NEW_ROW_TAIL when writing to a new page · e6bdb11f
      unknown authored
      This makes REDO safer as we then know when it's safe to ignore HA_ERR_WRONG_CRC from page cache
      Removed not used logged data for LOGREC_UNDO_ROW_DELETE and LOGREC_UNDO_ROW_UPDATE
      
      
      storage/maria/ma_blockrec.c:
        Use LOGREC_REDO_NEW_ROW_HEAD and LOGREC_REDO_NEW_ROW_TAIL when writing to a new page
        This makes REDO safer as we then know when it's safe to ignore HA_ERR_WRONG_CRC from page cache
      storage/maria/ma_blockrec.h:
        Fixed prototype
      storage/maria/ma_key_recover.c:
        Removed not used logged data for LOGREC_UNDO_ROW_DELETE and LOGREC_UNDO_ROW_UPDATE
      storage/maria/ma_loghandler.c:
        Use LOGREC_REDO_NEW_ROW_HEAD and LOGREC_REDO_NEW_ROW_TAIL when writing to a new page
      storage/maria/ma_loghandler.h:
        Added LOGREC_REDO_NEW_ROW_HEAD and LOGREC_REDO_NEW_ROW_TAIL
      storage/maria/ma_recovery.c:
        Added support for LOGREC_REDO_NEW_ROW_HEAD and LOGREC_REDO_NEW_ROW_TAIL
      e6bdb11f
  5. 07 Jan, 2008 5 commits
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-maria · b8416bce
      unknown authored
      into  janus.mylan:/usr/home/serg/Abk/mysql-maria
      
      
      dbug/dbug.c:
        Auto merged
      include/my_dbug.h:
        Auto merged
      storage/maria/ha_maria.cc:
        Auto merged
      storage/maria/ma_check.c:
        Auto merged
      storage/maria/ma_open.c:
        Auto merged
      storage/maria/maria_def.h:
        Auto merged
      b8416bce
    • unknown's avatar
      cleanup · 0bbccfde
      unknown authored
      
      include/my_dbug.h:
        formatting
      0bbccfde
    • unknown's avatar
      3c44bca6
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-maria · 7e7c534b
      unknown authored
      into  mysql.com:/home/my/mysql-maria
      
      
      scripts/mysql_fix_privilege_tables.sh:
        Manual merge
      storage/maria/unittest/ma_test_all-t:
        Manual merge
      7e7c534b
    • unknown's avatar
      Bugs fixed: · b5df1d34
      unknown authored
      - If not in autocommit mode, delete rows one by one so that we can roll back if necessary
      - bitmap->used_size was not correctly set, which caused bitmap pages to be overwritten
      - Fixed bug in bitmap handling when allocation tail pages
      - Ensure we reserve place for directory entry when calculation place for head and tail pages
      - Fixed wrong value in bitmap->size[0]
      - Fixed wrong assert in flush_log_for_bitmap
      - Fixed bug in _ma_bitmap_release_unused() where tail blocks could be wrongly reset
      - Mark new pages as changed (Required to get repair() to work)
      - Fixed problem with advancing log horizon pointer within one page bounds
      - Fixed DBUG_ASSERT() when enable_indexes failes for end_bulk_insert()
      - Fixed bug in logging of rows with more than one big blob
      - Fixed DBUG_ASSERTS() in pagecache to allow change of WRITE_LOCK to READ_LOCK in unlock() calls
      - Flush pagecache when we change from logging to not logging (if not, pagecache code breaks)
      - Ensure my_errno is set on return from write/delete/update
      - Fixed bug when using FIELD_SKIP_PRESPACE
      
      New features:
      - mysql_fix_privilege_tables now first uses binaries and scripts from source distribution, then in installed distribution
      - Fix that optimize works for Maria tables
      - maria_check --zerofill now also clear freed blob pages
      - maria_check -di now prints more information about record page utilization
      
      Optimizations:
      - Use pagecache_unlock_by_link() instead of pagecache_write() if possible. (Avoids a memory copy and a find_block)
      - Simplify code to abort when we found optimal bit pattern
      - Skip also full head page bit patterns when searching for tail
      - Increase default repair buffer to 128M for maria_chk and maria_read_log
      - Increase default sort buffer for maria_chk to 64M
      - Increase size of sortbuffer and pagecache for mysqld to 64M
      - VARCHAR/CHAR fields are stored in increasing length order for BLOCK_RECORD tables
      
      Better reporting:
      - Fixed test of error condition for flush (for better error code)
      - More error messages to mysqld if Maria recovery fails
      - Always print warning if rows are deleted in repair
      - Added global function _db_force_flush() that is usable when doing debugging in gdb
      - Added call to my_debug_put_break_here() in case of some errors (for debugging)
      - Remove used testfiles in unittest as these was written in different directories depending on from where the test was started
      
      This should fix the bugs found when importing a big table with many varchars and one/many blobs to Maria
      
      
      dbug/dbug.c:
        Added global function _db_force_flush() that is usable when doing debugging in gdbine
      extra/replace.c:
        Fixed memory leak
      include/my_dbug.h:
        Prototype for _db_force_flush()
      include/my_global.h:
        Added stdarg.h as my_sys.h now depends on it.
      include/my_sys.h:
        Make my_dbug_put_break_here() a NOP if not DBUG build
        Added my_printv_error()
      include/myisamchk.h:
        Added entry 'lost' to be able to count space that is lost forever
      mysql-test/r/maria.result:
        Updated results
      mysql-test/t/maria.test:
        Reset autocommit after test
        New test to check if delete_all_rows is used (verified with --debug)
      mysys/my_error.c:
        Added my_printv_error()
      scripts/mysql_fix_privilege_tables.sh:
        First use binaries and scripts from source distribution, then in installed distribution
        This ensures that a development branch doesn't pick up wrong scripts)
      sql/mysqld.cc:
        Fix that one can break maria recovery with ^C when debugging
      sql/sql_class.cc:
        Removed #ifdef that has no effect
        (The preceeding DBUG_ASSERT() ensures that the following code will not be exectued)
      storage/maria/ha_maria.cc:
        Increase size of sortbuffer and pagecache to 64M
        Fix that optimize works for Maria tables
        Fixed DBUG_ASSERT() when enable_indexes failes for end_bulk_insert()
        If not in autocommit mode, delete rows one by one so that we can roll back if necessary
        Fixed variable comments
      storage/maria/ma_bitmap.c:
        More ASSERTS to detect overwrite of bitmap pages
        bitmap->used_size was not correctly set, which caused bitmap pages to be overwritten
        Ensure we reserve place for directory entry when calculation place for head and tail pages
        bitmap->size[0] should not include space for directory entry
        Simplify code to abort when we found optimal bit pattern
        Skip also full head page bit patterns when searching for tail (should speed up some common cases)
        Fixed bug in allocate_tail() when block->used was not aligned on 6 bytes
        Fixed wrong assert in flush_log_for_bitmap
        Fixed bug in _ma_bitmap_release_unused() where tail blocks could be wrongly reset
      storage/maria/ma_blockrec.c:
        Ensure my_errno is set on return
        Fixed not optimal setting of row->min_length if we don't have variable length fields
        Use pagecache_unlock_by_link() instead of pagecache_write() if possible. (Avoids a memory copy and a find_block)
        Added DBUG_ASSERT() if we read or write wrong VARCHAR data
        Added DBUG_ASSERT() to find out if row sizes are calculated wrong
        Fixed bug in logging of rows with more than one big blob
      storage/maria/ma_check.c:
        Disable logging while normal repair is done to avoid logging of index changes
        Fixed bug that caused CHECKSUM part of key page to be used
        Fixed that deleted of wrong records also works for BLOCK_RECORD
        Clear unallocated pages:
        - BLOB pages are not automaticly cleared on delete, so we need to use the bitmap to know if page is used or not
        Better error reporting
        More information about record page utilization
        Change printing of file position to printing of pages to make output more readable
        Always print warning if rows are deleted
      storage/maria/ma_create.c:
        Calculate share.base_max_pack_length more accurately for BLOCK_RECORD pages (for future)
        Fixed that FIELD_SKIP_PRESPACE is recorded as FIELD_NORMAL; Fixed bug where fields could be used in wrong order
        Store FIELD_SKIP_ZERO fields before CHAR and VARCHAR fields (optimization)
        Store other fields in length order (to get better utilization of head block)
      storage/maria/ma_delete.c:
        Ensure my_errno is set on return
      storage/maria/ma_dynrec.c:
        Indentation fix
      storage/maria/ma_locking.c:
        Set changed if open_count is counted down.
        (To avoid getting error "client is using or hasn't closed the table properly" with transactional tables
      storage/maria/ma_loghandler.c:
        Fixed problem with advancing log horizon pointer within one page bounds (Patch from Sanja)
        Added more DBUG
        Indentation fixes
      storage/maria/ma_open.c:
        Removed wrong casts
      storage/maria/ma_page.c:
        Fixed usage of PAGECACHE_LOCK_WRITE_UNLOCK with _ma_new()
        Mark new pages as changed (Required to get repair() to work)
      storage/maria/ma_pagecache.c:
        Fixed test of error condition for flush
        Fixed problem when using PAGECACHE_LOCK_WRITE_TO_READ with unlock()
        Added call to my_debug_put_break_here() in case of errors (for debugging)
      storage/maria/ma_pagecrc.c:
        Ensure we get same crc for 32 and 64 bit systems by forcing argument to maria_page_crc to uint32
      storage/maria/ma_recovery.c:
        Call my_printv_error() from eprint() to get critical errors to mysqld log
        Removed \n from error strings to eprint() to get nicer output in mysqld
        Added simple test in _ma_reenable_logging_for_table() to not do any work if not needed
      storage/maria/ma_update.c:
        Ensure my_errno is set on return
      storage/maria/ma_write.c:
        Ensure my_errno is set on return
      storage/maria/maria_chk.c:
        Use DEBUGGER_OFF if --debug is not use (to get slightly faster execution for debug binaries)
        Added option --skip-safemalloc
        Don't write exponents for rec/key
      storage/maria/maria_def.h:
        Increase default repair buffer to 128M for maria_chk and maria_read_log
        Increase default sort buffer for maria_chk to 64M
      storage/maria/unittest/Makefile.am:
        Don't update files automaticly from bitkeeper
      storage/maria/unittest/ma_pagecache_consist.c:
        Remove testfile at end
      storage/maria/unittest/ma_pagecache_single.c:
        Remove testfile at end
      storage/maria/unittest/ma_test_all-t:
        More tests
        Safer checking if test caused error
      b5df1d34
  6. 04 Jan, 2008 1 commit
    • unknown's avatar
      Bug fixes and new features to ma_test_all-t · cab8a363
      unknown authored
      
      scripts/mysql_fix_privilege_tables.sh:
        Fix a problem with events table not getting updated correctly.
        This happens when you run scripts/mysql_fix_privilege_tables and
        you have an old version of mysql_fix_privilege_tables.sql in
        the actual installation directory. This patch makes it look for
        the file inside the source dir first.
      storage/maria/unittest/ma_test_all-t:
        Added several new options for ma_test_all-t
        
        --verbose is handy, if you want to run the tests separately on the
        screen.
        
        Added functions for counting tests and a possibility to
        separate a group of tests inside an array of test.
      unittest/Makefile.am:
        Fixed a problem with make test not executing
        ma_test_all-t properly from the top source dir.
      cab8a363
  7. 03 Jan, 2008 1 commit
    • unknown's avatar
      Added wrapper for chmod(): my_chmod() · c719e1fd
      unknown authored
      Automaticly disable ma_test_recovery if not compiled with debugging. This fixes that make test works in Maria.
      Fixed wrong merge of ma_init.c from 5.1
      Portability fixes:
      - Use my_chmod() instead of my_chmod()
      - Use my_access() instead of my_stat() to test if file exists
      - Don't test result value of pthread_mutex_lock() and pthread_mutex_unlock() as this is not portable
      - No reason to test if file exists before we delete it
      
      
      
      include/my_sys.h:
        Added my_chmod
      include/mysys_err.h:
        Added error for my_chmod
      mysys/Makefile.am:
        Added my_chmod
      mysys/errors.c:
        Added error for my_chmod
      mysys/my_init.c:
        Syncronize with 5.1 to fix setting of QueryPerformanceFrequency()
      storage/maria/ma_test1.c:
        Changed short option of --skip-delete and --skip-update to be more logical
      storage/maria/ma_test_recovery.expected:
        Updated results after adding more tests
      storage/maria/ma_test_recovery:
        Abort test nicely if we are runnning without debugging
        Added more tests
        Changed temporary file names so that one can run maria_chk on them
        Removed some old comments
      storage/maria/maria_read_log.c:
        Added note if maria_read_log will not be able to create byte-to-byte identical tables compared to normal execution
      storage/maria/unittest/ma_pagecache_consist.c:
        Removed wrong setting of buff that caused memory overwrite
        Use my_chmod() instead of chmod()
        Don't test result value of pthread_mutex_lock() and pthread_mutex_unlock() as this is not portable
      storage/maria/unittest/ma_pagecache_single.c:
        Use my_chmod() instead of chmod()
        Don't test result value of pthread_mutex_lock() and pthread_mutex_unlock() as this is not portable
      storage/maria/unittest/ma_test_loghandler_first_lsn-t.c:
        No reason to test if file exists before we delete it
      storage/maria/unittest/ma_test_loghandler_multithread-t.c:
        Don't test result value of pthread_mutex_lock() and pthread_mutex_unlock() as this is not portable
      storage/maria/unittest/ma_test_loghandler_noflush-t.c:
        No reason to test if file exists before we delete it
      storage/maria/unittest/ma_test_loghandler_nologs-t.c:
        Use my_access() instead of my_stat() to test if file exists
      storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
        No reason to test if file exists before we delete it
        chmod -> my_chmod
      mysys/my_chmod.c:
        Added wrapper for chmod()
      c719e1fd
  8. 02 Jan, 2008 1 commit
    • unknown's avatar
      Disable logging of index pages during repair · f8b3e118
      unknown authored
      Fixed failure in unittest/ma_test_loghandler_pagecache-t
      Initialize pagecache callbacks explictily, not with pagecache_init().
      This is to make things more readable and for the future to make more choices with callbacks
      
      
      storage/maria/ha_maria.cc:
        Disable logging of index pages during repair
      storage/maria/ma_bitmap.c:
        Initialize callbacks explictily, not with pagecache_init(), to make things more readable and for future to have more choices with callbacks
        Use new interface to flush logs from pagecache
      storage/maria/ma_check.c:
        Fixed test for wrong keyblocks
        Use default functions to setup callbacks for pagecache
      storage/maria/ma_loghandler.c:
        Use dummy functions for log flush callback (NULL doesn't work anymore)
      storage/maria/ma_open.c:
        Initialize callbacks explictily, not with pagecache_init(), to make things more readable and for future to have more choices with callbacks
        Prefix external functions with _ma_
      storage/maria/ma_pagecache.c:
        Use new simpler interface to flush logs if needed
      storage/maria/ma_pagecache.h:
        Changed interface to a faster, simpler one to flush logs.
        Now we have a function that takes care of flushing logs, instead of a function to get lsn address
      storage/maria/ma_pagecrc.c:
        Add functions for flushing logs
      storage/maria/ma_recovery.c:
        Rename functions
      storage/maria/maria_chk.c:
        Use default functions to setup callbacks for pagecache
      storage/maria/maria_def.h:
        Prefixd global functions with _ma_
      storage/maria/unittest/ma_pagecache_consist.c:
        Use dummy functions for log flush callback (NULL doesn't work anymore)
      storage/maria/unittest/ma_pagecache_single.c:
        Use dummy functions for log flush callback (NULL doesn't work anymore)
      storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
        Use maria_flush_log_for_page to flush log pages. Fixes failure in unittest
      f8b3e118
  9. 01 Jan, 2008 2 commits
    • unknown's avatar
      after-merge fixes and comments · 98aad88f
      unknown authored
      
      mysql-test/include/maria_empty_logs.inc:
        At one moment in maria-recovery.test the first log has number 2,
        because log 1 was manually deleted.
      mysql-test/r/maria-recovery.result:
        after-merge fix
      mysql-test/t/maria-recovery.test:
        after-merge fix
      storage/maria/ma_bitmap.c:
        after-merge fix. The todo is implemented now.
      storage/maria/ma_blockrec.c:
        comment
      storage/maria/ma_open.c:
        after-merge fix. Set write_fail also for index file or a write error
        would crash.
      storage/maria/ma_pagecache.c:
        comment
      storage/maria/ma_pagecache.h:
        I prefer to use NULL for 'no callback' instead of a dummy callback
        in the special case of get_log_address; indeed for non-transactional
        tables it uses an if(), while if using a dummy callback, it would
        use a function call plus an if() (the dummy callback would need to
        return a magic value to say "don't flush" and that value would be
        tested in if()).
      storage/maria/unittest/ma_test_all-t:
        fix if running from outside storage/maria
      98aad88f
    • unknown's avatar
      Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-maria · a9c9364c
      unknown authored
      into  gbichot4.local:/home/mysql_src/mysql-maria-for-undo-phase
      
      
      a9c9364c
  10. 31 Dec, 2007 6 commits
    • unknown's avatar
      Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-maria · e5481cd4
      unknown authored
      into  gbichot4.local:/home/mysql_src/mysql-maria-for-undo-phase
      
      
      e5481cd4
    • unknown's avatar
      Fix results so that it works also if SAFEMALLOC is used · d4f28555
      unknown authored
      (When SAFEMALLOC is used, the value of MALLOC_OVERHEAD is different, which affect variable values)
      
      
      d4f28555
    • unknown's avatar
      Updated results · 0f9d36be
      unknown authored
      0f9d36be
    • unknown's avatar
      merge · 4902e804
      unknown authored
      4902e804
    • unknown's avatar
      Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-maria · 75a8907e
      unknown authored
      into  gbichot4.local:/home/mysql_src/mysql-maria-for-undo-phase
      
      
      storage/maria/ma_loghandler.c:
        Auto merged
      storage/maria/ma_recovery.c:
        Auto merged
      mysql-test/r/maria-recovery.result:
        merge
      mysql-test/t/maria-recovery.test:
        merge
      75a8907e
    • unknown's avatar
      Added maria_zerofill() · 6cad0204
      unknown authored
      This is used to bzero all not used parts of the index pages and compact and bzero the not used parts of the data pages of block-record type
      Added --zerofill (-z) option to maria_chk (Mostly code from Jani)
      Added now table states ZEROFILLED and MOVEABLE
      Set state.changed with new states when things changes
      
      
      include/maria.h:
        Added maria_zerofill
      include/myisamchk.h:
        Added option for zerofill
        Extend testflag to be 64 to allow for more flags
      mysql-test/r/create.result:
        Updated results after merge
      mysql-test/r/maria.result:
        Updated results after merge
      mysys/my_getopt.c:
        Removed not used variable
      sql/sql_show.cc:
        Fixed wrong page type
      storage/maria/ma_blockrec.c:
        Renamed compact_page() to ma_compact_block_page() and made it global
        Always zerofill half filled blob pages
        Set share.state.changed on REDO
      storage/maria/ma_blockrec.h:
        Added _ma_compact_block_page()
      storage/maria/ma_check.c:
        Added maria_zerofill()
        This is used to bzero all not used parts of the index pages and compact and bzero the not used parts of the data pages of block-record type
        This gives the following benefits:
        - Table is smaller if compressed
        - All LSN are removed for transactinal tables and this makes them movable between systems
        Dont set table states of we are using --quick
        Changed log entry for repair to use 8 bytes for flag
      storage/maria/ma_delete.c:
        Simplify code
        Update state.changed
      storage/maria/ma_key_recover.c:
        Update state.changed
      storage/maria/ma_locking.c:
        Set uuid for file on first change if it's not set (table was cleared with zerofill)
      storage/maria/ma_loghandler.c:
        Updated log entry for REDO_REPAIR_TABLE
      storage/maria/ma_recovery.c:
        Updated log entry for REDO_REPAIR_TABLE (flag is now 8 bytes)
        Set new bits in state.changed
      storage/maria/ma_test_all.sh:
        Nicer output
      storage/maria/ma_test_recovery.expected:
        Updated results (now states flags are visible)
      storage/maria/ma_update.c:
        Update state.changed
      storage/maria/ma_write.c:
        Simplify code
        Set state.changed
      storage/maria/maria_chk.c:
        Added option --zerofill
        Added printing of states for MOVABLE and ZEROFILLED
        MYD -> MAD
        MYI -> MAI
      storage/maria/maria_def.h:
        Added states STATE_NOT_MOVABLE and STATE_NOT_ZEROFILLED
        Added prototype for new functions
      storage/maria/unittest/ma_test_all-t:
        More tests, including tests for zerofill
        Removed some not needed 'print' statements
      storage/maria/unittest/ma_test_loghandler_multithread-t.c:
        Smaller buffer to not trash devlopment machines totally
      6cad0204
  11. 30 Dec, 2007 6 commits
    • unknown's avatar
      Maria: more log handler fixes for when logs manually deleted · e580e058
      unknown authored
      
      mysql-test/include/maria_empty_logs.inc:
        can now ask that control file be preserved
      mysql-test/lib/mtr_report.pl:
        expected warning (produced by translog_init() when log is missing)
      mysql-test/r/maria-recovery.result:
        result update
      mysql-test/t/maria-recovery.test:
        test of removing logs manually; recovery used to fail
      storage/maria/ma_loghandler.c:
        The addition to maria-recovery.test uncovered a bug: log 1 was
        manually deleted, Maria restarted, created log 2, then crash
        before a checkpoint: logs_found is TRUE, last_checkpoint_lsn
        is LSN_IMPOSSIBLE, so sure_page assumes that log 1 exists;
        using last_logno instead (only the last log needs to be checked,
        as the 'else' branch checks only after last_checkpoint_lsn:
        creation of a log is as good a starting point as a checkpoint,
        for scanning the log).
      e580e058
    • unknown's avatar
      Maria: when logs have been manually deleted, last_logno and last_checkpoint_lsn · 345451ce
      unknown authored
      must be updated correctly. And Recovery should not assume that
      log 1 is available but just use first available log.
      
      
      mysql-test/r/maria-purge.result:
        result update
      mysql-test/t/maria-purge.test:
        like in other Maria tests (4294967296 is too big, causes warning)
      storage/maria/ma_loghandler.c:
        When log handler starts and discovers that logs are missing though
        control file says they should be there (they have been manually
        deleted), it decides to create a log
        with number last_logno+1. It needs to update control file with
        this new number, and also reset last_checkpoint_lsn to LSN_IMPOSSIBLE
        (last checkpoint went away when log was deleted).
        Fix for when translog_init() fails before allocating id_to_share
        (translog_destroy() tried to free NULL).
      storage/maria/ma_recovery.c:
        When logs have been manually deleted, translog_first_theoretical_lsn()
        always fails (it looks for log number 1). Recovery now uses
        translog_first_lsn_in_log() which just picks the first available log.
      345451ce
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-maria · 1e9ee8ab
      unknown authored
      into  mysql.com:/home/my/mysql-maria
      
      
      dbug/dbug.c:
        Auto merged
      include/my_dbug.h:
        Auto merged
      include/my_global.h:
        Auto merged
      mysql-test/mysql-test-run.pl:
        Auto merged
      mysql-test/r/maria-recovery.result:
        Auto merged
      mysql-test/t/maria-recovery.test:
        Auto merged
      mysql-test/t/maria.test:
        Auto merged
      sql/mysqld.cc:
        Auto merged
      sql/sql_show.cc:
        Auto merged
      storage/maria/Makefile.am:
        Auto merged
      storage/maria/ha_maria.cc:
        Auto merged
      storage/maria/ma_bitmap.c:
        Auto merged
      storage/maria/ma_check.c:
        Auto merged
      storage/maria/ma_key_recover.c:
        Auto merged
      storage/maria/ma_loghandler.c:
        Auto merged
      storage/maria/ma_open.c:
        Auto merged
      storage/maria/ma_recovery.c:
        Auto merged
      storage/maria/maria_chk.c:
        Auto merged
      storage/maria/maria_def.h:
        Auto merged
      storage/maria/ma_test_all.sh:
        Use remote version
      mysql-test/r/maria.result:
        Trivial merge
      storage/maria/ma_pagecache.c:
        Trivial merge
      1e9ee8ab
    • unknown's avatar
      UNDO of rows now puts back all part of the row on their original pages and positions · bfd5c273
      unknown authored
      Added variable _dbug_on_ to speed up execution when DBUG is not going to be used
      Added --debug-on option to mysqld (to be able to turn of DBUG with --debug-on=0)
      Fixed some bugs with 'non_flushable' marking of bitmap pages
      Don't use 'non_flushable' marking of bitmap pages for not transactional tables
      SHOW CREATE TABLE now shows if table was created with page checksums
      Fixed a lot of bugs with BLOB handling in case of update/REDO and UNDO
      More tests (especially for blobs) and DBUG_ASSERTS()
      More readable output from maria_read_log and maria_chk
      Fixed wrong shift that caused Maria to crash on files > 4G
      Mark tables as crashed of REDO fails
      
      
      dbug/dbug.c:
        Changed to use my_bool (allowed me to remove some windows specific code)
        Added variable _dbug_on_ to speed up execution when DBUG is not going to be used
        Removed initialization of variables if not needed
      include/my_dbug.h:
        Use my_bool for some functions that was defined as BOOLEAN in dbug.c code
        Added DBUGGER_ON/DEBUGGER_OFF to speed up execution when DBUG is not used
      include/my_global.h:
        Define my_bool early
        Increase MY_HOW_OFTEN_TO_WRITE as computers are now faster than 10 years ago
      mysql-test/mysql-test-run.pl:
        Added debug-on=0 to speed up tests
      mysql-test/r/maria-recovery.result:
        Added new test by Guilhem to test if UNDO_ROW_DELETE preserves rowid
      mysql-test/r/maria.result:
        Added testing of page checksums
      mysql-test/t/crash_commit_before-master.opt:
        Added --debug-on as test require DBUG to work
      mysql-test/t/maria-recovery-bitmap-master.opt:
        Added --debug-on as test require DBUG to work
      mysql-test/t/maria-recovery-master.opt:
        Added --debug-on as test require DBUG to work
      mysql-test/t/maria-recovery.test:
        Added new test by Guilhem to test if UNDO_ROW_DELETE preserves rowid
      mysql-test/t/maria.test:
        Added testing of page checksums
      sql/mysqld.cc:
        Added --debug-on option (to be able to turn of DBUG with --debug-on=0)
        Indentation fixes
        Removed end spaces
      sql/sql_show.cc:
        Allow update_create_info() to inform MySQL if PACK_KEYS, NO_PACK_KEYS, CHECKSUM, PAGE_CHECKSUM or DELAY_KEY_WRITE is used
      storage/maria/Makefile.am:
        Added ma_test_big.sh
      storage/maria/ha_maria.cc:
        Store in create_info if page checksums are used (For SHOW CREATE TABLE)
      storage/maria/ma_bitmap.c:
        Added _ma_bitmap_wait_or_flush() to cause reader of bitmap pages to wait with reading until bitmap is flushed.
        Use TAIL_PAGE_COUNT_MARKER for tail pages
        Set 'sub_blocks' for and only for the head page or for the first extent of a blob. This is needed for store_extent_info() to be able to set START_EXTENT_BIT's
        Don't allocate more than 0x3ffff pages in one extent (We need bit 0x4000 as a START_EXTENT_BIT)
        Increase the calculated 'head_length' with the number of bytes used for extents.
        Update row->space_on_head_page also in _ma_bitmap_find_new_place()
        Make _ma_bitmap_get_page_bits() global. (Needed for UNDO handling)
        Changed _ma_bitmap_flushable() to take MARIA_HA instead of MARIA_SHARE.
        This was needed to be able to mark the handler if we had a 'non_flushable' call pending or not.
        Don't use 'non_flushable' marking of bitmap pages for not transactional tables.
        Added BLOCKUSED_USE_ORG_BITMAP handling also for tail pages.
        Added more DBUG_ASSERT() to find possible errors in other code
        Some code simplications by adding new local variables
      storage/maria/ma_blockrec.c:
        UNDO of rows now puts back all part of the row on their original pages and positions.
        Changed UNDO of DELETE and UNDO of UPDATE to contain information about the original length of data on head block and also extent information
        This changes a lot of logic as now an insert of a row on a page may happen to any position (and not just to the first or next free)
        Use PAGE_COUNT to mark if an extent is the start of of a blob. (Needed for extent_to_bitmap_blocks())
        Added check_directory() for checking that directroy entries are correct.
        Added checking of row checksums when reading rows (with EXTRA_DEBUG)
        Added make_space_for_directory() and extend_directory() for doing expansion of directory
        Added get_rowpos_in_head_or_tail_page() to be able to store head/tail on original position in UNDO
        Added extent_to_bitmap_blocks() to be able to generate original bitmap blocks from UNDO entry
        Added _ma_update_at_original_place() for UNDO of DELETES
        Added row->min_length to hold minmum required space needed on head page
        Changed find_free_position() to use make_space_for_directory()
        Changed make_empty_page() to allow optional creation of directory entry
        Changed delete_head_or_tail() and _ma_apply_undo_row_isnert() to not copy pagecache block (speed optimization)
        Changed _ma_apply_redo_insert_row_head_or_tail() to be able to insert new row at any position on 'new' page
        Changed _ma_apply_undo_row_delete() and _ma_apply_undo_row_update() to put row in it's original position
        Ensure allocation of tail blocks are of at least MIN_TAIL_SIZE.
        Ensure we store pages in pinned pages even if read failed. (If not we will have pages pinned forever in page cache)
        Write original extent information in UNDO entry, not compacted ones (we need position to tails!)
        When setting BLOCKUSED_USED, don't clear other bits (we have to preserve BLOCKUSED_USE_ORG_BITMAP)
        Fixed som bugs in directory handling
        Fixed bug where we wrote wrong lsn to blob pages
        Added separate blob_buffer for fixing bug when updating row that had char/varchar that spanned several pages and also had blobs
        Ensure we call _ma_bitmap_flushable() also in case of errors
        When doing an update, first delete old entries, then search in bitmap for where to put new information
        Info->s -> share
        Rowid -> rowid
        More DBUG_ASSERT()
      storage/maria/ma_blockrec.h:
        Added START_EXTENT_BIT and TAIL_PAGE_COUNT_MARKER
        Added _ma_bitmap_wait_or_flush() and _ma_bitmap_get_page_bits()
      storage/maria/ma_check.c:
        Don't write extra empty line if there is no deleted blocks
        Ignore START_EXTENT_BIT's in page count
        Call _ma_fast_unlock_key_del() to free key_del link
      storage/maria/ma_close.c:
        Ensure that used_key_del is 0. (If not, someone forgot to call _ma_unlock_key_del())
      storage/maria/ma_create.c:
        Changed constant to macro
      storage/maria/ma_delete.c:
        For deleted keys, log also position to row
      storage/maria/ma_extra.c:
        Release blob buffer at maria_reset() if bigger than MARIA_SMALL_BLOB_BUFFER
      storage/maria/ma_key_recover.c:
        Added bzero() of LSN that confused paged cache in case of uninitialized block
        Mark file crashed if applying of index changes fails
        Added calls to _ma_fast_unlock_key_del() for protection of shared key_del link.
      storage/maria/ma_locking.c:
        Added usage of MARIA_FILE_OPEN_COUNT_OFFSET
        Added _ma_mark_file_crashed()
      storage/maria/ma_loghandler.c:
        Fixed bug where we logged uninitialized memory
      storage/maria/ma_open.c:
        Moved state->changed to be at start of state info on disk to allow one to easly mark files as crashed
      storage/maria/ma_page.c:
        Disable 'dummy' checksumming of pages as this gave false warnings.
        (Need to investigate if this is ever needed)
      storage/maria/ma_pagecache.c:
        Fixed wrong shift that caused Maria to crash on files > 4G
      storage/maria/ma_recovery.c:
        In case of errors, start writing on new line if we where in %## %## printing mode (Made errors more readable)
        Changed global variable name from warnings -> recovery_warnings
        Use MARIA_FILE_CREATE_RENAME_LSN_OFFSET instead of constant
        Removed special handling of row position for deleted keys. Keys now always includes row positions
        _ma_apply_undo_row_delete() now gets page and row position
        Added check that we don't loop forever when handling undo's (in case of bug in undo chain)
        Print name of failed REDO/UNDO
      storage/maria/ma_recovery.h:
        Removed old comment
      storage/maria/ma_static.c:
        Chaned version number of Maria files to not accidently use old ones (becasue of change of ordering of status variables)
      storage/maria/ma_test2.c:
        Added option -u to specify number of rows to update
        Changed old option -u to be -A, as for ma_test1
        Fixed bug in update of rows with blobs (before blobs was always reset to empty on update)
        First created blob is now of max blob length to ensure we have at least one big blob in the table
      storage/maria/ma_test_all.sh:
        More tests
      storage/maria/ma_test_recovery.expected:
        Updated results
      storage/maria/ma_test_recovery:
        Changed tests to use bigger blobs (not just 1K)
        Added new tests that tests recovery of update with blobs
        Removed comparision of .MAD file as it's not guranteed that recovery from scratch gives identical data file as original update
        (compact_page() may be called at different times during normal execution and during REDO)
      storage/maria/ma_update.c:
        Simplify code (changed * to if)
      storage/maria/maria_chk.c:
        Make output more readable
      storage/maria/maria_def.h:
        Changed 'changed' to int to prepare for more bits
        Added 2 more bytes to status information
        Added 'st_mara_row->min_length' for storing min length needed on head page
        Added 'st_mara_handler->blob_buff & blob_buff_size' for storing blobs
        Moved all tunning parameters into one block
        Added MARIA_SMALL_BLOB_BUFFER
        Added _ma_mark_file_crashed()
      storage/myisam/mi_test2.c:
        Fixed bug in update of rows with blobs (before blobs was always reset to empty on update)
      storage/maria/ma_test_big.sh:
        Testing of insert, update, delete, recovery and undo of rows with blobs
        Thanks to the random-ness of ma_test2 this is likely to find most bugs in the row handling
      bfd5c273
    • unknown's avatar
      WL#3072 - Maria Recovery · 18bc7b69
      unknown authored
      * to honour WAL we now force the whole log when flushing a bitmap page.
      * ability to intentionally crash in various places for recovery testing
      * bugfix (dirty pages list found in checkpoint record was ignored)
      * smaller checkpoint record
      * misc small cleanups and comments
      
      
      mysql-test/include/maria_empty_logs.inc:
        maria-purge.test creates ~11 logs, remove them all
      mysql-test/r/maria-recovery-bitmap.result:
        result is good; without the _ma_bitmap_get_log_address() call,
        we got
        check   error   Bitmap at 0 has pages reserved outside of data file length
      mysql-test/r/maria-recovery.result:
        result update
      mysql-test/t/maria-recovery-bitmap.test:
        enable test of "bitmap-flush should flush whole log otherwise
        corrupted data file (bitmap ahead of data pages)".
      mysql-test/t/maria-recovery.test:
        test of checkpoint
      sql/sql_table.cc:
        comment
      storage/maria/ha_maria.cc:
        _ma_reenable_logging_for_table() now includes file->trn=0.
        At the end of repair() we don't need to re-enable logging, it is
        done already by caller (like copy_data_between_tables()); it sounds
        strange that this function could decide to re-enable, it should be
        up to caller who knows what other operations it plans. Removing this
        line led to assertion failure in maria_lock_database(F_UNLCK), fixed
        by removing the assertion: maria_lock_database()
        is here called in a context where F_UNLCK does not make the
        table visible to others so assertion is excessive, and external_lock()
        is already designed to honour the asserted condition.
        Ability to crash at the end of bulk insert when indices
        have been enabled.
      storage/maria/ma_bitmap.c:
        Better use pagecache_file_init() than set pagecache callbacks directly;
        and a new function to set those callbacks for bitmap so that we can
        reuse it.
        _ma_bitmap_get_log_address() is a pagecache get_log_address callback
        which causes the whole log to be flushed when a bitmap page
        is flushed by the page cache. This was required by WAL.
      storage/maria/ma_blockrec.c:
        get_log_address pagecache callback for data (non bitmap) pages:
        just reads the LSN from the page's content, like was hard-coded
        before in ma_pagecache.c.
      storage/maria/ma_blockrec.h:
        functions which need to be exported
      storage/maria/ma_check.c:
        create_new_data_handle() can be static.
        Ability to crash after rebuilding the index in OPTIMIZE,
        in REPAIR. my_lock() implemented already.
      storage/maria/ma_checkpoint.c:
        As MARIA_SHARE* is now accessible to pagecache_collect_changed_blocks_LSN(),
        we don't need to store kfile/dfile descriptors in checkpoint record,
        2-byte-id of the table plus one byte to say if this is data or index
        file is enough. So we go from 4+4 bytes per table down to 2+1.
      storage/maria/ma_commit.c:
        removing duplicate functions (see _ma_tmp_disable_logging_for_table())
      storage/maria/ma_extra.c:
        Monty fixed
      storage/maria/ma_key_recover.c:
        comment
      storage/maria/ma_locking.c:
        Sometimes other code does funny things with maria_lock_database(),
        like ha_maria::repair() calling it at start and end without going
        through ha_maria::external_lock(). So it happens that maria_lock_database()
        is called with now_transactional!=born_transactional.
      storage/maria/ma_loghandler.c:
        update to new prototype
      storage/maria/ma_open.c:
        set_data|index_pagecache_callbacks() need to be exported as
        they are now called when disabling/enabling transactionality.
      storage/maria/ma_pagecache.c:
        Removing PAGE_LSN_OFFSET, as much of the code relies on it being
        0 anyway (let's not give impression we can just change this constant).
        When flushing a page to disk, call the get_log_address callback to
        know up to which LSN the log should be flushed.
        As we now can access MARIA_SHARE* we can know share->id and store
        it into the checkpoint record; we thus go from 4 bytes per dirty page
        to 2+1.
      storage/maria/ma_pagecache.h:
        get_log_address callback
      storage/maria/ma_panic.c:
        No reason to reset pagecache callbacks in HA_PANIC_READ:
        all we do is reopen files if they were closed; callbacks should
        be in place already as 'info' exists; we just want to modify
        the file descriptors, not the full PAGECACHE_FILE structure.
        If we open data file and it was closed, share->bitmap.file needs
        to be set.
        Note that the modified code is disabled anyway.
      storage/maria/ma_recovery.c:
        Checkpoint record does not contain kfile/dfile descriptors anymore
        so code can be simplified. Hash key in all_dirty_pages is 
        not made from file_descriptor & pageno anymore, but
        index_or_data & table-short-id & pageno.
        If a table's create_rename_lsn is higher than record's LSN,
        we skip the table and don't fail if it's corrupted (because the LSNs
        say that we don't have to look at this table).
        If a table is skipped (for example due to create_rename_lsn),
        its UNDOs still cause undo_lsn to advance; this is so that if later
        we notice the transaction has to rollback we fail (as table should
        not be skipped in this case).
        Fixing a bug: the dirty_pages list was never used, because
        the LSN below which it was used was the minimum rec_lsn of dirty pages!
        It is now the min(checkpoint_start_log_horizon, min(trn's rec_lsn)).
        When we disable/reenable transactionality, we modify pagecache
        callbacks (needed for example for get_log_address: changing
        share->page_type is not enough anymore).
      storage/maria/ma_write.c:
        'records' and 'checksum' are protected: they are updated under
        log's mutex in write-hooks when UNDO is written.
      storage/maria/maria_chk.c:
        remove use of duplicate functions.
      storage/maria/maria_def.h:
        set_data|index_pagecache_callbacks() need to be exported;
        _ma_reenable_logging_for_table() changes to a real function.
      storage/maria/unittest/ma_pagecache_consist.c:
        new prototype
      storage/maria/unittest/ma_pagecache_single.c:
        new prototype
      storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
        new prototype
      18bc7b69
    • unknown's avatar
      dbug/remove_function_from_trace.pl · f2139087
      unknown authored
      
      dbug/remove_function_from_trace.pl:
        New BitKeeper file ``dbug/remove_function_from_trace.pl''
      f2139087