Permalink
Commits on May 7, 2014
  1. os_event_wait_time_low(): wait time calculation is messed up

    Summary:
    Feature: Core logic error
    
    This is a fix for upstream bug#72520
    
    In os_event_wait_time_low() the logic to calculate abs_time
    for wait is broken. The bug has been present at least since
    5.5. It gets acutely sensitized when sub-second wait intervals
    are passed. It is particularly relevant to us because the
    page_cleaner thread will mostly request sub-second wait
    intervals. This can potentially lead to a near tight loop
    behaviour of page_cleaner with much less sleep then what we'd
    actually expect.
    
    Test Plan: mtr
    
    Reviewers: pivanof, steaphan, darnaut
    
    Reviewed By: pivanof
    
    CC: jtolmer, CalvinSun, WebScaleSQL
    
    Differential Revision: https://reviews.facebook.net/D18459
    inaam-rana committed May 3, 2014
Commits on Apr 16, 2014
  1. Add an option to disable deadlock checking in InnoDB

    Summary:
    Feature: Performance of locking subsystem
    
    Deadlock detecion code can be expensive when a lots of threads
    wait for the same lock i.e.: a hotspot scenario. At times, it is
    much more efficient to disable deadlock detection code and rely
    on innodb_lock_wait_timeout to rollback in case of deadlock.
    
    This patch adds an option innodb_deadlock_detect (default TRUE)
    to disable the deadlock detection code.
    
    Test Plan: mtr
    
    Reviewers: pivanof, steaphan, darnaut
    
    Reviewed By: darnaut
    
    CC: jtolmer, CalvinSun, WebScaleSQL
    
    Differential Revision: https://reviews.facebook.net/D17679
    inaam-rana committed Apr 10, 2014
Commits on Apr 10, 2014
  1. Change the default value for innodb_log_compressed_pages to false

    Summary:
    Feature: 2012 InnoDB Compression
    
    Logging these pages is a waste.  We don't want this to be enabled.
    
    One caution here: If the zlib version used by innodb is changed, but
    the running version is still the previous version, and the running
    version crashes, it is *possible* crash recovery could fail.
    
    When crash recovery uses a zlib version at all different than the
    version used by the crashed instance, it is *possible* that a redone
    compression could fail, where the original did not, because the new
    zlib version compresses the same data to a slightly larger size.
    
    Because of the nature of compression, this is even possible when
    upgrading to a version of zlib which actually peforms overall better
    compression than the previous version.
    
    If this happens, mysql will fail to recover, since a page split can
    not be safely triggered during crash recovery.
    
    So, either the exact zlib version must be controlled between builds,
    or these rare recovery failures must be accepted.  The cost of
    logging these pages is quite high, so we consider this limitation to
    be worthwhile.
    
    This failure scenario can not happen if there was a clean shutdown.
    This is only relevant to restarting crashed instances, or starting an
    instance built via a hot backup too (XtraBackup).
    
    Test Plan: mtr
    
    Reviewers: inaam-rana, pivanof
    
    Reviewed By: inaam-rana
    
    CC: jtolmer, WebScaleSQL
    
    Differential Revision: https://reviews.facebook.net/D17685
    steaphangreene committed Apr 10, 2014
  2. Spurious wakeup in lock_wait_suspend_thread()

    Summary:
    Feature: Performance improvement in locking subsystem
    
    This is a fix for upstream bug#72123
    
    lock_timeout thread works in a tight loop waking up every second
    and checking for lock_wait_timeout. In addition, when a mysql
    thread is forced to wait on a lock, it signals the lock_timeout thread
    as well. This call is not required. In a heavily contended workload
    each thread going to wait will signal the lock_timeout thread making
    it work all the time. As lock_timeout thread scans the array of
    waiting threads under lock_sys::wait_mutex which is already very
    hot in contneded loads, these extra scans can cause significanct
    performance regression.
    
    Also, in various codepaths lock_timeout thread is signalled where
    actual intention was to signal the innodb monitor thread.
    
    Test Plan: mtr
    
    Reviewers: pivanof, darnaut
    
    Reviewed By: darnaut
    
    CC: jtolmer, CalvinSun, WebScaleSQL, steaphan
    
    Differential Revision: https://reviews.facebook.net/D17673
    inaam-rana committed Apr 10, 2014
  3. Fix compilation errors on osx

    Summary:
    Feature: Compilation
    
    Use timeout_t instead of scalar value in vio_io_wait()
    
    Test Plan: mtr
    
    Reviewers: pivanof, steaphan, darnaut
    
    Reviewed By: steaphan
    
    CC: jtolmer, CalvinSun, WebScaleSQL
    
    Differential Revision: https://reviews.facebook.net/D17667
    inaam-rana committed Apr 10, 2014
  4. Stabilize two new tests in MySQL-5.6.17

    Summary:
    Feature: Basic Test Fixes
    
    These two new tests in 5.6.17 added some selects without ORDER BY:
    1) main.partition_index_innodb
    2) main.partition_index_myisam
    
    So, the result files may not match, even if their results are correct.
    
    This fixes that.
    
    Test Plan:
    Before these change were made, these tests showed failures after
    later (correct) changes were added, while rebasing the Facebook
    branch onto WebScaleSQL-5.6.17.
    
    mtr main.partition_index_innodb main.partition_index_myisam
    
    Verified the only output changes were "ORDER BY" and result order.
    
    Reviewers: pivanof, inaam-rana, darnaut
    
    Reviewed By: pivanof
    
    CC: WebScaleSQL
    
    Differential Revision: https://reviews.facebook.net/D17637
    steaphangreene committed Apr 9, 2014
