An error occurred fetching the project authors.
  1. 27 Sep, 2010 1 commit
    • Michael Widenius's avatar
      Move maria_upgrade() out of maria_init() as in standalone programs maria_data_root is not set. · f715c9c2
      Michael Widenius authored
      Fixed failing pbxt test
      
      
      include/maria.h:
        Added maria_upgrade()
      mysql-test/suite/pbxt/r/select.result:
        Don't print number of rows as this is not constant over different runs
      mysql-test/suite/pbxt/t/select.test:
        Don't print number of rows as this is not constant over different runs
      storage/maria/ha_maria.cc:
        Run maria_upgrade() before maria_init()
      storage/maria/ma_init.c:
        Move maria_upgrade() out of maria_init() as in standalone programs maria_data_root is not set.
      f715c9c2
  2. 14 Sep, 2010 1 commit
  3. 12 Sep, 2010 1 commit
  4. 10 Sep, 2010 1 commit
    • Michael Widenius's avatar
      Fix for LP#634943 "marked as crashed", "zerofilling" and "wrong data in... · b9890b05
      Michael Widenius authored
      Fix for LP#634943 "marked as crashed", "zerofilling" and "wrong data in bitmap" when recovering Aria tables
      This was an interaction of several bugs:
      - Tables marked as opened was not properly unmarked on recovery if there was not changes since checkpoint
      - zerofill of tables put wrong data in bitmap if directory for page was full
      - Tables was thought as 'moved' during recovery if they had a create_lsn bigger than the lsn in the control file.
      
      
      storage/maria/ha_maria.cc:
        If table is moved and crashed, threat it as crashed.
        (Not a related to this bug, but still good to have fixed)
      storage/maria/ma_blockrec.c:
        Make enough_free_entries_on_page() global
      storage/maria/ma_blockrec.h:
        Make enough_free_entries_on_page() global
      storage/maria/ma_check.c:
        If directory is full, mark page full. Fixes bug in zerofill
      storage/maria/ma_open.c:
        Don't marke files as MOVED during recovery if create_trid > trnman_max_trid, as this fails for tables created after checkpoint.
      storage/maria/ma_recovery.c:
        Reset open_count in file that was open during crash and was part of checkpoint.
        Fixed wrong warning of 'open count' after recovery of files that was not touched since checkpoint.
      storage/maria/maria_chk.c:
        Changed not documented option --log-dir to --logdir
        Document more of the options.
        Clean up output for --help
      storage/maria/trnman.c:
        Added DBUG_PRINT
      b9890b05
  5. 07 Sep, 2010 1 commit
    • Michael Widenius's avatar
      Fixed compiler failures when compiling non debug build · 5288f8c0
      Michael Widenius authored
      storage/maria/ha_maria.cc:
        Don't use 'trn' variable to avoid warning about not used variable
      storage/maria/ma_delete.c:
        Added __attribute__((unused))
      storage/maria/ma_key_recover.c:
        Added __attribute__((unused))
        Fixed wrong placement of #endif
      storage/maria/ma_key_recover.h:
        Fixed typo
      5288f8c0
  6. 05 Sep, 2010 1 commit
    • Michael Widenius's avatar
      Fixed bug that 'maria_read_log -a' didn't set max_trid when reparing tables. · 0f3d4b2f
      Michael Widenius authored
      Fixed bug in Aria when replacing short keys with long keys and a key tree both overflow and underflow at same time.
      Fixed several bugs when generating recovery logs when using RGQ with replacing long keys with short keys and vice versa.
      Lots of new DBUG_ASSERT()'s
      Added more information to recovery log to make it easier to know from where log entry orginated.
      Introduced MARIA_PAGE->org_size that tells what the size of the page was in last log entry. This allows us to find out if all key changes for index page was logged.
      Small code cleanups:
      - Introduced _ma_log_key_changes() to log crc of key page changes
      - Added share->max_index_block_size as max size of data one can put in key block (block_size - KEYPAGE_CHECKSUM_SIZE)
        This will later simplify adding a directory to index pages.
      - Write page number instead of page postition to DBUG log
      
      
      
      mysql-test/lib/v1/mysql-test-run.pl:
        Use --general-log instead of --log to disable warning when using RQG
      sql/mysqld.cc:
        If we have already sent ok to client when we get an error, log this to stderr
        Don't disable option --log-output if CSV engine is not supported.
      storage/maria/ha_maria.cc:
        Log queries to recovery log also in LOCK TABLES
      storage/maria/ma_check.c:
        If param->max_trid is set, use this value instead of max_trid_in_system().
        This is used by recovery to set max_trid to max seen trid so far.
        keyinfo->block_length - KEYPAGE_CHECKSUM_SIZE -> max_index_block_size (Style optimization)
      storage/maria/ma_delete.c:
        Mark tables crashed early
        Write page number instead of page position to debug log.
        Added parameter to ma_log_delete() and ma_log_prefix() that is logged so that we can find where wrong log entries where generated.
        Fixed bug where a page was not proplerly written when same key tree had both an overflow and underflow when deleting a key.
        keyinfo->block_length - KEYPAGE_CHECKSUM_SIZE => max_index_block_size (Style optimization)
        ma_log_delete() now has extra parameter of how many bytes from end of page should be appended to log for page (for page overflows)
      storage/maria/ma_key_recover.c:
        Added extra parameter to ma_log_prefix() to indicate what caused log entry.
        Update MARIA_PAGE->org_size when logging info about page.
        Much more DBUG_ASSERT()'s.
        Fix some bugs in maria_log_add() to handle page overflows.
        Added _ma_log_key_changes() to log crc of key page changes.
        If EXTRA_STORE_FULL_PAGE_IN_KEY_CHANGES is defines, log the resulting pages to log so one can trivally
        see how the resulting page should have looked like (for errors in CRC values)
      storage/maria/ma_key_recover.h:
        Added _ma_log_key_changes() which is only called if EXTRA_DEBUG_KEY_CHANGES is defined.
        Updated function prototypes.
      storage/maria/ma_loghandler.h:
        Added more values to en_key_debug, to get more exact location where things went wrong when logging to recovery log.
      storage/maria/ma_open.c:
        Initialize share->max_index_block_size
      storage/maria/ma_page.c:
        Added updating and testing of MARIA_PAGE->org_size
        Write page number instead of page postition to DBUG log
        Generate error if we read page with wrong data.
        Removed wrong assert: key_del_current != share->state.key_del.
        Simplify _ma_log_compact_keypage()
      storage/maria/ma_recovery.c:
        Set param.max_trid to max seen trid before running repair table (used for alter table to create index)
      storage/maria/ma_rt_key.c:
        Update call to _ma_log_delete()
      storage/maria/ma_rt_split.c:
        Use _ma_log_key_changes()
        Update MARIA_PAGE->org_size
      storage/maria/ma_unique.c:
        Remove casts
      storage/maria/ma_write.c:
        keyinfo->block_length - KEYPAGE_CHECKSUM_SIZE => share->max_index_block_length.
        Updated calls to _ma_log_prefix()
        Changed code to use _ma_log_key_changes()
        Update ma_page->org_size
        Fixed bug in _ma_log_split() for pages that overflow
        Added KEY_OP_DEBUG logging to functions
        Log KEYPAGE_FLAG in all log entries
      storage/maria/maria_def.h:
        Added SHARE->max_index_block_size
        Added MARIA_PAGE->org_size
      storage/maria/trnman.c:
        Reset flags for new transaction.
      0f3d4b2f
  7. 24 Aug, 2010 1 commit
    • Michael Widenius's avatar
      Increase some very old limits. · 31f66e55
      Michael Widenius authored
      This will give a smoother experience when using the Aria engine by those that are using default limits
      without still causing a notable problem for desktop users.
      31f66e55
  8. 23 Aug, 2010 1 commit
    • Michael Widenius's avatar
      Trivial fixes, more safe DBUG_ASSERT()'s and some more DBUG_ · 53310c6e
      Michael Widenius authored
      - CTRL-C now aborts 'source' commands in mysql client
      - Fix that thread id's are removed in convert-debug-for-diff.sh
      
      
      client/mysql.cc:
        CTRL-C now aborts 'source' commands
      scripts/convert-debug-for-diff.sh:
        Fix expression to remove thread id
      storage/maria/ha_maria.cc:
        Don't call DBUG_ASSERT() when we kill a query during REPAIR / ALTER TABLE
      storage/maria/ma_bitmap.c:
        Added DBUG_ASSERT() if we call _ma_bitmap_set_full_page_bits()
      storage/maria/ma_key_recover.c:
        Don't do an assert if table is marked crashed.
      storage/maria/ma_recovery.c:
        Added DBUG_ENTER
      53310c6e
  9. 06 Aug, 2010 1 commit
    • Michael Widenius's avatar
      Fix for LP#614265 Crash in _ma_unpin_all_pages / _ma_search on DELETE with Aria search engine · 50b43cf8
      Michael Widenius authored
      Fixed compiler warnings
      
      client/mysqlslap.c:
        Fixed compiler warnings
      mysql-test/suite/maria/r/maria.result:
        Test case for LP#614265
      mysql-test/suite/maria/t/maria.test:
        Test case for LP#614265
      mysql-test/suite/pbxt/t/skip_name_resolve-master.opt:
        Ensure that we get restart before test (as test uses show processlist)
      sql/handler.cc:
        Added cloned marker if clone was called (for safety checks & debugging)
      sql/handler.h:
        Added cloned marker if clone was called (for safety checks & debugging)
      storage/maria/ha_maria.cc:
        In clone call, set file->trn if cloned file had this set. This is needed as maria_create_trn_for_mysql() and thus file->trn is never set for cloned table.
        Ensure that file->trn is properly reset after calls to repair/check/zerofill.
        Increment locked table count if file->trn is set (as we decrement this in the unlock call)
      tests/mysql_client_test.c:
        Fixed compiler warnings
      50b43cf8
  10. 03 Aug, 2010 1 commit
    • unknown's avatar
      Fix for launchpad bug #612894 · f8e270db
      unknown authored
      Support of virtual columns added to maria engine.
      
      mysql-test/suite/vcol/r/vcol_handler_maria.result:
        Basic tests for virtual column and maria engine.
      mysql-test/suite/vcol/t/vcol_handler_maria.test:
        Basic tests for virtual column and maria engine.
      storage/maria/ha_maria.cc:
        Support of virtual columns added to maria engine.
      storage/maria/ha_maria.h:
        Support of virtual columns added to maria engine.
      f8e270db
  11. 30 Jul, 2010 1 commit
    • Michael Widenius's avatar
      Fix for LP#602604: RQG: ma_blockrec.c:6187:... · d2f8b7d0
      Michael Widenius authored
      Fix for LP#602604: RQG: ma_blockrec.c:6187: _ma_apply_redo_insert_row_head_or_tail: Assertion `0' failed on Maria engine recovery
      More DBUG_PRINT (to simplify future debugging)
      Aria: Added STATE_IN_REPAIR, which is set on start of repair. This allows us to see if 'crashed' flag was set intentionally.
      Aria: Some trivial speedup optimization
      Aria: Better warning if table was marked crashed by unfinnished repair
      
      
      mysql-test/lib/v1/mysql-test-run.pl:
        Fix so one can run RQG
      mysql-test/suite/maria/r/maria-recovery2.result:
        Update for new error message.
      mysys/stacktrace.c:
        Fixed compiler warning
      storage/maria/ha_maria.cc:
        More DBUG_PRINT
        Added STATE_IN_REPAIR flag, which is set on start of repair. This allows us to see if 'crashed' flag was set intentionally.
        Don't log query for dropping temporary table.
      storage/maria/ha_maria.h:
        Added prototype for drop_table()
      storage/maria/ma_blockrec.c:
        More DBUG_PRINT
        Make read_long_data() inline for most cases. (Trivial speedup optimization)
      storage/maria/ma_check.c:
        Better warning if table was marked crashed by unfinnished repair
      storage/maria/ma_open.c:
        More DBUG_PRINT
      storage/maria/ma_recovery.c:
        Give warning if found crashed table.
        Changed warning for tables that can't be opened.
      storage/maria/ma_recovery_util.c:
        Write warnings to DBUG file
      storage/maria/maria_chk.c:
        Added STATE_IN_REPAIR flag, which is set on start of repair. This allows us to see if 'crashed' flag was set intentionally.
      storage/maria/maria_def.h:
        Added maria_mark_in_repair(x)
      storage/maria/maria_read_log.c:
        Added option: --character-sets-dir
      storage/maria/trnman.c:
        By default set min_read_from to max value.
        This allows us to remove TRN:s from rows during recovery to get more space.
        This fixes bug LP#602604: RQG: ma_blockrec.c:6187: _ma_apply_redo_insert_row_head_or_tail: Assertion `0' failed on Maria engine recovery
      d2f8b7d0
  12. 23 Jul, 2010 1 commit
  13. 13 Jun, 2010 1 commit
    • Michael Widenius's avatar
      Fixed some bugs in the Maria storage engine · ec281a3c
      Michael Widenius authored
      - Changed default recovery mode from OFF to NORMAL to get automatic repair of not properly closed tables.
      - Fixed a rase condition when two threads calls external_lock and thr_lock() in different order. When this happend the transaction that called external lock first
        and thr_lock() last did not see see the rows from the other transaction, even if if it had to wait in thr_lock() for other to complete.
      - Fixed that one can run maria_chk on an automatcally recovered tables without warnings about too small transaction id
      - Don't give warning that crashed table could not be repaired if repair was disabled (and thus not run)
      - Fixed a error result from flush_key_cache() which caused a DBUG_ASSERT() when one was using concurrent reads on non transactional tables that was updated.
      
      client/mysqldump.c:
        Add "" around error message to make it more readable
      client/mysqltest.cc:
        Free environment variables
      mysql-test/r/mysqldump.result:
        Updated results
      mysql-test/r/openssl_1.result:
        Updated results
      mysql-test/suite/maria/r/maria-recover.result:
        Updated results
      mysql-test/suite/maria/r/maria3.result:
        Updated results
      mysql-test/suite/maria/t/maria3.test:
        Added more test of temporary tables
      storage/maria/ha_maria.cc:
        Changed default recovery mode from OFF to NORMAL to get automatic repair of not properly closed tables.
        Start transaction in ma_block_get_status() instead of in ha_maria::external_lock().
        - This fixes a rase condition when two threads calls external lock and thr_lock() in different order. When this happend the transaction that called external lock first and thr_lock() last did not see see the rows from the other transaction, even if if it had to wait in thr_lock() for other to complete.
        Store latest transaction id in controll file if recovery was done.
        - This allows one to run maria_chk on an automatcally recovered tables without warnings about too small transaction id
      storage/maria/ha_maria.h:
        Don't give warning that crashed table could not be repaired if repair was disabled (and thus not run)
      storage/maria/ma_blockrec.h:
        Added new function "_ma_block_get_status_no_versioning()"
      storage/maria/ma_init.c:
        Added hook to create trn in ma_block_get_status() if we are using MariaDB
      storage/maria/ma_open.c:
        Ensure we call _ma_block_get_status_no_versioning() for transactional tables without versioning (like tables with fulltext)
      storage/maria/ma_pagecache.c:
        Allow one to flush blocks that are pinned for read.
        This fixed a error result from flush_key_cache() which caused a DBUG_ASSERT() when one was using concurrent reads on non transactional tables that was updated.
      storage/maria/ma_recovery.c:
        Set maria_recovery_changed_data to 1 if recover changed something.
        Set max_trid_in_control_file to max found trn if we found a bigger trn.
        The allows will ensure that the control file is up to date after recovery which allows one to run maria_chk on the tables without warnings about too big trn
      storage/maria/ma_state.c:
        Call maria_create_trn_hook() in _ma_setup_live_state() instead of ha_maria::external_lock()
        This ensures that 'state' and trn are in sync and thus fixes the race condition mentioned for ha_maria.cc
      storage/maria/ma_static.c:
        Added maria_create_trn_hook() and maria_recovery_changed_data
      storage/maria/maria_def.h:
        Added MARIA_HANDLER->external_ptr, which is used to hold MariaDB thd.
        Added some new external variables
        Removed reference to non existing function: maria_concurrent_inserts()
      ec281a3c
  14. 01 Apr, 2010 1 commit
    • unknown's avatar
      Maria WL#61 · 20739646
      unknown authored
        
        Interface for maria extensions.
        Alternative plugin interface with additional info (maturity and string version).
      
      CMakeLists.txt:
        Maria plugin interface used.
      config/ac-macros/plugins.m4:
        Maria plugin interface used.
      configure.in:
        Maria plugin interface used.
      include/mysql/plugin.h:
        Maria plugin interface added.
      include/mysql/plugin_auth.h.pp:
        Maria plugin interface added.
      plugin/auth/auth_socket.c:
        Maria plugin interface added.
      plugin/auth/dialog.c:
        Maria plugin interface added.
      plugin/daemon_example/daemon_example.cc:
        Maria plugin interface added.
      plugin/fulltext/plugin_example.c:
        Maria plugin interface added.
      sql/ha_ndbcluster.cc:
        Maria plugin interface added.
      sql/ha_partition.cc:
        Maria plugin interface added.
      sql/log.cc:
        Maria plugin interface added.
      sql/sql_acl.cc:
        Maria plugin interface added.
      sql/sql_builtin.cc.in:
        Maria plugin interface used.
      sql/sql_plugin.cc:
        Maria plugin interface added.
      sql/sql_plugin.h:
        Maria plugin interface used.
      sql/sql_show.cc:
        Maria plugin interface added.
      storage/archive/ha_archive.cc:
        Maria plugin interface added.
      storage/blackhole/ha_blackhole.cc:
        Maria plugin interface added.
      storage/csv/ha_tina.cc:
        Maria plugin interface added.
      storage/example/ha_example.cc:
        Maria plugin interface added.
      storage/federated/ha_federated.cc:
        Maria plugin interface added.
      storage/federatedx/ha_federatedx.cc:
        Maria plugin interface added.
      storage/heap/ha_heap.cc:
        Maria plugin interface added.
      storage/ibmdb2i/ha_ibmdb2i.cc:
        Maria plugin interface added.
      storage/innobase/handler/ha_innodb.cc:
        Maria plugin interface added.
      storage/innodb_plugin/handler/i_s.cc:
        Maria plugin interface added.
      storage/maria/ha_maria.cc:
        Maria plugin interface added.
      storage/myisam/ha_myisam.cc:
        Maria plugin interface added.
      storage/myisammrg/ha_myisammrg.cc:
        Maria plugin interface added.
      storage/pbxt/src/ha_pbxt.cc:
        Maria plugin interface added.
      storage/xtradb/handler/ha_innodb.cc:
        Maria plugin interface added.
      storage/xtradb/handler/i_s.cc:
        Maria plugin interface added.
      storage/xtradb/handler/i_s.h:
        Maria plugin interface added.
      20739646
  15. 12 Feb, 2010 2 commits
    • Michael Widenius's avatar
      Fix for LPBUG#516148 Test maria.maria3 fails when --without-maria-tmp-tables is set · 6e7241ca
      Michael Widenius authored
      mysql-test/suite/maria/r/maria3.result:
        Updated test results
      mysql-test/suite/maria/t/maria3.test:
        Don't show maria_used_for_temp_tables, as it's value is depending on configure options
      6e7241ca
    • unknown's avatar
      Group commit for maria engine. · abb87914
      unknown authored
      mysql-test/suite/maria/r/group_commit.result:
        Test of gruoup commit.
      mysql-test/suite/maria/r/maria3.result:
        The new variables added.
      mysql-test/suite/maria/t/group_commit.test:
        Test of group commit.
      randgen:
        Randon query generator tests.
      randgen/conf:
        Random query generator tests.
      randgen/conf/maria_group_commit.yy:
        Random query generator test for group commit.
      storage/maria/ha_maria.cc:
        New variables and support procedures for group commit added.
      storage/maria/ma_init.c:
        Correct shutdown of group commit service thread and group commit.
      storage/maria/ma_loghandler.c:
        Group commit added.
        Initialization of variables for embeded server edded.
      storage/maria/ma_loghandler.h:
        Group commit types and routines.
      abb87914
  16. 10 Feb, 2010 1 commit
    • Michael Widenius's avatar
      When one does a drop table, the indexes are not flushed to disk before drop... · d77e3cde
      Michael Widenius authored
      When one does a drop table, the indexes are not flushed to disk before drop anymore (with MyISAM/Maria)
      myisam-recover options changed from OFF to 'DEFAULT' to get less change of data loss when using MyISAM.
      (The disadvantage is that changed MyISAM tables will be checked at access time; Use --myisam-recover=OFF for old behavior)
      Don't call extra(HA_EXTRA_FORCE_REOPEN) in ALTER TABLE if table is locked as this will mark table as crashed!
      Added assert to detect if we accidently would use MyISAM versioning in MySQL
      
      include/my_base.h:
        Mark NOT_USED as USED, as we now use this as a flag to not call extra()
      mysql-test/mysql-test-run.pl:
        Don't write all options when there is something wrong with the arguments
      mysql-test/r/sp-destruct.result:
        Add missing flush of mysql.proc (as the test copied live tables)
      mysql-test/r/variables.result:
        myisam-recover options changed to 'default'
      mysql-test/r/view.result:
        Don't show create time in result
      mysql-test/suite/maria/t/maria-recovery2-master.opt:
        Don't run test with myisam-recover (as this produces extra warnings during simulated death)
      mysql-test/t/sp-destruct.test:
        Add missing flush of mysql.proc (as the test copied live tables)
      mysql-test/t/view.test:
        Don't show create time in result
      sql/lock.cc:
        Added marker if table was deleted to argument list
      sql/mysql_priv.h:
        Added marker if table was deleted to argument list
      sql/mysqld.cc:
        myisam-recover options changed from OFF to 'DEFAULT' to get less change of data loss when using MyISAM
        Allow one to specify OFF as argument to myisam-recover (was default before but one couldn't specify it)
      sql/sql_base.cc:
        Mark if table is going to be deleted
      sql/sql_delete.cc:
        Mark if table is going to be deleted
      sql/sql_table.cc:
        Mark if table is going to be deleted
        Don't call extra(HA_EXTRA_FORCE_REOPEN) in ALTER TABLE if table is locked as this will mark table as crashed!
      sql/table.cc:
        Signal to handler if table is getting deleted as part of getting droped from table cache.
      sql/table.h:
        Added marker if table is going to be deleted.
      storage/maria/ha_maria.cc:
        Don't search for transaction handler if file is not transactional or outside of transaction
        (Fixed possible core dump)
      storage/maria/ma_blockrec.c:
        Don't write changed information if table is going to be deleted.
      storage/maria/ma_close.c:
        Don't write changed information if table is going to be deleted.
      storage/maria/ma_extra.c:
        Mark tables that are deleted as crased, to ensure good behavior on restart if we suddenly crash.
      storage/maria/ma_locking.c:
        Cleanup
      storage/maria/ma_recovery.c:
        We need trnman to be inited during redo phase (to be able to open tables checked with maria_chk)
      storage/maria/maria_def.h:
        Added marker if table is going to be deleted.
      storage/myisam/mi_close.c:
        Don't write changed information if table is going to be deleted.
      storage/myisam/mi_extra.c:
        Mark tables that are deleted as crased, to ensure good behavior on restart if we suddenly crash.
      storage/myisam/mi_open.c:
        Added assert to detect if we accidently would use MyISAM versioning in MySQL
      storage/myisam/myisamdef.h:
        Added marker if table is going to be deleted.
      d77e3cde
  17. 29 Nov, 2009 1 commit
    • Michael Widenius's avatar
      Remove compiler warnings (Including some warnings from -Wstrict-aliasing) · d13c5435
      Michael Widenius authored
      Don't use static link by default (in compile-pentium) as some new systems doesn't have all static libraries available
      Change type for functions in plugin.h:str_mysql_ftparser_param() to const unsigned char and string lengths to size_t.
      One effect of the above change is that one needs to include mysql_global.h or define size_t before including plugin.h
      This fixes a case where mysql_client_test failed with newer gcc that enables strict-aliasing by default
      
      
      BUILD/compile-pentium:
        Don't use static link by default as some new systems doesn't have all static libraries available
      client/mysql_upgrade.c:
        Remove not used variable
      cmd-line-utils/readline/config_readline.h:
        Define some constants to get rid of compiler warnings on Linux
      cmd-line-utils/readline/display.c:
        Get rid of compiler warnings
      cmd-line-utils/readline/history.c:
        Got rid of compiler warnings:
        - Defining some strings as const
        - Added cast
      cmd-line-utils/readline/rlmbutil.h:
        Added cast to get rid of compiler warnings
      cmd-line-utils/readline/text.c:
        Remove not needed initialization to get rid of compiler warnings
      cmd-line-utils/readline/xmalloc.c:
        Changed types to 'const char* to get rid of compiler warnings
      configure.in:
        Ensure that we use MariaDB as suffix
      include/mysql/plugin.h:
        Changed types to 'const unsigned char* to get rid of compiler warnings (in other parts of the code)
        Change length for not \0 terminated string to size_t
      include/mysql/plugin.h.pp:
        Update related to plugin.h
      libmysql/libmysql.c:
        Fixed bug that caused core dump with newer gcc when strict aliasing is not turned off
      mysql-test/t/information_schema.test:
        Test is depending on innodb
      mysql-test/t/not_partition.test:
        Fixed wrong directory name
        (Not noticed before as we don't ususally run this test)
      mysys/lf_hash.c:
        Got rid of compiler warnings from -Wstrict-aliasing
      mysys/my_redel.c:
        Removed not used variable
      regex/engine.c:
        Changed types to 'const char* to get rid of compiler warnings
      regex/engine.ih:
        Changed types to 'const char* to get rid of compiler warnings
      sql/sp_head.cc:
        Got rid of compiler warning from -Wstrict-aliasing
      sql/sql_base.cc:
        Got rid of compiler warnings from -Wstrict-aliasing
        (The original code was probably wrong as nj_col->table_field was
      sql/sql_builtin.cc.in:
        plugin.h needs to have size_t defined
      sql/sql_parse.cc:
        Remove used variable
      sql/sql_select.cc:
        Got rid of compiler warnings from -Wstrict-aliasing
      sql/sql_show.cc:
        Added #ifdef to get rid of compiler warning when not using partition engine
      sql/table.cc:
        Got rid of compiler warning from -Wstrict-aliasing
      storage/maria/ha_maria.cc:
        Got rid of compiler warnings from -Wstrict-aliasing:
        - Use the thd_killed() API function
      storage/maria/lockman.c:
        Got rid of compiler warnings from -Wstrict-aliasing
      storage/maria/ma_check.c:
        Got rid of compiler warnings from -Wstrict-aliasing
        Change to use new version of _ma_killed_ptr; Don't call it as often as before
      storage/maria/ma_check_standalone.h:
        Update to compatible _ma_killed_ptr() from ha_maria.cc
      storage/maria/ma_ft_boolean_search.c:
        Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
      storage/maria/ma_ft_nlq_search.c:
        Got rid of compiler warnings from -Wstrict-aliasing
        Ensure that 'subkeys' is 32 bit
      storage/maria/ma_ft_parser.c:
        Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
      storage/maria/ma_ftdefs.h:
        Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
      storage/maria/ma_sort.c:
        Change to use new version of _ma_killed_ptr; Don't call it as often as before
      storage/maria/ma_state.c:
        Got rid of compiler warnings from -Wstrict-aliasing
      storage/maria/maria_def.h:
        Redefine ma_killed_ptr()
      storage/maria/maria_ftdump.c:
        Got rid of compiler warnings from -Wstrict-aliasing
      storage/maria/trnman.c:
        Got rid of compiler warnings from -Wstrict-aliasing
      storage/myisam/ft_boolean_search.c:
        Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
      storage/myisam/ft_nlq_search.c:
        Got rid of compiler warnings from -Wstrict-aliasing
      storage/myisam/ft_parser.c:
        Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
      storage/myisam/ft_stopwords.c:
        Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
      storage/myisam/ftdefs.h:
        Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
      storage/myisam/ha_myisam.cc:
        Got rid of compiler warnings from -Wstrict-aliasing:
        - Use the thd_killed() API function
      storage/myisam/mi_check.c:
        Use new killed_ptr() function
      storage/myisam/myisam_ftdump.c:
        Got rid of compiler warnings from -Wstrict-aliasing
      storage/myisam/myisamchk.c:
        Update to compatible killed_ptr() from ha_myisam.cc
      storage/myisam/myisamdef.h:
        Redefine killed_ptr()
      storage/myisam/myisamlog.c:
        Got rid of compiler warnings from -Wstrict-aliasing
      storage/myisam/sort.c:
        Change to use new version of killed_ptr; Don't call it as often as before
      storage/xtradb/fil/fil0fil.c:
        Fixedc ompiler warning
      storage/xtradb/trx/trx0i_s.c:
        Include mysql_plugin.h later to ensure that size_t is defined
      d13c5435
  18. 07 Nov, 2009 1 commit
  19. 26 Oct, 2009 1 commit
    • Michael Widenius's avatar
      Fixed compiler warning message · 5bddbc44
      Michael Widenius authored
      - Added checking of return value for system(), freopen(), fgets() and chown()
      - Ensure that calls that require a format strings gets a format string
      - Other trivial things
      Updated test suite results (especially for pbxt and embedded server)
      Removed warning for "Invalid (old?) table or database name 'mysqld.1'" from pbxt tests
      Speed up some pbxt tests by inserting begin ; commit; around "while loops with inserts"
      Added mysqld startup option '--debug-flush'
      Create maria_recovery.trace in data directory instead of current directory
      
      client/mysql.cc:
        Check return value from system()
      client/mysql_upgrade.c:
        Check return value from fgets()
      client/mysqladmin.cc:
        Check return value from fgets()
      client/mysqlslap.c:
        Check return value from system() (but ignore it, as it's not critical)
      extra/yassl/src/crypto_wrapper.cpp:
        Check return value from fgets() (but ignore it, as it's internal file)
      extra/yassl/taocrypt/src/aes.cpp:
        Added extra {} to remove compiler warning
      extra/yassl/taocrypt/src/blowfish.cpp:
        Added extra {} to remove compiler warning
      extra/yassl/taocrypt/src/misc.cpp:
        Ifdef not used code
      include/mysys_err.h:
        Added error message for failing chown()
      mysql-test/mysql-test-run.pl:
        Don't give warning for skipping ndbcluster (never enabled in MariaDB)
      mysql-test/suite/funcs_1/r/is_columns_is_embedded.result:
        Update with new information schema information
      mysql-test/suite/funcs_1/r/is_tables_is_embedded.result:
        New test
      mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result:
        Update test results (has not been tested for a long time)
      mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result:
        Update test results (has not been tested for a long time)
      mysql-test/suite/funcs_1/t/is_tables_is.test:
        Don't run with embedded server (as results differ)
        I added a new test for embedded server
      mysql-test/suite/funcs_1/t/is_tables_is_embedded.test:
        New test
      mysql-test/suite/pbxt/my.cnf:
        Allow one to run pbxt tests without having to specify --mysqld=--default-storage-engine=pbxt
      mysql-test/suite/pbxt/t/count_distinct3.test:
        Speed up test by inserting begin; ... commit;
      mysql-test/suite/pbxt/t/subselect.test:
        Speed up test by inserting begin; ... commit;
      mysys/errors.c:
        Added error message for failing chown()
      mysys/my_copy.c:
        Added error message for failing chown()
      mysys/my_redel.c:
        Added error message for failing chown()
      mysys/safemalloc.c:
        Added cast to get rid of compiler warning
      sql/ha_partition.cc:
        Fixed wrong argument to sql_print_error() (it requires a format string)
      sql/log.cc:
        Test return value of freopen()
      sql/mysqld.cc:
        Test return value of freopen()
        Added startup option '--debug-flush' to be used when one gets a core dump (easy to explain to people on IRC)
      sql/rpl_rli.cc:
        Fixed wrong argument to sql_print_error() (it requires a format string)
      sql/set_var.cc:
        Added {} to get rid of compiler warnings
      sql/slave.cc:
        Fixed wrong argument to mi->report() and sql_print...() (they require a format string)
      sql/sql_cache.cc:
        Fixed wrong argument to sql_printinformation() (it requires a format string)
      sql/sql_parse.cc:
        Test return value of fgets()
      sql/sql_plugin.cc:
        Fixed wrong argument to sql_print_error() (it requires a format string)
      sql/sql_select.cc:
        Use unique table name for internal temp tables instead of full path
        (Simple speed & space optimization)
      sql/udf_example.c:
        Removed compiler warning about not used variable
      storage/maria/ha_maria.cc:
        Fixed wrong argument to sql_print_error() and ma_check_print_error() (they require a format string)
      storage/maria/ma_recovery.c:
        Create maria_recovery.trace in data directory instead of current directory
      storage/maria/unittest/ma_test_loghandler-t.c:
        Fixed wrong argument to ok();  Requires a format string
      storage/pbxt/src/strutil_xt.cc:
        Detect temporary tables by checking if that path for the table is in the mysql data directory.
        The database for temporary tables is after this patch, from PBXT point of view, ""
        This is needed to stop PBXT from calling filename_to_tablename() with the base directory as an argument, which caused
        ERROR: Invalid (old?) table or database name 'mysqld.1'" in the log when running the test suite.
      tests/mysql_client_test.c:
        Fixed compiler warnings
      unittest/mysys/base64-t.c:
        Fixed wrong argument to diag() (it requires a format string)
        Added a comment that the current 'print' of differing buffers doesn't print the right thing,
        but didn't fix this as it's not important (unless we find a bug in the real code)
      5bddbc44
  20. 06 Oct, 2009 1 commit
    • unknown's avatar
      BUG#39249 Maria:query cache returns out of date results · 0c0e1f2e
      unknown authored
      BUG#41098 Query Cache returns wrong result with concurent insert
      
      BUILD/SETUP.sh:
        test build without query cache setup
      BUILD/compile-pentium-debug-max-no-qc:
        test build without query cache
      sql/mysql_priv.h:
        removed double declaration
      storage/maria/ha_maria.cc:
        query cache invalidation fixed
      storage/maria/ma_state.c:
        query cache invalidation fixed
      storage/maria/maria_def.h:
        last transaction ID added
        invalidation fixed
      storage/myisam/ha_myisam.cc:
        invalidation fixed
      storage/myisam/mi_locking.c:
        invalidation fixed
      storage/myisam/myisamdef.h:
        invalidation fixed
      0c0e1f2e
  21. 29 Jun, 2009 1 commit
    • Michael Widenius's avatar
      Added some changes inspired by Zardosht Kasheff: · bb557919
      Michael Widenius authored
      - Added a handler call (prepare_index_scan()) to inform storage engines that an index scan is about to take place.
      - Extended the maximun key parts for an index from 16 to 32
      - Extended MyISAM and Maria engines to support up to 32 parts
      
      Added checks for return value from ha_index_init()
      
      
      
      include/my_handler.h:
        Extended number of key parts for MyISAM and Maria from 16 to 32
      include/my_pthread.h:
        Ensure we always have 256M of stack.
        (Required to be able to handle the current number of keys and key parts in MyISAM)
      mysql-test/r/create.result:
        Extended to test for 32 key parts
      mysql-test/r/myisam.result:
        Test that we can create 32 but not 33 key parts
      mysql-test/r/ps_1general.result:
        Length of ref is now 2048 as we can have more key parts
      mysql-test/r/ps_2myisam.result:
        Length of ref is now 2048 as we can have more key parts
      mysql-test/r/ps_3innodb.result:
        Length of ref is now 2048 as we can have more key parts
      mysql-test/r/ps_4heap.result:
        Length of ref is now 2048 as we can have more key parts
      mysql-test/r/ps_5merge.result:
        Length of ref is now 2048 as we can have more key parts
      mysql-test/suite/maria/r/maria.result:
        Max key length is now 1208 bytes
      mysql-test/suite/maria/r/maria3.result:
        Max key length is now 1208 bytes
      mysql-test/suite/maria/r/ps_maria.result:
        Max key length is now 1208 byte
      mysql-test/t/create.test:
        Extended to test for 32 key parts
      mysql-test/t/myisam.test:
        Test that we can create 32 but not 33 key parts
      sql/handler.cc:
        Check return value from ha_index_init()
      sql/handler.h:
        Added a handler call (prepare_index_scan()) to inform storage engines that an index scan is about to take place.
      sql/sql_select.cc:
        Checks all return values from ha_index_init()
        Call prepare_index_scan()) to inform storage engines that an index scan is about to take place.
        Fixed indentation
      sql/table.cc:
        Fixed wrong types for key_length (rest of code assumed this was 32 bit)
      sql/unireg.h:
        Extended the maximun key parts for an index from 16 to 32
      storage/maria/ha_maria.cc:
        Don't allocate HA_CHECK on the stack in functions where we call repair() as HA_CHECK is HUGE and will overflow stack
      storage/myisam/ha_myisam.cc:
        Don't allocate HA_CHECK on the stack in functions where we call repair() as HA_CHECK is HUGE and will overflow stack
      storage/myisam/mi_check.c:
        Fixed wrong check if value overflow
      tests/mysql_client_test.c:
        Added fflush() to fix output in case of error
        Fixed wrong check of 'ref' length in EXPLAIN
      bb557919
  22. 06 May, 2009 1 commit
    • unknown's avatar
      We are now using Valgrind rather than purify, and have for quite some time. · b125770a
      unknown authored
      Consequently, rename HAVE_purify to HAVE_valgrind, and related changes.
      Leave some comments about purify when not clear that they apply also to Valgrind.
      Fix redundant IF_VALGRIND declaration.
      
      Misc. small fixes:
       - Fixes for pool-of-threads patch.
       - Fixes for push of PBXT storage engine.
       - mysql-test-run.pl fix.
       - Fix build problem in compile-pentium64-max.
      
      
      BUILD/SETUP.sh:
        Rename purify -> valgrind.
      BUILD/build_mccge.sh:
        Rename purify -> valgrind.
      BUILD/compile-dist:
        Fix that PBXT was missing in source tarball after `BUILD/compile-dist && make dist`
      BUILD/compile-pentium64-max:
        Fix a build problem with BUILD/compile-pentium64-max on CentOS/Fedora Core 10 amd64.
              
        On these systems, there is libz.so but no libz.a. Finding libz.so, ./configure decides
        to use system zlib. But since BUILD/compile-pentium64-max builds a fully static binary
        with -all-static, the link of mysqld fails due to missing libz.a.
              
        Fix by using bundled zlib in the build script.
      BUILD/compile-solaris-sparc-purify:
        Rename purify -> valgrind.
      include/m_string.h:
        Rename purify -> valgrind.
      include/my_global.h:
        Rename purify -> valgrind.
      mysql-test/Makefile.am:
        Fix that PBXT test suite was missing from `make dist` source tarball.
      mysql-test/lib/mtr_unique.pm:
        Better fix to avoid races when chmod'ing the semaphore file.
        (Though using chmod 666 shared files in /tmp/ is still not a very good solution).
      mysql-test/t/pool_of_threads.cnf:
        Fix that test case pool_of_threads fails if run on mysqld with no --with-libevent support.
      mysys/mf_qsort.c:
        Rename purify -> valgrind.
      mysys/my_alloc.c:
        Rename purify -> valgrind.
      mysys/my_init.c:
        Rename purify -> valgrind.
      mysys/my_rnd.c:
        Rename purify -> valgrind.
      mysys/safemalloc.c:
        Rename purify -> valgrind.
      scripts/mysql_config.pl.in:
        Rename purify -> valgrind.
      scripts/mysql_config.sh:
        Rename purify -> valgrind.
      sql/field_conv.cc:
        Rename purify -> valgrind.
      sql/filesort.cc:
        Rename purify -> valgrind.
      sql/ha_partition.cc:
        Rename purify -> valgrind.
      sql/hostname.cc:
        Rename purify -> valgrind.
      sql/item_timefunc.cc:
        Rename purify -> valgrind.
      sql/log_event.cc:
        Rename purify -> valgrind.
      sql/log_event_old.cc:
        Rename purify -> valgrind.
      sql/my_decimal.h:
        Rename purify -> valgrind.
      sql/mysqld.cc:
        Rename purify -> valgrind.
        Fix redundant IF_VALGRIND declaration.
      sql/opt_range.cc:
        Rename purify -> valgrind.
      sql/opt_range.h:
        Rename purify -> valgrind.
      sql/records.cc:
        Rename purify -> valgrind.
      sql/rpl_rli.cc:
        Rename purify -> valgrind.
      sql/rpl_rli.h:
        Rename purify -> valgrind.
      sql/set_var.cc:
        Fix missing static declaration on pool_of_threads.
      sql/slave.cc:
        Rename purify -> valgrind.
      sql/sql_base.cc:
        Rename purify -> valgrind.
      sql/sql_binlog.cc:
        Rename purify -> valgrind.
      sql/sql_class.cc:
        Rename purify -> valgrind.
      sql/sql_list.h:
        Rename purify -> valgrind.
      sql/sql_load.cc:
        Rename purify -> valgrind.
      sql/sql_select.cc:
        Rename purify -> valgrind.
      sql/table.cc:
        Rename purify -> valgrind.
      storage/archive/azio.c:
        Rename purify -> valgrind.
      storage/innobase/buf/buf0buf.c:
        Rename purify -> valgrind.
      storage/innobase/include/univ.i:
        Rename purify -> valgrind.
      storage/innobase/srv/srv0start.c:
        Rename purify -> valgrind.
      storage/maria/ha_maria.cc:
        Rename purify -> valgrind.
      storage/maria/ma_blockrec.c:
        Rename purify -> valgrind.
      storage/maria/ma_check.c:
        Rename purify -> valgrind.
      storage/maria/ma_loghandler.c:
        Rename purify -> valgrind.
      storage/maria/ma_packrec.c:
        Rename purify -> valgrind.
      storage/maria/ma_page.c:
        Rename purify -> valgrind.
      storage/maria/ma_pagecrc.c:
        Rename purify -> valgrind.
      storage/maria/ma_search.c:
        Rename purify -> valgrind.
      storage/myisam/mi_check.c:
        Rename purify -> valgrind.
      storage/myisam/mi_page.c:
        Rename purify -> valgrind.
      storage/myisam/mi_search.c:
        Rename purify -> valgrind.
      storage/myisammrg/ha_myisammrg.cc:
        Rename purify -> valgrind.
      strings/bcmp.c:
        Rename purify -> valgrind.
      strings/decimal.c:
        Rename purify -> valgrind.
      strings/strmake.c:
        Rename purify -> valgrind.
      b125770a
  23. 09 Feb, 2009 1 commit
  24. 31 Jan, 2009 1 commit
    • Michael Widenius's avatar
      Fixed compiler warnings found by gcc 4.3.2 · bd4e6551
      Michael Widenius authored
      - Added braces around expressions with &&, ||, & and |
      - Added empty line before ; for empty while and for loops
      - Added () around if with assignments
      - Removed const before function returning simple type
      
      Changed BUILD scripts to not build with NDB 
      
      
      BUILD/SETUP.sh:
        By default, don't build ndb with --max in Maria tree.
        NDB is not kept up to date anyway in 5.1
      client/mysql.cc:
        Added braces around && to get rid of compiler warnings
      sql/event_db_repository.cc:
        Added braces around && to get rid of compiler warnings
      sql/events.cc:
        Added braces around && to get rid of compiler warnings
      sql/field.cc:
        Added braces around && to get rid of compiler warnings
        Fixed for loops
      sql/field.h:
        Added braces around & to get rid of compiler warnings
      sql/field_conv.cc:
        Added braces around && to get rid of compiler warnings
        Fixed bug when copying between DATETIME fields and strict dates are used
        Removed not needeed else
      sql/gstream.cc:
        Added braces around && to get rid of compiler warnings
      sql/ha_ndbcluster.cc:
        Added braces around && to get rid of compiler warnings
        Added {} to get rid of compiler warnings
      sql/handler.cc:
        Added braces around && to get rid of compiler warnings
      sql/item.cc:
        Added braces around && to get rid of compiler warnings
      sql/item_cmpfunc.cc:
        Added braces around && to get rid of compiler warnings
        Removed some not needed space
      sql/item_func.cc:
        Added braces around && to get rid of compiler warnings
      sql/item_strfunc.cc:
        Added braces around && to get rid of compiler warnings
      sql/item_subselect.cc:
        Added braces around && to get rid of compiler warnings
      sql/item_sum.cc:
        Added braces around && to get rid of compiler warnings
      sql/item_timefunc.cc:
        Added braces around && to get rid of compiler warnings
      sql/item_xmlfunc.cc:
        Added empty line before ; for empty while and for loops
      sql/log.cc:
        Added braces around && to get rid of compiler warnings
      sql/log_event.cc:
        Added braces around && to get rid of compiler warnings
        Removed not needed else
      sql/log_event_old.cc:
        Added braces around && to get rid of compiler warnings
      sql/opt_range.cc:
        Added braces around && to get rid of compiler warnings
      sql/opt_sum.cc:
        Added braces around && to get rid of compiler warnings
      sql/set_var.cc:
        Added empty line before ; for empty while and for loops
        Added () around if with assignments
      sql/slave.cc:
        Added braces around && to get rid of compiler warnings
        Added empty line before ; for empty while and for loops
      sql/spatial.h:
        Added braces around && to get rid of compiler warnings
      sql/sql_acl.cc:
        Added braces around && to get rid of compiler warnings
      sql/sql_analyse.cc:
        Added empty line before ; for empty while and for loops
      sql/sql_base.cc:
        Added braces around && to get rid of compiler warnings
      sql/sql_connect.cc:
        Added braces around && to get rid of compiler warnings
      sql/sql_db.cc:
        Added braces around && to get rid of compiler warnings
      sql/sql_delete.cc:
        Added braces around && to get rid of compiler warnings
      sql/sql_help.cc:
        Added empty line before ; for empty while and for loops
      sql/sql_insert.cc:
        Added braces around && to get rid of compiler warnings
        Added () around if with assignments
      sql/sql_lex.cc:
        Cast char array references to uchar; Fixed wrong array referencing when using characters > ASCII 128 in SQL statments
        Added empty line before ; for empty while and for loops
        Trivial indent fixes
        Added braces around && to get rid of compiler warnings
      sql/sql_load.cc:
        Added braces around && to get rid of compiler warnings
      sql/sql_parse.cc:
        Added braces around && to get rid of compiler warnings
      sql/sql_partition.cc:
        Added braces around && to get rid of compiler warnings
      sql/sql_plugin.cc:
        Fixed bug in detecing if option variable should be readonly
        Added empty line before ; for empty while and for loops
      sql/sql_prepare.cc:
        Added braces around && to get rid of compiler warnings
      sql/sql_select.cc:
        Added braces around && to get rid of compiler warnings
        Added () around if with assignments
        Added empty line before ; for empty while and for loops
      sql/sql_show.cc:
        Added braces around && to get rid of compiler warnings
      sql/sql_table.cc:
        Added braces around && to get rid of compiler warnings
      sql/sql_trigger.cc:
        Added braces around && to get rid of compiler warnings
      sql/sql_update.cc:
        Added braces around && to get rid of compiler warnings
      sql/sql_yacc.yy:
        Added braces around && to get rid of compiler warnings
      sql/table.cc:
        Added braces around && to get rid of compiler warnings
      sql/table.h:
        Added braces around && to get rid of compiler warnings
      sql/time.cc:
        Added braces around && to get rid of compiler warnings
      sql/tztime.cc:
        Added braces around && to get rid of compiler warnings
      sql/uniques.cc:
        Added braces around && to get rid of compiler warnings
      storage/federated/ha_federated.cc:
        Fixed bug in testing of variable to ha_info() (Not critical)
      storage/heap/ha_heap.cc:
        Added braces around && to get rid of compiler warnings
      storage/maria/ha_maria.cc:
        Fixed bug: Mark that maria_log_dir_path is readonly
        Added braces around && to get rid of compiler warnings
      storage/ndb/include/ndbapi/NdbEventOperation.hpp:
        Removed const before function returning simple type
      storage/ndb/include/ndbapi/NdbOperation.hpp:
        Removed const before function returning simple type
      storage/ndb/src/ndbapi/Ndb.cpp:
        Added empty line before ; for empty while and for loops
      storage/ndb/src/ndbapi/NdbEventOperation.cpp:
        Removed const before function returning simple type
      storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp:
        Removed const before function returning simple type
      storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp:
        Removed const before function returning simple type
      storage/ndb/src/ndbapi/NdbRecAttr.cpp:
        Added empty line before ; for empty while and for loops
      storage/ndb/src/ndbapi/TransporterFacade.hpp:
        Added braces around && to get rid of compiler warnings
      bd4e6551
  25. 15 Jan, 2009 2 commits
    • Michael Widenius's avatar
      Log queries to maria_log if compiled with EXTRA_DEBUG · 3fca2390
      Michael Widenius authored
      Added DBUG_ASSERT() to unlikely error senario
      Don't use errno == 0 in maria_create() / myisam_create()
      
      sql/sql_insert.cc:
        Added DBUG_ASSERT() for case that should never happen in real life
        Added my_error() to avoid assert if mysql_lock() or postlock() doesn't call my_error()
      storage/maria/ha_maria.cc:
        Log queries to maria_log if compiled with EXTRA_DEBUG
      storage/maria/ma_create.c:
        Don't use errno == 0
      storage/maria/ma_loghandler.c:
        Added logging of debug info to maria_log
      storage/maria/ma_loghandler.h:
        Added logging of debug info to maria_log
      storage/maria/ma_recovery.c:
        Added printing of debug info from maria_log
      storage/maria/trnman.c:
        Added functions to read/store state in TRN
      storage/maria/trnman.h:
        Added functions to read/store state in TRN
      storage/maria/trnman_public.h:
        Added state in TRN to remmeber if we have already logged the query
      storage/myisam/mi_create.c:
        Don't use errno == 0
      3fca2390
    • Sergei Golubchik's avatar
      post-review fixes · 9c96fde1
      Sergei Golubchik authored
      include/atomic/generic-msvc.h:
        prevent possible compiler warnings
      include/lf.h:
        comments, better definition for LF_HASH_OVERHEAD
      include/maria.h:
        define MARIA_CANNOT_ROLLBACK here
      include/my_pthread.h:
        avoid possible name clash
      include/waiting_threads.h:
        comments, const, move WT_RESOURCE to waiting_threads.c
      mysql-test/suite/maria/r/maria_notembedded.result:
        new test
      mysql-test/suite/maria/t/maria_notembedded.test:
        new test - 5-way deadlock
      mysys/lf_hash.c:
        better definition for LF_HASH_OVERHEAD
      mysys/my_static.c:
        comment
      mysys/my_thr_init.c:
        casts
      mysys/waiting_threads.c:
        comments, asserts, etc
      server-tools/instance-manager/parse.cc:
        fix my_init_dynamic_array() to follow new calling conventions
      sql/mysqld.cc:
        call wt_init after set_proper_floating_point_mode
      sql/sql_class.h:
        comment
      storage/maria/ha_maria.cc:
        move MARIA_CANNOT_ROLLBACK to a common header
      storage/maria/ma_commit.c:
        comment
      storage/maria/ma_write.c:
        comments, check for HA_ERR_FOUND_DUPP_KEY
      storage/maria/trnman.c:
        comments, assert
      storage/maria/trnman.h:
        comments
      storage/maria/unittest/trnman-t.c:
        be paranoid
      unittest/mysys/lf-t.c:
        comments
      unittest/mysys/waiting_threads-t.c:
        comments, safety, memory leak
      9c96fde1
  26. 22 Dec, 2008 1 commit
    • Michael Widenius's avatar
      Fix for Bug#40311 Assert in MARIA_RECORD_POS during pushbuild 2 test: · 86fcfb15
      Michael Widenius authored
      Fixed bug when removing a newly inserted record (in case of duplicate key).
      The bug caused a crash for rows with several blobs and the first blob was small enough to fit into the head page.
      Don't change state_history if nothing changed (speed optimization that also simplifies logic).
      Reset state_history if we added/deleted or updated rows without versioning.
      Fixed wrong test in trnman_exists_active_transactions() if state is visible or not.
      
      Other bugs fixed:
      Fixed wrong argument to (lock->get_status) when we had to wait for TL_WRITE_CONCURRENT_INSERT.
      Item_equal::update_used_tables() didn't calculate const_item_cache properly.
      Added assert's to detect if join_read_const_table() was called under wrong assumptions..
      Fixed that _ma_setup_live_state() is called from thr_lock() instead of handler::external_lock().
      This was needed to get versioning information to be setup correctly.
      Fixed error in debug binaries during a call to _ma_check_table_is_closed() when another thread was opening/closing a table.
      Fixed wrong test when finding right history_state to use.
      
      mysql-test/suite/maria/r/maria.result:
        Added test for Bug#40311 Assert in MARIA_RECORD_POS during pushbuild 2 test
      mysql-test/suite/maria/t/maria.test:
        Added test for Bug#40311 Assert in MARIA_RECORD_POS during pushbuild 2 test
      mysys/thr_lock.c:
        Fixed wrong argument to (lock->get_status) when we had to wait for TL_WRITE_CONCURRENT_INSERT
      sql/item_cmpfunc.cc:
        Item_equal::update_used_tables() didn't calculate const_item_cache properly, which later caused a wrong result for item->const_item()
      sql/sql_base.cc:
        In debug mode, Initilize record buffer with unexpected data to catch usage of uninitialized memory
      sql/sql_select.cc:
        Fixed indentation
        Added assert's to detect if join_read_const_table() was called under wrong assumptions.
        One assert() is disabled for now as Item_equal() doesn't behave as expected.
      storage/maria/ha_maria.cc:
        Move calling to _ma_setup_live_state() to ma_state.c::_ma_block_get_status()
        This was needed as _ma_setup_live_state() needed to know if the table will be used concurrently or not
      storage/maria/ma_blockrec.c:
        Fixed bug when removing a newly inserted record (in case of duplicate key).
        The bug caused a crash for rows with several blobs and the first blob was small enough to fit into the head page.
      storage/maria/ma_dbug.c:
        Added mutex to protect the open table list during _ma_check_table_is_closed().
        Without the protection we could get a error in debug binaries during a call to _ma_check_table_is_closed()
      storage/maria/ma_delete_table.c:
        Removed not used code
      storage/maria/ma_rename.c:
        Removed not used code
      storage/maria/ma_state.c:
        Fixed wrong test when finding right history_state to use
        Mark in tables->state_current.no_transid if we are using transid's or not.
        Don't change state_history if nothing changed (speed optimization that also simplifies logic)
        Reset state_history if we added/deleted or updated rows without versioning.
        More DBUG_ASSERT's and more DBUG
        Updated maria_versioning() to initialize environment before calling _ma_blok_get_status(). This was needed because of the new logic in _ma_block_get_status()
      storage/maria/ma_state.h:
        Added flags to detect if table changed and/or if we changed table without versioning
      storage/maria/ma_write.c:
        Simple cleanups (No logic changes)
      storage/maria/trnman.c:
        Fixed wrong test in trnman_exists_active_transactions() if state is visible or not.
      86fcfb15
  27. 09 Dec, 2008 1 commit
    • Guilhem Bichot's avatar
      Fix for BUG#41159 "Maria: deadlock between checkpoint and maria_write() when extending data file". · c9a29373
      Guilhem Bichot authored
      No testcase (concurrency, tested by pushbuild2).
      
      storage/maria/ha_maria.cc:
        a comment about what Sanja had discovered a while ago
      storage/maria/ma_bitmap.c:
        guard against concurrent flush of bitmap by checkpoint: we must have close_lock here
      storage/maria/ma_blockrec.c:
        comment fixed for new behaviour
      storage/maria/ma_checkpoint.c:
        Release intern_lock before flushing bitmap, or it deadlocks with allocate_and_write_block_record()
        when that function needs to increase the data file's length (that function makes bitmap non flushable,
        then wants intern_lock to increase data_file_length).
        The checkpoint section which looks at the share's content (bitmap, state) needs to be protected from the possible
        my_free-ing done by a concurrent maria_close(); intern_lock is not enough as
        both maria_close() and checkpoint now have to release it in the middle.
        So the protection is done with close_lock. in_checkpoint is now protected by close_lock
        in places where it was protected by intern_lock.
      storage/maria/ma_close.c:
        hold close_lock in maria_close() from start to end, to guard against checkpoint trying to flush
        bitmap while we have my_free'd its structures, for example. intern_lock was not enough as
        both maria_close() and checkpoint have to release it in the middle, to avoid deadlocks.
      storage/maria/ma_open.c:
        initialize new mutex
      storage/maria/ma_recovery.c:
        a comment about what Sanja had discovered a while ago
      storage/maria/maria_def.h:
        comment.
        new mutex protecting the close of a MARIA_SHARE, from _start_ to _end_ of it.
      c9a29373
  28. 02 Dec, 2008 1 commit
    • Michael Widenius's avatar
      WL#3262 add mutex lock order checking to safemutex (also called safe_mutex_deadlock_detector) · 32f81bab
      Michael Widenius authored
      This writes a warning on stderr if one uses mutex in different order,
      like if one in one case would lock mutex in the order A,B and in another case
      would lock mutex in the order B,A
      This is inspired by and loosely based on the LOCKDEP patch by Jonas
      Wrong mutex order is either fixed or mutex are marked with MYF_NO_DEADLOCK_DETECTION
      if used inconsistently (need to be fixed by server team)
      
      KNOWN_BUGS.txt:
        Added information that one need to dump and restore Maria tables
      include/hash.h:
        Added prototype function for walking over all elements in a hash
      include/my_pthread.h:
        Added my_pthread_mutex_init() and my_pthread_mutex_lock(); These should be used if one wants to disable mutex order checking.
        Changed names of the nonposix mutex_init functions to not conflict with my_phread_mutex_init()
        Added and extended structures for mutex deadlock detection.
        New arguments to sage_mutex_init() and safe_mutex_lock() to allow one to disable mutex order checking.
        Added variable 'safe_mutex_deadlock_detector' to enable/disable deadlock detection for all pthread_mutex_init()
      mysys/Makefile.am:
        Added cleaning of test files
        Added test_thr_mutex
      mysys/hash.c:
        Added hash_iterate() to iterate over all elements in a hash
        More comments
      mysys/my_init.c:
        Added calls to destory all mutex uses by mysys()
        Added waiting for threads to end before calling TERMINATE() to list not freed memory
      mysys/my_pthread.c:
        Changed names to free my_pthread_mutex_init() for mutex-lock-order-checking
      mysys/my_sleep.c:
        Fixed too long wait if using 1000000L as argument
      mysys/my_thr_init.c:
        Mark THR_LOCK_threads and THR_LOCK_malloc to not have mutex deadlock detection.
        (We can't have it enabled for this as these are internal mutex used by the detector  
        Call my_thread_init() early as we need thread specific variables enabled for the following pthread_mutex_init()
        Move code to wait for threads to end to my_wait_for_other_threads_to_die()
        Don't destroy mutex and conditions unless all threads have died
        Added my_thread_destroy_mutex() to destroy all mutex used by the mysys thread system
        Name the thread specific mutex as "mysys_var->mutex"
        Added my_thread_var_mutex_in_use() to return pointer to mutex in use or 0 if thread variables are not initialized
      mysys/mysys_priv.h:
        Added prototypes for functions used internally with mutex-wrong-usage detection
      mysys/thr_mutex.c:
        Added runtime detection of mutex used in conflicting order
        See WL#3262 or test_thr_mutex.c for examples
        The base idea is for each mutex have two hashes:
        - mutex->locked_mutex points to all mutex used after this one
        - mutex->used_mutex points to all mutex which has this mutex in it's mutex->locked_mutex
        There is a wrong mutex order if any mutex currently locked before this mutex is in the mutex->locked_mutex hash
      sql/event_queue.cc:
        Mark mutex used inconsistently (need to be fixed by server team)
      sql/event_scheduler.cc:
        Declare the right order to take the mutex
      sql/events.cc:
        Mark mutex used inconsistently (need to be fixed by server team)
      sql/ha_ndbcluster_binlog.cc:
        Mark mutex used inconsistently (need to be fixed by server team)
      sql/log.cc:
        Mark mutex used inconsistently (need to be fixed by server team)
      sql/mysqld.cc:
        Use pthread_mutex_trylock instead of pthread_mutex_unlock() when sending kill signal to thread
        This is needed to avoid wrong mutex order as normally one takes 'current_mutex' before mysys_var->mutex.
        Added call to free sp cache.
        Add destruction of LOCK_server_started and COND_server_started.
        Added register_mutex_order() function to register in which order mutex should be taken
        (to initiailize mutex_deadlock_detector).
        Added option to turn off safe_mutex_deadlock_detector
      sql/protocol.cc:
        Fixed wrong argument to DBUG_PRINT (found by valgrind)
      sql/rpl_mi.cc:
        Mark mutex used inconsistently (need to be fixed by server team)
      sql/set_var.cc:
        Remove wrong locking of LOCK_global_system_variables when reading and setting log variables
        (would cause inconsistent mutex order).
        Update global variables outside of logger.unlock() as LOCK_global_system_variables has to be taken before logger locks
        Reviewed by gluh
      sql/sp_cache.cc:
        Added function to destroy mutex used by sp cache
      sql/sp_cache.h:
        Added function to destroy mutex used by sp cache
      sql/sql_class.cc:
        Use pthread_mutex_trylock instead of pthread_mutex_unlock() when sending kill signal to thread
        This is needed to avoid wrong mutex order as normally one takes 'current_mutex' before mysys_var->mutex.
        Register order in which LOCK_delete and mysys_var->mutex is taken
      sql/sql_insert.cc:
        Give a name for Delayed_insert::mutex
        Mark mutex used inconsistently (need to be fixed by server team)
        Move closing of tables outside of di->mutex (to avoid wrong mutex order)
      sql/sql_show.cc:
        Don't keep LOCK_global_system_variables locked over value->show_type() as this leads to wrong mutex order
      storage/innobase/handler/ha_innodb.cc:
        Disable safe_muted_deadlock_detector for innobase intern mutex (to speed up page cache initialization)
      storage/maria/ha_maria.cc:
        Added flag to ha_maria::info() to signal if we need to lock table share or not.
        This is needed to avoid locking mutex in wrong order
      storage/maria/ha_maria.h:
        Added flag to ha_maria::info() to signal if we need to lock table share or not.
      storage/maria/ma_close.c:
        Destroy key_del_lock
        Simplify freeing ftparser_param
      storage/maria/ma_key.c:
        Better comment
      storage/maria/ma_loghandler.c:
        Mark mutex used inconsistently (need to be fixed by sanja)
      storage/maria/ma_state.c:
        More comments
      storage/maria/ma_test1.c:
        Ensure that safe_mutex_deadlock_detector is always on (should be, this is just for safety)
      storage/maria/ma_test2.c:
        Ensure that safe_mutex_deadlock_detector is always on (should be, this is just for safety)
      32f81bab
  29. 01 Dec, 2008 1 commit
    • unknown's avatar
      Do not use MY_WME in the stat call which errors we process on high level. · 2b511502
      unknown authored
      (BUG#41127: Maria: assertion when SHOW ENGINE MARIA LOGS and missing logs)
      
      mysql-test/suite/maria/r/maria_showlog_error.result:
        test suite for the BUG#41127
      mysql-test/suite/maria/t/maria_showlog_error.test:
        test suite for the BUG#41127
      storage/maria/ha_maria.cc:
        Do not use MY_WME in the stat call which errors we process on high level.
      2b511502
  30. 03 Nov, 2008 1 commit
    • Michael Widenius's avatar
      Fixed bug introduced in last push. · d5456c5d
      Michael Widenius authored
      storage/maria/ha_maria.cc:
        Use file->s->lock_key_trees instead of file->s->lock.get_status to detect if we are using versioning
      storage/maria/ma_state.c:
        Fixed function prototype
      storage/maria/ma_state.h:
        Fixed function prototype
      d5456c5d
  31. 31 Oct, 2008 1 commit
    • Michael Widenius's avatar
      Added ha_maria::is_changed() (needed for Query cache) · 2b521320
      Michael Widenius authored
      storage/maria/ha_maria.cc:
        Added ha_maria::is_changed()
      storage/maria/ha_maria.h:
        Added ha_maria::is_changed()
      storage/maria/ma_delete.c:
        Mark that table changed
      storage/maria/ma_open.c:
        Ensure that info->state->changed is always reset from thr_lock()
      storage/maria/ma_state.c:
        Reset handler->state->changed at first usage of transactional table
        Reset handler->state->changed when taking lock for not transactional table
      storage/maria/ma_state.h:
        Added variable and function to track changes of table
      storage/maria/ma_update.c:
        Mark that table changed
      storage/maria/ma_write.c:
        Mark that table changed
      2b521320
  32. 16 Oct, 2008 1 commit
    • Guilhem Bichot's avatar
      Fix for BUG#39710 "Maria assertion in maria_disable_non_unique_index". · 421973ec
      Guilhem Bichot authored
      No testcase, this requires concurrency and is automatically tested by
      maria_bulk_insert.yy in pushbuild2.
      
      storage/maria/ha_maria.cc:
        The case of BUG#39710 is:
        two threads want to INSERT SELECT into the same table.
        Thread1 (T1) starts, does external_lock, thr_lock (store_lock sees 0 records so
        upgrades to TL_WRITE), goes into bulk insert, starts writes
        T2 starts, external_lock, thr_lock (store_lock sees 0 records so
        upgrades to TL_WRITE), blocks on existing thr_lock of T1.
        T1 ends writes, ends bulk insert, commits (ha_maria::implicit_commit()
        at end of dispatch_command()), external_lock and thr_unlock
        (close_thread_tables() at end of dispatch_command()).
        T2 wakes up, gets thr_lock, goes into start_bulk_insert() where
        file->state is out-of-date and still says that file->state->records==0,
        so maria_disable_non_unique_index() is called, which asserts because
        the actual number of records (share->state.state.records) is >0.
        The solution, maybe temporary, is to also check share->state.state.records==0
        when deciding to do bulk insert, with the idea that such operation cannot
        rely on the view of the start of the transaction, as it uses repair,
        and can safely read share->state as it has acquired the exclusive
        TL_WRITE.
        Question for reviewer: if we enter the if() branch, do we also need to do:
        *(file->state)= share->state.state;
        or even call some existing function which does that?
      421973ec
  33. 14 Oct, 2008 1 commit
    • Michael Widenius's avatar
      Merging of changes from myisam -> maria missing in last 5.1 - 5.1->maria merge · 32718418
      Michael Widenius authored
      MARIA_MAX_MSG_BUF -> HA_MAX_MSG_BUF
      
      include/maria.h:
        Remove MARIA_MAX_MSG_BUF; We are now using HA_MAX_MSG_BUF
        Added maria_test_invalid_symlink
      storage/maria/ha_maria.cc:
        MARIA_MAX_MSG_BUF -> HA_MAX_MSG_BUF
      storage/maria/ma_check.c:
        Removed tab in string constant
        Add extra argument to ma_open_datafile()
      storage/maria/ma_create.c:
        Set error number if table is in use
      storage/maria/ma_open.c:
        Added name argument to open functions for security check if filename is linked to another file in database directory
      storage/maria/ma_static.c:
        Default functions for checking if wrong symlink
      storage/maria/maria_chk.c:
        Add extra argument to _ma_open_datafile()
      storage/maria/maria_def.h:
        Add extra argument to _ma_open_datafile()
      32718418
  34. 09 Oct, 2008 1 commit
    • Guilhem Bichot's avatar
      Fix for BUG#39697 "Maria: hang when failing to insert due to UNIQUE (seen in pushbuild2 too)" · ade71b25
      Guilhem Bichot authored
      It was a forgotten rw_unlock(), due to the deadlock detector feature (so bug was only in 5.1-maria, not
      6.0-maria).
      
      mysql-test/suite/maria/r/maria3.result:
        result, all fine
      mysql-test/suite/maria/t/maria3.test:
        Test of BUG#39697: two scenarios (transactional tables, and non-transactional table but dynamic row format so still taking the rwlock) where the hang happened.
        t2 added by this test was masked by a temporary table created earlier in the test, which we forgot to drop.
      storage/maria/ha_maria.cc:
        use new macro
      storage/maria/ma_blockrec.c:
        use new macro
      storage/maria/ma_commit.c:
        use new macro
      storage/maria/ma_init.c:
        putting address of dummy_transaction_object in --debug trace can be useful
      storage/maria/ma_open.c:
        use new macro
      storage/maria/ma_write.c:
        if local_lock_tree is true, we have acquired keyinfo->root_lock so need to release it before "goto err".
        A pair of assertions so that our usage of TrIDs is kept sensible.
      storage/maria/maria_def.h:
        A macro so that changes of MARIA_HA::trn can be tracked with --debug. It helped to understand in what cases,
        in maria_write(), we could have !(info->dup_key_trid == info->trn->trid) && !share->now_transactional
        (answer: ALTER TABLE adding UNIQUE index on transactional table).
      ade71b25
  35. 28 Sep, 2008 1 commit
    • unknown's avatar
      Comparison of tables during altering fixed. (BUG#39399) · 51a92bbb
      unknown authored
      mysql-test/r/maria.result:
        Test suite of BUG#39399.
      mysql-test/t/maria.test:
        Test suite of BUG#39399.
      storage/maria/ha_maria.cc:
        Comparison of tables during altering fixed. (BUG#39399)
        Unused function parameter removed.
      51a92bbb
  36. 28 Aug, 2008 1 commit
    • Sergei Golubchik's avatar
      wt: comments, OOM checks, test case for deadlock detection · 942651ea
      Sergei Golubchik authored
      include/waiting_threads.h:
        make wt_thd_dontwait private
      mysql-test/r/maria.result:
        deadlock example
      mysql-test/t/maria.test:
        deadlock example
      mysys/waiting_threads.c:
        comments, OOM checks
      sql/mysqld.cc:
        fix variables
      sql/sql_class.cc:
        move wt_lazy_init to THD constructor
      sql/sql_class.h:
        move wt_lazy_init to THD constructor
      storage/maria/ha_maria.cc:
        backport from 6.0
      storage/maria/ma_write.c:
        poset-review fixes, set thd->proc_info
      storage/maria/trnman.c:
        bugfixing
      storage/myisam/mi_check.c:
        warnings
      storage/myisam/mi_page.c:
        warnings
      storage/myisam/mi_search.c:
        warnings
      storage/myisammrg/myrg_create.c:
        warnings
      unittest/mysys/waiting_threads-t.c:
        fixes
      942651ea
  37. 25 Aug, 2008 2 commits
    • Michael Widenius's avatar
      Changed all file names in maria to LEX_STRING and removed some calls to strlen() · 1a5de5bc
      Michael Widenius authored
      Ensure that pagecache gives correct error number even if error for block happend
      
      
      mysys/my_pread.c:
        Indentation fix
      storage/maria/ha_maria.cc:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_check.c:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_checkpoint.c:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_create.c:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_dbug.c:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_delete.c:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_info.c:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_keycache.c:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_locking.c:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_loghandler.c:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_open.c:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_pagecache.c:
        Store error number for last failed operation in the page block
        This should fix some asserts() when errno was not properly set after failure to read block in another thread
      storage/maria/ma_recovery.c:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_update.c:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_write.c:
        filenames changed to be of type LEX_STRING
      storage/maria/maria_def.h:
        filenames changed to be of type LEX_STRING
      storage/maria/maria_ftdump.c:
        filenames changed to be of type LEX_STRING
      storage/maria/maria_pack.c:
        filenames changed to be of type LEX_STRING
      1a5de5bc
    • Sergei Golubchik's avatar
      BUG#38606: delete in lock write concurrent · 4bdb308b
      Sergei Golubchik authored
      (sanja's patch)
      4bdb308b