1. 15 Jan, 2013 3 commits
    • Sergei Golubchik's avatar
      5.3 merge · aca8e7ed
      Sergei Golubchik authored
      aca8e7ed
    • Sergei Golubchik's avatar
      remove thd_mark_as_hard_kill() · 750b9147
      Sergei Golubchik authored
      (because it's conceptually wrong. only the user can decide whether the kill is
      allowed to leave tables in the inconsistent state, storage engine has no say in that)
      750b9147
    • unknown's avatar
      Fix for bug MDEV-3992, second attempt · a87eab60
      unknown authored
      The previous fix for MDEV-3992 was incomplete, because it still computed
      incorrectly the number of keyparts of the extended secondary key in the
      case when columns of the PK participate in the secondary key.
      
      This patch by Monty corrects the above problem.
      a87eab60
  2. 14 Jan, 2013 1 commit
    • unknown's avatar
      Fix for bug MDEV-3992 · cf79c01c
      unknown authored
      Analysis:
        The crash is a result of incorrect analysis of whether a secondary key
        can be extended with a primary in order to compute ORDER BY. The analysis
        is done in test_if_order_by_key(). This function doesn't take into account
        that the primary key may in fact index the same columns as the secondary
        key. For the test query test_if_order_by_key says that there is an extended
        key with total 2 keyparts.
        At the same time, the condition
          if (pkinfo->key_part[i].field->key_start.is_set(nr))
        in test_if_cheaper_oredring() becomes true for (i == 0), which results in
        an invalid access to rec_per_key[-1].
        
      Solution:
        The best solution would be to reuse KEY::ext_key_parts that is already computed
        by open_binary_frm(), however after detailed analysis the conclusion is that
        the change would be too intrusive for a GA release.
        The solution for 5.5 is to add a guard for the case when the 0-th key part is
        considered, and to assume that all keys will be scanned in this case.
      cf79c01c
  3. 11 Jan, 2013 1 commit
    • Michael Widenius's avatar
      Buildbot fixes and cleanups: · edc89f75
      Michael Widenius authored
      - Added --verbose to BUILD scripts to get make to write out compile commands.
      - Detect if AM_EXTRA_MAKEFLAGS=VERBOSE=1 was used with build scripts.
      - Don't write warnings about replication variables when doing bootstrap.
      - Fixed that mysql_cond_wait() and mysql_cond_timedwait() will report original source file in case of errors.
      - Ignore some compiler warnings
      
      BUILD/FINISH.sh:
        Detect if AM_EXTRA_MAKEFLAGS=VERBOSE=1 or --verbose was used
      BUILD/SETUP.sh:
        Added --verbose to print out the full compile lines
        Updated help message
      client/mysqltest.cc:
        Fixed that one can use 'replace' with cat_file
      cmake/configure.pl:
        If --verbose is used, get make to write out compile commands
      debian/dist/Debian/rules:
        Added $AM_EXTRA_MAKEFLAGS to get VERBOSE=1 on buildbot builds
      debian/dist/Ubuntu/rules:
        Added $AM_EXTRA_MAKEFLAGS to get VERBOSE=1 on buildbot builds
      include/my_pthread.h:
        Made set_timespec_time_nsec() more portable.
      include/mysql/psi/mysql_thread.h:
        Fixed that mysql_cond_wait() and mysql_cond_timedwait() will report original source file in case of errors.
      mysql-test/suite/innodb/r/auto_increment_dup.result:
        Fixed wrong DBUG_SYNC
      mysql-test/suite/innodb/t/auto_increment_dup.test:
        Fixed wrong DBUG_SYNC
      mysql-test/suite/perfschema/include/upgrade_check.inc:
        Make test more portable for changes in *.sql files
      mysql-test/suite/perfschema/r/pfs_upgrade.result:
        Updated test results
      mysql-test/valgrind.supp:
        Ignore running Aria checkpoint thread
      scripts/mysqlaccess.sh:
        Changed reference of bugs database
        Ensure that also client-server group is read.
      sql/handler.cc:
        Added missing syncpoint
      sql/mysqld.cc:
        Don't write warnings about replication variables when doing bootstrap
      sql/mysqld.h:
        Don't write warnings about replication variables when doing bootstrap
      sql/rpl_rli.cc:
        Don't write warnings about replication variables when doing bootstrap
      sql/sql_insert.cc:
        Don't mask SERVER_SHUTDOWN in insert_delayed
        This is done to be able to distingush between shutdown and interrupt errors
      support-files/compiler_warnings.supp:
        Ignore some compiler warnings in xtradb,innobase, oqgraph, yassl, string3.h
      edc89f75
  4. 10 Jan, 2013 7 commits
    • Michael Widenius's avatar
      Fixed crashing bug in GROUP_CONCAT with ROLLUP · 9684140f
      Michael Widenius authored
      Fixed MDEV-4002: Server crash or valgrind errors in Item_func_group_concat::setup and Item_func_group_concat::add
      
      mysql-test/r/group_by.result:
        Added test case for failing GROUP_CONCAT ... ROLLUP queries
      mysql-test/t/group_by.test:
        Added test case for failing GROUP_CONCAT ... ROLLUP queries
      sql/item_sum.cc:
        Fixed issue where field->table pointed to different temporary table than expected.
        Ensure that order->next points to the right object (could cause problems with setup_order())
      9684140f
    • Michael Widenius's avatar
      Fixed problem with failing mysql_upgrade when proc table was not correct. · 5f68820c
      Michael Widenius authored
      Moved out creation of performance schema tables from mysql_system_tables.sql as
      the performance_tables creation scripts needs a working mysql.proc to work.
      
      client/mysql_upgrade.c:
        Added option -V, --version
      debian/dist/Debian/mariadb-server-5.5.files:
        Added mysql_performance_tables.sql
      debian/dist/Ubuntu/mariadb-server-5.5.files:
        Added mysql_performance_tables.sql
      mysql-test/lib/v1/mysql-test-run.pl:
        Added mysql_performance_tables.sql
      mysql-test/mysql-test-run.pl:
        Added mysql_performance_tables.sql
      scripts/CMakeLists.txt:
        Moved out creation of performance schema tables from mysql_system_tables.sql 
        as the performance_tables creation scripts needs a working mysql.proc to work
      scripts/mysql_install_db.sh:
        Added mysql_performance_tables.sql
      scripts/mysql_performance_tables.sql:
        Moved out creation of performance schema tables from mysql_system_tables.sql 
        as the performance_tables creation scripts needs a working mysql.proc to work
      scripts/mysql_system_tables.sql:
        Move creation of performance schema tables to mysql_performance_tables.sql
        Added 'flush tables' to get things to work if someone deletes a table like mysql.proc before run
      scripts/mysql_system_tables_fix.sql:
        ove performance table things to mysql_performance_tables.sql
      storage/perfschema/pfs.cc:
        Fixed comment
      5f68820c
    • Michael Widenius's avatar
      Fixed MDEV-4013: Password length in replication setup · a42e1e38
      Michael Widenius authored
      Give error for wrong parameters to CHANGE MASTER
      Extend MASTER_PASSWORD and MASTER_HOST lengths
      
      
      mysql-test/suite/rpl/r/rpl_password_boundaries.result:
        Test length of MASTER_PASSWORD, MASTER_HOST and MASTER_USER
      mysql-test/suite/rpl/r/rpl_semi_sync.result:
        Use different password than user name for better test coverage
      mysql-test/suite/rpl/t/rpl_password_boundaries.test:
        Test length of MASTER_PASSWORD, MASTER_HOST and MASTER_USER
      mysql-test/suite/rpl/t/rpl_semi_sync.test:
        Use different password than user name for better test coverage
      sql/rpl_mi.h:
        Extend MASTER_PASSWORD and MASTER_HOST lengths
      sql/sql_repl.cc:
        Give error for wrong parameters to CHANGE MASTER
      sql/sql_repl.h:
        Extend MASTER_PASSWORD and MASTER_HOST lengths
      a42e1e38
    • Michael Widenius's avatar
      Fixed some race conditons and bugs related to killed queries · 6e9a48b6
      Michael Widenius authored
      KILL now breaks locks inside InnoDB
      Fixed possible deadlock when running INNODB STATUS
      Added ha_kill_query() and kill_query() to send kill signal to all storage engines
      Added reset_killed() to ensure we don't reset killed state while awake() is getting called
      
      
      include/mysql/plugin.h:
        Added thd_mark_as_hard_kill()
      include/mysql/plugin_audit.h.pp:
        Added thd_mark_as_hard_kill()
      include/mysql/plugin_auth.h.pp:
        Added thd_mark_as_hard_kill()
      include/mysql/plugin_ftparser.h.pp:
        Added thd_mark_as_hard_kill()
      sql/handler.cc:
        Added ha_kill_query() to send kill signal to all storage engines
      sql/handler.h:
        Added ha_kill_query() and kill_query() to send kill signal to all storage engines
      sql/log_event.cc:
        Use reset_killed()
      sql/mdl.cc:
        use thd->killed instead of thd_killed() to abort on soft kill
      sql/sp_rcontext.cc:
        Use reset_killed()
      sql/sql_class.cc:
        Fixed possible deadlock in INNODB STATUS by not getting thd->LOCK_thd_data if it's locked.
        Use reset_killed()
        Tell storge engines that KILL has been sent
      sql/sql_class.h:
        Added reset_killed() to ensure we don't reset killed state while awake() is getting called.
        Added mark_as_hard_kill()
      sql/sql_insert.cc:
        Use reset_killed()
      sql/sql_parse.cc:
        Simplify detection of killed queries.
        Use reset_killed()
      sql/sql_select.cc:
        Use reset_killed()
      sql/sql_union.cc:
        Use reset_killed()
      storage/innobase/handler/ha_innodb.cc:
        Added innobase_kill_query()
        Fixed error reporting for interrupted queries.
      storage/xtradb/handler/ha_innodb.cc:
        Added innobase_kill_query()
        Fixed error reporting for interrupted queries.
      6e9a48b6
    • Michael Widenius's avatar
      Fix for MDEV-4009: main.delayed sporadically fails with "query 'REPLACE... · 396f4d62
      Michael Widenius authored
      Fix for MDEV-4009: main.delayed sporadically fails with "query 'REPLACE DELAYED t1 VALUES (5)' failed: 1317: Query execution was interrupted"
      - Fixed broadcast without a proper mutex
      - Don't break existing locks if we are just testing if we can get the lock
      
      mysql-test/r/create_delayed.result:
        Added test case for failures with INSERT DELAYED with CREATE and DROP TABLE
      mysql-test/t/create_delayed.test:
        Added test case for failures with INSERT DELAYED with CREATE and DROP TABLE
      sql/mdl.cc:
        Don't break existing locks for timeout=0 (ie, just check if there are conflicting locks).
        This fixed the bug that INSERT DELAYED didn't work properly with CREATE TABLE
      sql/sql_base.cc:
        One neads to hold the mutex before doing a mysql_cond_broadcast()
        This fixed the bug that INSERT DELAYED didn't work properly with DROP TABLE
      sql/sql_insert.cc:
        Protect setting of mysys_var->current_mutex.
      396f4d62
    • Sergei Golubchik's avatar
      5.2->5.3 merge · 4f67a147
      Sergei Golubchik authored
      4f67a147
    • Sergei Golubchik's avatar
      5.1 merge · bd87fed1
      Sergei Golubchik authored
      bd87fed1
  5. 09 Jan, 2013 3 commits
  6. 08 Jan, 2013 3 commits
  7. 07 Jan, 2013 1 commit
  8. 05 Jan, 2013 1 commit
  9. 01 Jan, 2013 1 commit
  10. 30 Dec, 2012 1 commit
  11. 28 Dec, 2012 2 commits
    • Elena Stepanova's avatar
      storage_engine tests and upstream engines/* suites went out of sync with... · 2371b6df
      Elena Stepanova authored
      storage_engine tests and upstream engines/* suites went out of sync with current MariaDB code. Reasons:
        - as of 5.5.27, YEAR(2) is deprecated, hence the new warning;
        - MDEV-553 - different error code/message on out-of-range autoincrement;
        - INSERT IGNORE now produces a warning if a duplicate was encountered (change pushed along with MDEV-553)
      
      2371b6df
    • unknown's avatar
      MDEV-3873 & MDEV-3876 & MDEV-3912 : Wrong result (extra rows) with ALL subquery · 6f26aac9
      unknown authored
      from a MERGE view.
      
      The problem was in the lost ability to be null for the table of a left join if it
      is a view/derived table.
      
      It hapenned because setup_table_map(), was called earlier then we merged
      the view or derived.
      
      Fixed by propagating new maybe_null flag during Item::update_used_tables().
      
      Change in join_outer.test and join_outer_jcl6.test appeared because
      IS NULL reported no used tables (i.e. constant) for argument which could not be
      NULL and new maybe_null flag was propagated for IS NULL argument (Item_field)
      because table the Item_field belonged to changed its maybe_null status.
      6f26aac9
  12. 21 Dec, 2012 3 commits
  13. 19 Dec, 2012 1 commit
    • unknown's avatar
      MDEV-3928: Assertion `example' failed in Item_cache::is_expensive_processor... · e99aa91e
      unknown authored
      MDEV-3928: Assertion `example' failed in Item_cache::is_expensive_processor with a 2-level IN subquery
      
      Analysis:
      The following call stack shows that it is possible to set Item_cache::value_cached, and the relevant value
      without setting Item_cache::example.
      
      #0 Item_cache_temporal::store_packed at item.cc:8395
      #1 get_datetime_value at item_cmpfunc.cc:915
      #2 resolve_const_item at item.cc:7987
      #3 propagate_cond_constants at sql_select.cc:12264
      #4 propagate_cond_constants at sql_select.cc:12227
      #5 optimize_cond at sql_select.cc:13026
      #6 JOIN::optimize at sql_select.cc:1016
      #7 st_select_lex::optimize_unflattened_subqueries at sql_lex.cc:3161
      #8 JOIN::optimize_unflattened_subqueries at opt_subselect.cc:4880
      #9 JOIN::optimize at sql_select.cc:1554
      
      The fix is to set Item_cache_temporal::example even when the value is
      set directly by Item_cache_temporal::store_packed. This makes the
      Item_cache_temporal object consistent.
      e99aa91e
  14. 11 Dec, 2012 1 commit
  15. 07 Dec, 2012 1 commit
    • Joerg Bruehe's avatar
      Last-minute fix to 5.1.67, · d07b5f1c
      Joerg Bruehe authored
      taking a change done to main 5.1 by Dmitri Lenev.
      
      This is the original comment:
      
      > committer: Dmitry Lenev <Dmitry.Lenev@oracle.com>
      > branch nick: mysql-5.1-15954896
      > timestamp: Wed 2012-12-05 19:26:56 +0400
      > message:
      >   Bug #15954896 "SP, MULTI-TABLE DELETE AND LONG ALIAS".
      
        Using too long table aliases in stored routines might
        have caused server crashes.
      
        Code in sp_head::merge_table_list() which is responsible
        for collecting information about tables used in stored
        routine was not aware of the fact that table alias might
        have arbitrary length. I.e. it assumed that table alias
        can't be longer than NAME_LEN bytes and allocated buffer
        for a key identifying table accordingly.
      
        This patch fixes the issue by ensuring that we use
        dynamically allocated buffer for table key when table
        alias is too long. By default stack based buffer is used
        in which NAME_LEN bytes are reserved for table alias.
      d07b5f1c
  16. 06 Dec, 2012 2 commits
  17. 21 Dec, 2012 1 commit
  18. 20 Dec, 2012 2 commits
    • Vladislav Vaintroub's avatar
      MDEV-3945 - do not hold LOCK_thread_count when freeing THD. · 21b4fda3
      Vladislav Vaintroub authored
        
      The patch decreases the duration of LOCK_thread_count, so it is not hold during THD destructor and freeing memory.
      This mutex  now only protects the integrity of threads list, when removing THD from it,  and thread_count variable.
        
      The add_to_status() function that updates global status during client disconnect,  is now correctly protected by the LOCK_status mutex.
      
      Benchmark : in a  "non-persistent" sysbench test (oltp_ro with reconnect after each query),  ~ 25% more connects/disconnects were measured
      21b4fda3
    • unknown's avatar
      MDEV-3899 Valgrind warnings (blocks are definitely lost) in filesort on IN... · 1b2692d0
      unknown authored
      MDEV-3899  Valgrind warnings (blocks are definitely lost) in filesort on IN subquery with SUM and DISTINCT
        
      Analysys:
      In the beginning of JOIN::cleanup there is code that is supposed to
      free all filesort buffers. The code assumes that the table being sorted
      is the first non-constant table. To get this table it calls:
      first_top_level_tab(this, WITHOUT_CONST_TABLES)
        
      However, first_top_level_tab() instead returned the wrong table - the first
      one in the plan, instead of the first non-constant table. There is no other
      place outside filesort() where sort buffers may be freed. As a result, the
      sort buffer was not freed, and there was a memory leak.
        
      Solution:
      Change first_top_level_tab(), to test for WITH_CONST_TABLES instead of
      WITHOUT_CONST_TABLES.
      1b2692d0
  19. 19 Dec, 2012 1 commit
    • Michael Widenius's avatar
      Fixed some compiler warnings · 35b60208
      Michael Widenius authored
      client/mysqldump.c:
        Removed compiler warning
      extra/yassl/taocrypt/include/pwdbased.hpp:
        Removed compiler warning (iterations is always unsigned)
      support-files/compiler_warnings.supp:
        Ignore warnings from groff
      35b60208
  20. 18 Dec, 2012 1 commit
  21. 17 Dec, 2012 2 commits
    • Michael Widenius's avatar
      Fixed the CREATE TABLE IF EXIST generates warnings instead of errors · 2dbce3d0
      Michael Widenius authored
      mysql-test/r/create.result:
        Updated test results
      mysql-test/t/create.test:
        Updated test
      sql/sql_base.cc:
        Use push_internal_handler/pop_internal_handler to avoid errors & warnings instead of clear_error
        Give a warnings instead of an error for CREATE TABLE IF EXISTS
      sql/sql_parse.cc:
        Check if we failed because of table exists (can only happen from create)
      sql/sql_table.cc:
        Check if we failed because of table exists (can only happen from create)
      2dbce3d0
    • unknown's avatar
      MDEV-3818: Query against view over IS tables worse than equivalent query without view · d7a01487
      unknown authored
      Analysis:
      The reason for the suboptimal plan when querying IS tables through a view
      was that the view columns that participate in an equality are wrapped by
      an Item_direct_view_ref and were not recognized as being direct column
      references.
      
      Solution:
      Use the original Item_field objects via the real_item() method.
      d7a01487
  22. 16 Dec, 2012 1 commit