Commits on Apr 7, 2014
  1. Fix mysqld--help-notwin-profiling output for 5.6.17

    Summary:
    Feature: Basic Test Fixes
    
    Another command-line option was added in MySQL-5.6.17, but this version
    of this test is new in WebScaleSQL, so it wasn't updated.
    
    Since I only ran all the tests with the default builds, I did so with
    PerfSchema disabled, and so this test was skipped, and this change
    was missed.  This diff just fixes that one .result file.
    
    This will be squashed with: https://reviews.facebook.net/D15753
    
    Test Plan:
    Built with perfschema enabled, with profiling, ran:
    mtr --record main.mysqld--help-notwin-profiling
    
    Built with perfschema enabled, without profiling, ran:
    mtr --record main.mysqld--help-notwin
    
    Reviewers: pivanof, inaam-rana, darnaut
    
    Reviewed By: pivanof
    
    CC: jtolmer
    
    Differential Revision: https://reviews.facebook.net/D17529
    steaphangreene committed Apr 7, 2014
Commits on Mar 30, 2014
  1. Modernize bison usage to work with bison3

    Summary:
    Feature: Build Improvements
    
    Fix usage of bison, roughly similar to MDEV-4902.  This works
    with old and new bisons.
    
    https://mariadb.atlassian.net/browse/MDEV-4902
    
    Test Plan: built on my devserver, built on debian unstable
    
    Reviewers: pivanof, steaphan, darnaut
    
    Reviewed By: pivanof
    
    CC: steaphan, darnaut
    
    Differential Revision: https://reviews.facebook.net/D17229
    chipturner committed Mar 27, 2014
