1. 06 Jan, 2012 1 commit
    • unknown's avatar
      MWL#192: non-blocking client API, after-review fixes. · 5b3aa73e
      unknown authored
      Main change is that non-blocking operation is now an option that must be
      explicitly enabled with mysql_option(mysql, MYSQL_OPT_NONBLOCK, ...)
      before any non-blocing operation can be used.
      
      Also the CLIENT_REMEMBER_OPTIONS flag is now always enabled and thus
      effectively ignored (it was not really useful anyway, and this simplifies
      things when non-blocking mysql_real_connect() fails).
      5b3aa73e
  2. 20 Sep, 2011 1 commit
    • unknown's avatar
      MWL#192: Non-blocking client API for libmysqlclient. · 35490612
      unknown authored
      All client functions that can block on I/O have alternate _start() and
      _cont() versions that do not block but return control back to the
      application, which can then issue I/O wait in its own fashion and later
      call back into the library to continue the operation.
      
      Works behind the scenes by spawning a co-routine/fiber to run the
      blocking operation and suspend it while waiting for I/O. This
      co-routine/fiber use is invisible to applications.
      
      For i368/x86_64 on GCC, uses very fast assembler co-routine support. On
      Windows uses native Win32 Fibers. Falls back to POSIX ucontext on other
      platforms. Assembler routines for more platforms are relatively easy to
      add by extending mysys/my_context.c, eg. similar to the Lua lcoco
      library.
      
      For testing, mysqltest and mysql_client_test are extended with the
      option --non-blocking-api. This causes the programs to use the
      non-blocking API for database access. mysql-test-run.pl has a similar
      option --non-blocking-api that uses this, as well as additional
      testcases.
      
      An example program tests/async_queries.c is included that uses the new
      non-blocking API with libevent to show how, in a single-threaded
      program, to issue many queries in parallel against a database.
      
      
      client/async_example.c:
        Fix const warning
        ******
        Fix bug with wrong timeout value for poll().
      include/Makefile.am:
        Fix missing include for `make dist`
      include/mysql.h:
        Add prototypes for all non-blocking API calls.
      include/mysql.h.pp:
        Add prototypes for all non-blocking API calls.
      mysys/my_context.c:
        Fix type warning for makecontext() function pointer argument.
      sql-common/mysql_async.c:
        Fix crashes in the non-blocking API for functions that can take MYSQL argument
        that is NULL.
      tests/Makefile.am:
        Add header file to `make dist`
      tests/mysql_client_test.c:
        Replace blocking calls with wrappers around the non-blocking calls, used in
        mysql_client_test to test the new non-blocking API.
      tests/nonblock-wrappers.h:
        Replace blocking calls with wrappers around the non-blocking calls, used in
        mysql_client_test to test the new non-blocking API.
      35490612
  3. 16 Aug, 2011 4 commits
  4. 15 Aug, 2011 5 commits
    • Michael Widenius's avatar
      Fixed recovery crash lp:814806 "Unclean shutdown corrupted Aria table blocking startup" · db2334da
      Michael Widenius authored
      storage/maria/ma_recovery.c:
        Moved trman_init() before parse_checkpoint_record() as this calls trnman functions if we have to open tables.
      db2334da
    • Michael Widenius's avatar
      Merge in bug fix from 5.1 · 7f569524
      Michael Widenius authored
      7f569524
    • Michael Widenius's avatar
      Increase server version · 5ecf655b
      Michael Widenius authored
      5ecf655b
    • Michael Widenius's avatar
      Fixed bug lp:826377 "Aria DB Format: Reading specific table from dump causes Wrong bytesec" · 003c93ea
      Michael Widenius authored
      The bug was that when using bulk insert combined with lock table, we intitalized the io cache with the wrong file position.
      This fixed a bug where MariaDB could not read in a table dump done with mysqldump.
      
      
      mysql-test/suite/maria/r/locking.result:
        Test case for locking + write cache bug
      mysql-test/suite/maria/t/locking.test:
        Test case for locking + write cache bug
      storage/maria/ma_extra.c:
        Initialize write cache used with bulk insert to correct file length.
        (The old code didn't work if one was using LOCK TABLE for the given table).
      003c93ea
    • Michael Widenius's avatar
      Fixes bugs found by testcase for lp:815022 and lp:726374 "ma_blockrec.c:3000:... · ae5c9231
      Michael Widenius authored
      Fixes bugs found by testcase for lp:815022 and lp:726374 "ma_blockrec.c:3000: write_block_record: Assertion `cur_block[1].page_count == 0' failed with a multi-index Aria workload"
      The issues was:
      - For some tables with a lot of not packed fields, we didn't allocate enough memory in head page which caused DBUG_ASSERT's
      - Removed wrong DBUG_ASSERT()
      - Fixed a problem with underflow() where it generates a key page where all keys didn't fit.
      - Max key length is now limited by block_size/3  (was block_size /2).  This is required for underflow() to work with packed keys.
      
      
      
      
      mysql-test/lib/v1/mysql-test-run.pl:
        Remove --alignment=8 as this doesn't work on 64 bit systems
      mysql-test/suite/maria/r/small_blocksize.result:
        Test case for Aria bug
      mysql-test/suite/maria/t/small_blocksize-master.opt:
        Test case for Aria bug
      mysql-test/suite/maria/t/small_blocksize.test:
        Test case for Aria bug
      storage/maria/ha_maria.cc:
        Fixed comment
      storage/maria/ma_bitmap.c:
        Fixed wrong variable usage in find_where_to_split_row() where we allocated too little memory for head page.
        We did not take into account space for head extents (long VARCHAR) when trying to split row on head page. This caused us to allocate too little space from bitmap which lead to ASSERT failures later.
      storage/maria/ma_blockrec.c:
        Made some argument const (to ensure they was not accidently changed)
        Removed wrong DBUG_ASSERT()
      storage/maria/ma_blockrec.h:
        Removed not used variable
      storage/maria/ma_delete.c:
        Added my_afree() in case of error
        More comments and DBUG_ASSERT() for underflow()
      storage/maria/ma_open.c:
        Make keyinfo->underflow_block_length smaller for packed keys. This has to be done as for long packed keys, underflow() otherwise generates a key page where all keys didn't fit.
      storage/maria/ma_page.c:
        New DBUG_ASSERT()
      storage/maria/ma_write.c:
        Fixed comment
      storage/maria/maria_def.h:
        We have to have space for at least 3 keys on a key page.
        (Otherwise the underflow() code doesn't work for packed keys, even when we have an underflow() for an empty key page)
      ae5c9231
  5. 12 Aug, 2011 2 commits
  6. 10 Aug, 2011 2 commits
    • Michael Widenius's avatar
      Fixed bug lp:814054 'Assertion `block->hash_link == hash_link &&... · d4af82c4
      Michael Widenius authored
      Fixed bug lp:814054 'Assertion `block->hash_link == hash_link && hash_link->block == block' in ma_pagecache.c:2275 with Aria'
      - Replaced old DBUG_ASSERT with a new correct one + a comment.
      
      storage/maria/ma_pagecache.c:
        Replaced old DBUG_ASSERT with a new correct one + a comment.
      d4af82c4
    • Michael Widenius's avatar
      Fixes MySQL bug#48972: mysqldump --insert-ignore leaves set unique_checks=0. · 78914837
      Michael Widenius authored
      This fixes a bug that when you use mysqldump --no-create-info to generate a dump that you want to merge with an existing table,
      you can get an innodb table with duplicated unique keys.
      Patch orignally by Eric Bergen.
      
      
      client/mysqldump.c:
        Only use UNIQUE_CHECKS=0 for tables that are created.
        This solves the issue that you can't get duplicate unique keys when merging two dumps.
      mysql-test/r/mysqldump.result:
        Test for mysqldump --no-create-info
      78914837
  7. 08 Aug, 2011 1 commit
    • Michael Widenius's avatar
      Optimize mutex usage. · 68ab6816
      Michael Widenius authored
      storage/maria/ma_blockrec.c:
        Unlock bitmaps earlier (no reason to have them unlocked over _ma_write_clr())
      storage/maria/ma_extra.c:
        Don't lock THR_LOCK_maria for HA_EXTRA_PREPARE_FOR_RENAME (upper level ensures that we are not opening the same table during this call)
        We don't need to have share->intern_lock locked over _ma_flush_table_files()
      storage/maria/ma_open.c:
        Update comment
      68ab6816
  8. 01 Aug, 2011 1 commit
  9. 31 Jul, 2011 2 commits
    • unknown's avatar
      Automerge 5.1->5.2 · 0c8579ff
      unknown authored
      0c8579ff
    • unknown's avatar
      Speed up mysql-test-run.pl. · ce2fe108
      unknown authored
      Problem was the parsing of test suite files for various tags and options.
      This was done inefficiently, and include files were re-parsed for every
      place they were included. This caused a delay of 20 seconds or so before
      the first test started to run.
      
      By parsing more efficiently and re-using first parse for subsequent
      inclusion of the same file, time spent parsing is reduced to less than
      1 second, and start appears instantaneous.
      
      (With this patch, full ./mtr runs in 3 minutes on my laptop (release
      build.)
      
      mysql-test/suite/innodb_plugin/t/innodb_bug52663.test:
        Test is fairly slow, so try to avoid getting stuck with it at the end
        while other workers are idle.
      ce2fe108
  10. 26 Jul, 2011 1 commit
    • Michael Widenius's avatar
      Merge with 5.1 · 89c4ab41
      Michael Widenius authored
      Fixed lp:814237: Wrong mutex usage in Aria
      
      
      storage/maria/ma_bitmap.c:
        Added call to _ma_bitmap_mark_file_changed() when flushing bitmap. This fixes lp:814237
      89c4ab41
  11. 24 Jul, 2011 2 commits
    • Michael Widenius's avatar
      Ensure that the last --datadir option is used from the my.cnf files. · 097180ef
      Michael Widenius authored
      scripts/mysqldumpslow.sh:
        Remove not used --basedir option
        Ensure that the last --datadir option is used from the my.cnf files.
      097180ef
    • Michael Widenius's avatar
      Fixes lp:805930 Sysbench breaks on multiple table test with MariaDB 5.2.7 + Aria · 35cc5ea0
      Michael Widenius authored
      The bug happens when one uses MAX_ROWS=# with Aria & row_format=page and one insert more than # rows.
      
      
      mysql-test/mysql-test-run.pl:
        Ignore table is full error messages
      mysql-test/suite/maria/r/max_length.result:
        Test case for 'Table is full'
      mysql-test/suite/maria/t/max_length.test:
        Test case for 'Table is full'
      storage/maria/ma_bitmap.c:
        Ensure that we don't allocate bits outside of max_data_file_size.
        Adjust max_data_file_size based on bitmap alignments.
        Backport fix to adjust wrong first_bitmap_with_space.
      storage/maria/ma_blockrec.c:
        Calculate value of max_data_file_length
      storage/maria/ma_blockrec.h:
        Updated prototype for _ma_bitmap_init()
      storage/maria/ma_check.c:
        Give warnings if file sizes are above max file sizes.
        Give more warnings in case of errors.
        Have maria_chk write if table is recreated.
      storage/maria/ma_create.c:
        Better calculation of max_data_file_length and thus data pointer length.
        Fixes some wrong pointer lengths when using MAX_ROWS=#
      storage/maria/ma_open.c:
        Removed duplicate assigment.
        Use block size from file instead of global variable.
      storage/maria/maria_chk.c:
        Remove -1 from printed file length
      storage/maria/maria_def.h:
        Update struct st_maria_file_bitmap
      35cc5ea0
  12. 21 Jul, 2011 7 commits
    • unknown's avatar
      test fix. · 8c653292
      unknown authored
      8c653292
    • unknown's avatar
      Test fix merge. · 0b1fd9f4
      unknown authored
      0b1fd9f4
    • unknown's avatar
      Fixed PBXT test. · 3b264cec
      unknown authored
      3b264cec
    • unknown's avatar
      Merge 5.1->5.2 · e81d635a
      unknown authored
      e81d635a
    • unknown's avatar
      Removed incorrect fix and its test suite (the test suit is duplicate). · a105b340
      unknown authored
      Fixed explains of previous patch.
      
      mysql-test/r/explain.result:
        Fixed explains of previous patch.
      mysql-test/r/join_outer.result:
        Fixed explains of previous patch.
      mysql-test/r/negation_elimination.result:
        Fixed explains of previous patch.
      mysql-test/r/view.result:
        Fixed explains of previous patch.
      mysql-test/suite/innodb/r/innodb_mysql.result:
        Removed duplicate test suite.
      mysql-test/suite/innodb/t/innodb_mysql.test:
        Removed duplicate test suite.
      mysql-test/suite/innodb_plugin/r/innodb_mysql.result:
        Removed duplicate test suite.
      mysql-test/suite/innodb_plugin/t/innodb_mysql.test:
        Removed duplicate test suite.
      sql/opt_range.h:
        Removed incorrect fix.
      sql/records.cc:
        Removed incorrect fix.
      a105b340
    • unknown's avatar
      The function description added. · c08186fa
      unknown authored
      c08186fa
    • unknown's avatar
      Fix of LP BUG#777809 · e4fd9e0c
      unknown authored
      There are 2 volatile condition constructions AND/OR constructions and fields(references) when first
      good supported to be top elements of conditions because it is normal practice
      (see copy_andor_structure for example) fields without any expression in the condition is really rare
      and mostly useless case however it could lead to problems when optimiser changes/moves them unaware
      of other variables referring to them. An easy solution of this problem is just to replace single field
      in a condition with equivalent expression well supported by the server (<field> -> <field> != 0).
      
      mysql-test/r/view.result:
        New test added.
      mysql-test/t/view.test:
        New test added.
      sql/sql_parse.cc:
        <field> -> <field> != 0
      sql/sql_yacc.yy:
        <field> -> <field> != 0
      e4fd9e0c
  13. 12 Jul, 2011 2 commits
  14. 10 Jul, 2011 4 commits
  15. 07 Jul, 2011 1 commit
    • Sergei Golubchik's avatar
      protocol safety fix: · 6cc5fd2f
      Sergei Golubchik authored
      before strlen(db) we need to be sure that
      db lies within packet boundaries.
      same for client_plugin.
      6cc5fd2f
  16. 10 Jul, 2011 3 commits
  17. 07 Jul, 2011 1 commit