Commits on Mar 28, 2014
  1. Support millisecond timeouts for reads, writes, and connects

    Summary:
    Feature: Millisecond Client Timeouts
    
    This diff exposes three new client options:
    
    MYSQL_OPT_CONNECT_TIMEOUT_MS
    MYSQL_OPT_READ_TIMEOUT_MS
    MYSQL_OPT_WRITE_TIMEOUT_MS
    
    Which are similar to the non-_MS options, except the value is, of
    course, in milliseconds.
    
    This diff also changes a number of timeout-related codepaths to use a
    structure rather than a naked integer.  This helps prevent many, many
    classes of errors that come from accidentally multiplying or dividing by
    1000 to convert (or forgetting to), and creates a form of type safety
    for timeouts.
    
    Test Plan: jenkins, mtr
    
    Reviewers: pivanof, inaam-rana, darnaut
    
    Reviewed By: darnaut
    
    CC: jtolmer, MarkCallaghan, flamingcow, jeremycole, andrew-ford, liang.guo.752, chip, atcurtis
    
    Differential Revision: https://reviews.facebook.net/D17019
    steaphangreene committed Mar 17, 2014
  2. Add JUnit reporting support to the MySQL test suite runner.

    Summary:
    Feature: JUnit Support for MTR
    
    Produces JUnit test reports that can be consumed by tools such as Jenkins.
    
    Two new options are added to MTR:
    
      --junit-output=FILE   Output JUnit test summary XML to FILE.
      --junit-package=NAME  Set the JUnit package name to NAME for this test run.
    
    A test run using junit reporting would look like:
    
      ./mtr --comment=rpl_row --junit-package=rpl_row --junit-output=rpl_row.xml \
            --suite=rpl --mysqld=--binlog-format=row
    
    Typically, the package name should be the name for the test run, in
    this case the suite name and its variation. Tests results are written
    to the rpl_row.xml file (including test timing and output). If using
    with Jenkins, the XML file can be used for publishing test results and
    Jenkins would be able to show how many test failed, test duration and
    whether to mark the build as failed or unstable (if there were failing
    tests that succeeded on retry).
    
    Test Plan: mtr
    
    Reviewers: steaphan
    
    Reviewed By: steaphan
    
    Differential Revision: https://reviews.facebook.net/D17139
    darnaut committed with steaphangreene Mar 24, 2014
  3. Support for NUMA interleave policy

    Summary:
    Feature: NUMA Support
    
    Credits for research and implementation: Jeremy Cole and Davi Arnaut
    
    This patch provides startup options:
    * flush-caches: Flush and purge buffers/caches
    * numa-interleave: Run mysqld with its memory interleaved on all CPUs
    
    It also provides a config option:
    * innodb_buffer_pool_populate: pre-allocation of buffer pool
    memory at start up:
      -- Use MAP_POPULATE if supported (Linux 2.6.23 and higher)
      -- Forced pre-allocation using memset
    
    Test Plan: mtr
    
    Reviewers: steaphan, pivanof
    
    Reviewed By: pivanof
    
    CC: MarkCallaghan, jtolmer, jeremycole, flamingcow, andrew-ford, pengt, CalvinSun
    
    Differential Revision: https://reviews.facebook.net/D16965
    inaam-rana committed with steaphangreene Mar 18, 2014
  4. Buffer pool list scan optimization

    Summary:
    Feature: Optimize Buffer Pool List Scans and Fix Reporting
    
    This patch includes:
      -- backport of upstream work around buffer pool list scan.
         revno: 6228
         revision-id: sunny.bains@oracle.com-20130808223745-7lzp6h40vx1ndc7k
         parent: marc.alff@oracle.com-20130808135008-p5irewph4fm1yu19
         committer: Sunny Bains <Sunny.Bains@Oracle.Com>
         branch nick: trunk
         timestamp: Fri 2013-08-09 08:37:45 +1000
         message:
           WL#7047 - Optimize buffer pool list scans and related batch processing code
    
           Reduce excessive scanning of pages when doing flush list batches. The
           fix is to introduce the concept of "Hazard Pointer", this reduces the
           time complexity of the scan from O(n*n) to O(n).
    
           The concept of hazard pointer is reversed in this work.  Academically a
           hazard pointer is a pointer that the thread working on it will declare as
           such and as long as that thread is not done no other thread is allowed to
           do anything with it.
    
           In this WL we declare the pointer as a hazard pointer and then if any other
           thread attempts to work on it, it is allowed to do so but it has to adjust
           the hazard pointer to the next valid value. We use hazard pointer solely for
           reverse traversal of lists within a buffer pool instance.
    
           Add an event to control the background flush thread. The background flush
           thread wait has been converted to an os event timed wait so that it can be
           signalled by threads that want to kick start a background flush when the
           buffer pool is running low on free/dirty pages.
    
      -- fix for mysql bug#71411
         buf_flush_LRU() returns the number of pages processed. There are
         two types of processing that can happen. A page can get evicted or
         a page can get flushed. These two numbers are quite distinct and
         should not be mixed.
    
    Test Plan: mtr
    
    Reviewers: pivanof, liang.guo.752, CalvinSun, steaphan
    
    Reviewed By: pivanof, steaphan
    
    CC: jtolmer, MarkCallaghan, flamingcow, jeremycole, andrew-ford, pengt, steaphan
    
    Differential Revision: https://reviews.facebook.net/D16629
    Differential Revision: https://reviews.facebook.net/D17115
    inaam-rana committed with steaphangreene Mar 6, 2014
  5. Page cleaner should do LRU flushing regardless of server activity

    Summary:
    Feature: Flushing Improvements
    
    This is for upstream bug#70500 and bug#71988
    page_cleaner should work whether or not there is server activity.
    Its iterations become a noop when there is no work to do but we
    should not tie it to the server activity.
    
    The page_cleaner thread does spurious background flushing
    because of conditional sleep between iterations. The solution
    is not to make sleep dependent on server activity etc.
    
    Test Plan: mtr
    
    Reviewers: steaphan, pivanof
    
    Reviewed By: steaphan
    
    CC: MarkCallaghan, jtolmer, jeremycole, flamingcow, andrew-ford, pengt
    
    Differential Revision: https://reviews.facebook.net/D16617
    inaam-rana committed with steaphangreene Mar 6, 2014
  6. Enable Lazy Flushing

    Summary:
    Feature: Buffer Pool Control Enhancements
    
    Adds innodb_idle_flush_pct to enable tuning of the page flushing rate
    when the system is relatively idle.  We care about this, since doing
    extra unnecessary flash writes shortens the lifespan of the flash.
    
    Test Plan:
    The default behavior is unchanged (since the default is 100).
    
    Confirmed in both testing of shadows, and in actual production, that
    setting this to 0 does result in stable lazy flushing, as desired.
    
    All mtr tests pass.
    
    Reviewers: inaam-rana
    
    Reviewed By: inaam-rana
    
    CC: jtolmer, MarkCallaghan, pivanof, flamingcow, jeremycole, andrew-ford, liang.guo.752, pengt
    
    Differential Revision: https://reviews.facebook.net/D16479
    steaphangreene committed Mar 7, 2014
  7. Made innodb_max_dirty_pages_pct my.cnf variable a double

    Summary:
    Feature: Buffer Pool Control Enhancements
    
    This change is to fix: http://bugs.mysql.com/62534
    
    This makes innodb_max_dirty_pages_pct a double with min,default,max values
    0.001, 75, 99.999.
    
    This also makes innodb_max_dirty_pages_pct_lwm and adaptive_flushing_lwm
    doubles, as these sysvars are inter-dependent.
    
    Added more to the BUFFER POOL AND MEMORY section of SHOW INNODB STATUS:
      Percent pages dirty: X.X
        This is all n_dirty_pages / used_pages
      Percent all pages dirty: X.X
        This is all n_dirty_pages / all-pages
      Max dirty pages percent: X.X
        This is innodb_max_dirty_pages_pct
    
    Also changed all of buf from 2 to 3 digits of precision (%.2f -> %.3f).
    
    Test Plan: Jenkins
    
    Reviewers: inaam-rana
    
    Reviewed By: inaam-rana
    
    CC: jtolmer, MarkCallaghan, pivanof, flamingcow, jeremycole, andrew-ford, liang.guo.752, pengt
    
    Differential Revision: https://reviews.facebook.net/D16485
    steaphangreene committed Mar 10, 2014
  8. Super Read-Only

    Summary:
    Feature: Super Read-Only
    
    Implements super_read_only global, which activates read_only,
    and also blocks writes by SUPER.
    
    Linked to the read_only global as follows:
    * Turning read_only off also turns off super_read_only.
    * Turning super_read_only on also turns read_only on.
    * All other changes to either one of these have no affect on the other.
    
    Note: We ignore super_read_only when updating replication repositories.
    Otherwise, "stop slave" and "change master to" would throw errors when
    this setting is enabled.
    
    Test Plan: New tests included, they all pass.
    
    Reviewers: pivanof, inaam-rana, liang.guo.752
    
    Reviewed By: pivanof
    
    CC: jtolmer, MarkCallaghan, flamingcow, jeremycole, andrew-ford, santoshb
    
    Differential Revision: https://reviews.facebook.net/D16197
    steaphangreene committed Oct 19, 2012
  9. Port v5.1 Prefix Index Queries Optimization

    Summary:
    Feature: Prefix Index Queries Optimization
    
    Optimize prefix index queries to skip cluster index lookup when possible.
    
    Currently InnoDB will always fetch the clustered index (primary key
    index) for all prefix columns in an index, even when the value of a
    particular record is smaller than the prefix length.  This change
    optimizes that case to use the record from the secondary index and avoid
    the extra lookup.
    
    Also adds two status vars that track how effective this is:
    
        innodb_secondary_index_triggered_cluster_reads:
    	Times secondary index lookup triggered cluster lookup.
    
        innodb_secondary_index_triggered_cluster_reads_avoided:
    	Times prefix optimization avoided triggering cluster lookup.
    
    Test Plan:
    Jenkins, all pass.
    
    New test included, fails without this change, passes with it.
    
    Random toggle added to stress tests, the small ones all pass,
    and the nightly Jenkins stress tests should all pass too.
    
    Reviewers: pivanof
    
    Reviewed By: pivanof
    
    CC: jtolmer, MarkCallaghan, flamingcow, jeremycole, andrew-ford, inaam-rana, liang.guo.752
    
    Differential Revision: https://reviews.facebook.net/D15921
    Differential Revision: https://reviews.facebook.net/D16455
    steaphangreene committed Feb 5, 2014
  10. Add basic atomic_stats type

    Summary:
    Feature: Basic Stats Support
    
    This is a simple class template that implements an atomic stats variable.
    
    The focus is on performance, not accuracy.  No set operations are
    guaranteed.  The other operations are all atomic, so values should not
    actually be lost - however, there is no attempt to be consistent in
    reading multiple stats, nor any concern that different threads see any
    consistent view across multiple stats.
    
    Test Plan:
    This has been tested quite a bit in isolation, and no problems have been
    found.  However, this has never been used in production.  Also, a newer,
    more sophisticated, version of this is already in development.
    
    It also shows a small perf gain in the larger stats diffs (Table Stats,
    User Stats, etc...), when compared to the built-in MySQL atomics.
    
    Reviewers: pivanof
    
    Reviewed By: pivanof
    
    CC: jtolmer, MarkCallaghan, flamingcow, jeremycole, andrew-ford, inaam-rana, liang.guo.752
    
    Differential Revision: https://reviews.facebook.net/D16029
    Differential Revision: https://reviews.facebook.net/D16449
    steaphangreene committed Feb 8, 2014
  11. Allow semisync plugins to link statically and do that by default

    Summary:
    Feature: Build Improvements
    
    The change makes it possible to link both semisync master and semisync slave
    plugins statically, modifies CMakeList.txt to do that by default, and modifies
    tests to work both with statically and dynamically linked semisync plugins.
    
    This change is based on
    http://bazaar.launchpad.net/~maria-captains/maria/10.0/revision/3427.1.168
    with unnecessary parts removed and with MySQL-specific parts added.
    
    Test Plan:
    mtr
    
    Cleanly built without cmake options, and 'show plugins;' output included:
    ...
    rpl_semi_sync_master	ACTIVE	REPLICATION	NULL	GPL
    rpl_semi_sync_slave	ACTIVE	REPLICATION	NULL	GPL
    ...
    
    Reviewers: steaphan, santoshb
    
    Reviewed By: steaphan, santoshb
    
    CC: flamingcow, jeremycole, andrew-ford, inaam-rana, jtolmer, MarkCallaghan
    
    Differential Revision: https://reviews.facebook.net/D15891
    Differential Revision: https://reviews.facebook.net/D16947
    pivanof committed with steaphangreene Mar 24, 2014
  12. Add trx pointer to struct mtr_t

    Summary:
    Feature: Basic Code Changes
    
    This adds a pointer to the trx to each mtr.
    This allows the trx to be accessed in parts of the code
    where it was otherwise not available.
    
    Other than adding the extra field in the structure,
    and filling it properly, this change, on its own, should
    have no effect.  It is basically a non-change.
    
    This is a base change required for lots of stuff,
    including innodb_fake_changes, table stats, etc....
    
    I am factoring this out to allow diff re-ordering.
    
    Test Plan:
    Build is clean, and so are mtr tests.
    
    This code was factored out of the existing table stats diff.
    There are no overall code changes once table stats diff is applied.
    
    This change has	been running in	production for about a year now.
    All is still well, so this is pretty safe.
    
    Reviewers: pivanof, inaam-rana, liang.guo.752
    
    Reviewed By: pivanof
    
    CC: jtolmer, MarkCallaghan, flamingcow, jeremycole, andrew-ford
    
    Differential Revision: https://reviews.facebook.net/D16209
    steaphangreene committed Mar 24, 2014
  13. Share more structures

    Summary:
    Feature: Basic Code Changes
    
    This just moves some structure definitions from inside a
    single .cc file to a shared .h file, with a few tweaks to
    allow these structures to be shared.
    
    On its own, it should have no actual effect.  It is a non-change.
    
    This is a base change required for lots of stuff,
    including innodb_fake_changes, stats, etc....
    
    I am factoring this out to allow diff re-ordering.
    
    Test Plan:
    Build is clean, and so are mtr tests.
    
    This code was factored out of the existing basic stats diff.
    There are no overall code changes once that diff is applied.
    
    This change has been running in production for about a year now.
    All is still well, so this is pretty safe.
    
    Reviewers: pivanof, inaam-rana, liang.guo.752
    
    Reviewed By: pivanof
    
    CC: jtolmer, MarkCallaghan, flamingcow, jeremycole, andrew-ford
    
    Differential Revision: https://reviews.facebook.net/D16203
    steaphangreene committed Mar 24, 2014
  14. Disable PerfSchema By Default

    Summary:
    Feature: Basic Performance Fixes
    
    Entirely disables building of PerfSchema by default for all builds.
    
    PerfSchema turned out to have too much overhead to be worth it:
    
    www.facebook.com/notes/mysql-at-facebook/my-mysql-is-faster-than-your-mysql/10151250402570933
    
    There was a hard-coded check of perfschema values in:
    	main.mysql_client_test
    ...so I removed that code, and that check.
    
    Test Plan:
    I confirmed that, by default, it now builds this with perfschema off.
    Built both with internal tools, and with plain cmake/make.
    
    Instrumented the code and cmake configs to confirm PS is still
    completely disabled by default, and completely enabled when
    cmake is passed -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 - all works.
    
    Reviewers: pivanof
    
    Reviewed By: pivanof
    
    CC: jtolmer, MarkCallaghan, flamingcow, jeremycole, andrew-ford, inaam-rana, liang.guo.752
    
    Differential Revision: https://reviews.facebook.net/D16671
    steaphangreene committed Mar 28, 2013
  15. Avoid unnecessary buf_flush_list() in startup code path

    Summary:
    Feature: Basic Performance Fixes
    
    This is a performance regression bug in upstream code. Opened
    Bug#70899 to track this.
    
    In InnoDB startup code innobase_start_or_create_for_mysql()
    after creating rsegs we flush the entire buffer pool. The
    intent is to force trx_sys page to the disk. We can reach
    this code path after doing recovery. In this case we can
    potentially have millions of dirty pages in the buffer pool.
    This can seriously increase the recovery time.
    
    The fix is trivial. Check if we are coming from recovery code
    path and don't flush buffer pool in that case because during
    recovery we don't create rsegs.
    
    Because the (debug-only) doublewrite buffer test assumes this
    flush will still happen, even during recovery, this change is
    made only for non-debug builds.
    
    Test Plan: run mtr
    
    Reviewers: pivanof, steaphan, liang.guo.752
    
    Reviewed By: steaphan
    
    CC: jtolmer, MarkCallaghan, flamingcow, jeremycole, andrew-ford, pengt
    
    Differential Revision: https://reviews.facebook.net/D16623
    inaam-rana committed with steaphangreene Mar 6, 2014
  16. Add basic suite of innodb stress tests

    Summary:
    Feature: Stress Tests
    
    This is a port of all stress, bigstress, and hugestress tests to 5.6.
    
    This is a complete port, except:
    
    Removed all *_gc.test.  These tested a group commit mechanism that
    is not in 5.6, and will never be ported to it.
    
    This can stress test secondary indexes as well, but this is disabled.
    
    Removed extra innodb_file_format_check.   It is no longer needed in 5.6.
    
    Updated results files (partly with --record, partly manually).
    
    Commit every 100 inserts while populating the tables.
    
    Properly restart the master in innodb_stress.inc
    
    Verify secondary index count after all stress test runs.
    
    Removed use of vars we've not (yet) ported.  These included:
    	innodb_zlib_wrap
    	innodb_log_compressed_pages
    	innodb_background_checkpoint
    	innodb_prepare_commit_mutex
    	innodb_prefix_index_cluster_optimization
    
    Updated and verified changes to all results files.
    
    Test Plan:
    Ran all the non-huge tests, and one huge test, myself, so far so good.
    Jenkins nightlies will start hammering these after this is pushed.
    
    Reviewers: flamingcow, pivanof, jeremycole, andrew-ford, inaam-rana
    
    Reviewed By: pivanof
    
    CC: jtolmer, MarkCallaghan
    
    Differential Revision: https://reviews.facebook.net/D15759
    steaphangreene committed Apr 2, 2013
  17. Protect against writing to nullptr in net_write_buff

    Summary:
    Feature: Basic Bug Fixes
    
    There are reports of segfaults from mysql trying to write when
    there is no valid write buffer (typically after an aborted connect,
    apparently).  This protects against writing to net->write_buf when it
    isn't valid.
    
    It's not fully clear if this is a 5.6 issue or an issue with the async
    patch.  The codepaths using it seem to trigger only in very rare cases
    and are inside of conenction pooling code that retries connections using
    the same MYSQL object, which is arguably invalid to begin with.
    
    Test Plan: mtr
    
    Reviewers: pivanof, inaam-rana
    
    Reviewed By: pivanof
    
    CC: jtolmer, MarkCallaghan, flamingcow, jeremycole, andrew-ford, liang.guo.752, chip
    
    Differential Revision: https://reviews.facebook.net/D17013
    chipturner committed with steaphangreene Jan 6, 2014
  18. Fix a bug with unsigned arithmetic

    Summary:
    Feature: Basic Bug Fixes
    
    There was an SQL_MODE option for subtracting underflows, but not for
    adding negative overflow.  This fixes it by moving the check to the
    parent arithmetic class.
    
    Also, allow global NO_UNSIGNED_SUBTRACTION to override sql_mode in
    replication thread.
    
    sql_mode is part of replication events, and therefore almost all
    sql_mode settings are ignored by the replication thread.  This breaks
    replicating from 5.1->5.6 because of behavior of unsigned underflow.
    This diff allows NO_UNSIGNED_SUBTRACTION to pierce into the replication
    thread if it is set globally.
    
    Test Plan:
    mtr,
    replicate from 5.1 master, run on 5.6 replica
    test against failing replica,
    verify properly replicates in statement mode
    
    Reviewers: pivanof, inaam-rana, liang.guo.752
    
    Reviewed By: pivanof
    
    CC: jtolmer, MarkCallaghan, flamingcow, jeremycole, andrew-ford, chip
    
    Differential Revision: https://reviews.facebook.net/D16185
    chipturner committed with steaphangreene Mar 27, 2012
  19. Stop spawning dummy threads on client library initialization

    Summary:
    Feature: Basic Bug Fixes
    
    Let's revert the fix for Bug#24507.  To quote Monty from 2006:
    
    "After 1/2 a year, when all glibc versions are updated, we can delete
    this code."
    
    Note: The upstream glibc bug was fixed in 2006.
    
    Test Plan: jenkins
    
    Reviewers: pivanof, inaam-rana, liang.guo.752
    
    Reviewed By: pivanof
    
    CC: jtolmer, MarkCallaghan, flamingcow, jeremycole, andrew-ford
    
    Differential Revision: https://reviews.facebook.net/D16191
    chipturner committed with steaphangreene Apr 5, 2013
  20. Preserve CLIENT_REMEMBER_OPTIONS flag for compressed connections

    Summary:
    Feature: Basic Bug Fixes
    
    Keep the CLIENT_REMEMBER_OPTIONS bit set in the flags for the IO
    thread's connection so that on failure connecting to the master
    mysql_real_connect does not call mysql_close_free_options and stomp
    the connection timeout setting.
    
    Test Plan: mtr
    
    Reviewers: flamingcow, pivanof, jeremycole, andrew-ford, inaam-rana
    
    Reviewed By: pivanof
    
    CC: jtolmer, MarkCallaghan
    
    Differential Revision: https://reviews.facebook.net/D15771
    jtolmer committed with steaphangreene Nov 7, 2012
  21. Correct error in lower_case_table_names conditional

    Summary:
    Feature: Basic Bug Fixes
    
    This fixes http://bugs.mysql.com/64347 reported in 5.1,
    and apparently still not fixed in 5.6 or 5.7.
    
    Use binary string comparisons in dboptions hash when
    lower_case_table_names is zero, not when it is not zero.
    
    Added a test case to expose this problem should it ever recur.
    
    Test Plan: Included new test fails without this change, passes with it.
    
    Reviewers: flamingcow, pivanof, jeremycole, andrew-ford, inaam-rana
    
    Reviewed By: pivanof
    
    CC: jtolmer, MarkCallaghan
    
    Differential Revision: https://reviews.facebook.net/D15765
    steaphangreene committed Dec 24, 2013
  22. Don't require internal values, that should change, to not change

    Summary:
    Feature: Basic Test Fixes
    
    1) A number of PS tests show performance_schema_max_statement_classes
    along with the other PS variables.  This value is not important, and
    this number will just go up every time a new statement class is added.
    
    The only thing testing for this number accomplishes is the creation
    of pointless conflicts with all the diffs which introduce these.
    
    So, this one variable is now excluded from the output of those tests.
    
    2) Many internal values are included in the full output of
    'show engine performance_schema status', so this has the same issue.
    
    So, these tests were changed to hide the actual numerical values in
    the required test output.
    
    Test Plan: Jenkins - all other diffs that changed this output, no longer need to.
    
    Reviewers: pivanof
    
    Reviewed By: pivanof
    
    CC: jtolmer, MarkCallaghan, flamingcow, jeremycole, andrew-ford, inaam-rana, liang.guo.752
    
    Differential Revision: https://reviews.facebook.net/D16665
    steaphangreene committed Jan 21, 2014
  23. Stabilize SHOW PROCESSLIST tests

    Summary:
    Feature: Basic Test Fixes
    
    A few tests used the output from SHOW PROCESSLIST, without sorting the
    output, making them possibly unstable.  Added a sort to all of these.
    
    Plus, there is a race in show processlist, which shows the actual
    show processlist run as either "init" or "cleaning up".  To avoid
    the test inconsistency, I replace both with "STATE" in these tests.
    
    Test Plan: All mtr tests now pass with and without PerfSchema enabled.
    
    Reviewers: pivanof
    
    Reviewed By: pivanof
    
    CC: jtolmer, MarkCallaghan, flamingcow, jeremycole, andrew-ford, inaam-rana, liang.guo.752
    
    Differential Revision: https://reviews.facebook.net/D16659
    steaphangreene committed Mar 28, 2013
  24. Use single quotes for perl paths, in case of special symbols

    Summary:
    Feature: Basic Test Fixes
    
    Jenkins sometimes puts an @ in the directory name.
    
    With this value in "s, in perl, that is interpreted as a list, and fails.
    
    With it in 's, it works fine.
    
    Test Plan:
    Changed my 5.6 dir to 5@6, and mtr failed.
    With this change, it now passes.
    
    Reviewers: flamingcow, pivanof, jeremycole, andrew-ford, inaam-rana, liang.guo.752
    
    Reviewed By: pivanof
    
    CC: jtolmer, MarkCallaghan
    
    Differential Revision: https://reviews.facebook.net/D15945
    steaphangreene committed Nov 1, 2013
  25. Split mysqld--help-notwin into tests with and without profiling

    Summary:
    Feature: Basic Test Fixes
    
    If we build with perfschema, this test can't work, since we disable
    profiling for release builds, but not debug builds, and thus have
    different command-line parameters for each build.
    
    This splits this test so it can actually work, when it's actually run,
    by splitting it into profiling and non-profiling versions.
    
    This diff also adds the ability to support a 'have_noprofiling" test.
    
    Test Plan: When perfschema is enabled, these tests pass.
    
    Reviewers: flamingcow, pivanof, jeremycole, andrew-ford, inaam-rana
    
    Reviewed By: pivanof
    
    CC: jtolmer, MarkCallaghan
    
    Differential Revision: https://reviews.facebook.net/D15753
    steaphangreene committed Sep 1, 2013
  26. Limit a test with hard-coded values to 16k page size

    Summary:
    Feature: Basic Test Fixes
    
    This test is testing the limits of 16k pages.
    
    Test Plan:
    Doubled the minimum and ran it again, passes with 32k pages.
    Without that change, it fails.
    
    Reviewers: flamingcow, pivanof, jeremycole, andrew-ford, inaam-rana
    
    Reviewed By: pivanof
    
    CC: jtolmer, MarkCallaghan
    
    Differential Revision: https://reviews.facebook.net/D15747
    steaphangreene committed Dec 27, 2013
  27. Allow more time to restart in tests in 5.6

    Summary:
    Feature: Basic Test Fixes
    
    Debug builds are slow, so some big tests time-out on restart.
    
    This changes the hard-coded test restart timeout to roughly 5 minutes,
    instead of the previous value of roughly 50 seconds.
    
    Test Plan: Jenkins' nighly tests will show if this fixes the occasional fails.
    
    Reviewers: flamingcow, pivanof, jeremycole, andrew-ford, inaam-rana
    
    Reviewed By: pivanof
    
    CC: jtolmer, MarkCallaghan
    
    Differential Revision: https://reviews.facebook.net/D15741
    steaphangreene committed Jun 1, 2012