1. 26 Sep, 2011 1 commit
    • Michael Widenius's avatar
      Allow one to block an account by using GRANT max_user_connections = -1 · 88b03b95
      Michael Widenius authored
      One can set @@global.max_user_connections to -1 to block anyone, except SUPER user, to login.
      If max_user_connection is 0, one can't change it without a restart (needed to get user connections counting to work correctly)
      
      
      mysql-test/r/system_mysql_db.result:
        Changed max_user_connections to handle negative numbers.
      mysql-test/r/user_limits-2.result:
        New test case that one can't change max_user_connection if it was 0
      mysql-test/r/user_limits.result:
        Fixed wrong error messages.
      mysql-test/r/variables.result:
        Store / restore max_user_connections (needed as there is now a --master.opt file that changes it)
      mysql-test/t/subselect_mat_cost-master.opt:
        Enable slow query log (as this test found some errors in slow query logging)
      mysql-test/t/user_limits-2.test:
        New test case that one can't change max_user_connection if it was 0
      mysql-test/t/user_limits-master.opt:
        Set max_user_connections (as one can't change it if it was 0)
      mysql-test/t/user_limits.test:
        Test max_user_connections -1
      mysql-test/t/variables-master.opt:
        Set max_user_connections (as one can't change it if it was 0)
      mysql-test/t/variables.test:
        Set/restore max_user_connections
      scripts/Makefile.am:
        Add a text message to mysql_fix_privilege_tables.sql that it's automaticly generated
      scripts/mysql_system_tables.sql:
        Change max_user_connections to signed
      scripts/mysql_system_tables_fix.sql:
        Change max_user_connections to signed
      sql/item_func.cc:
        Change SHOW_INT to be signed.
        (Needed for max_user_connections and it's probably a bug that it was not originally signed)
      sql/log.cc:
        Remove some code that was not needed (All these variables are reset at start of query)
      sql/mysql_priv.h:
        Made max_user_connections signed.
        Added max_user_connections_checking
      sql/mysqld.cc:
        Added max_user_connections_checking so that we know if max_user_connections was 0 at startup
        (Which means that we will not do connection counting for accounts that don't have user resource limits)
        Set thd->start_utime at same time as thr_create_utime. (Before start_utime could be < thr_create_utime which lead to wrong query counting)
      sql/set_var.cc:
        Don't allow one to change 'max_user_connections' if it was 0 at startup.
      sql/sql_acl.cc:
        Change user_connection counting to be negative.
      sql/sql_connect.cc:
        If max_user_connections is < 0 then only SUPER user can login.
        Fixed wrong variable names for error messages.
        Fixed wrong initial value for questions.
        Set thd->start_utime and thd->thr_create_utime at startup.  Needed to get time_out_user_resource_limits() to work.
      sql/sql_show.cc:
        SHOW_INT is now negative
      sql/sql_yacc.yy:
        Support negative values for MAX_USER_CONNECTIONS
      sql/structs.h:
        Make user connect counting work with signed numbers.
      88b03b95
  2. 23 Sep, 2011 1 commit
    • Michael Widenius's avatar
      Fixed issue with slow query logging where examined rows where wrong · a35e9c84
      Michael Widenius authored
      Reset 'examined_rows_count' in union to not count same rows twice
      
      mysql-test/r/subselect_mat_cost.result:
        Test also slow query logging
      mysql-test/t/subselect_mat_cost.test:
        Test also slow query logging
      sql/sql_union.cc:
        Reset 'examined_rows_count' in union to not count same rows twice
      a35e9c84
  3. 22 Sep, 2011 2 commits
    • Michael Widenius's avatar
      Added new options to KILL. New syntax is KILL [HARD|SOFT] [CONNECTION|QUERY] [ID | USER user_name] · 8d0c4696
      Michael Widenius authored
      - If USER is given, all threads for that user is signaled
      - If SOFT is used then the KILL will not be sent to the handler. This can be used to not interrupt critical things in the handler like 'REPAIR'.
      
      Internally added more kill signals. This gives us more information of why a query/connection was killed.
      - KILL_SERVER is used when server is going down. In this case the users gets ER_SHUTDOWN as the reason connection was killed.
      - Changed signals to number in correct order, which makes it easier to test how the signal should affect the code.
      - New error message ER_CONNECTION_KILLED if connection was killed by 'KILL CONNECTION'. Before we got error ER_SHUTDOWN.
      
      Changed names of not used parameters KILL_QUERY & KILL_CONNCTION to mysql_kill() to not conflict with defines in the server
      
      
      include/mysql.h.pp:
        Updated file
      include/mysql_com.h:
        Changed names of not used parameters KILL_QUERY & KILL_CONNCTION to mysql_kill() to not conflict with defines in the server
      mysql-test/r/kill.result:
        Added test of KILL USER
      mysql-test/suite/rpl/r/rpl_stm_000001.result:
        Updated error code
      mysql-test/suite/rpl/t/rpl_stm_000001.test:
        Updated error codes
      mysql-test/t/flush_read_lock_kill.test:
        Updated error codes
      mysql-test/t/kill.test:
        Added test of KILL USER
      plugin/handler_socket/handlersocket/database.cpp:
        Removed THD:: from KILL
      sql/debug_sync.cc:
        Removed THD:: from KILL
      sql/event_scheduler.cc:
        Removed THD:: from KILL
      sql/filesort.cc:
        Removed THD:: from KILL
      sql/ha_ndbcluster_binlog.cc:
        Removed THD:: from KILL
      sql/handler.cc:
        Removed THD:: from KILL
        Simplify code.
      sql/lex.h:
        Added new keywords HARD | SOFT
      sql/log.cc:
        Removed THD:: from KILL
        Added testing of new error ER_CONNECTION_KILLED
      sql/log_event.cc:
        Removed THD:: from KILL
        Added testing of new error ER_CONNECTION_KILLED
      sql/mysql_priv.h:
        Added new prototypes
      sql/mysqld.cc:
        Removed THD:: from KILL
        Use KILL_SERVER_HARD signal on shutdown.
      sql/scheduler.cc:
        Removed THD:: from KILL
        Simplify test if connection should be killed
      sql/share/errmsg.txt:
        New error message ER_CONNECTION_KILLED
      sql/slave.cc:
        Removed THD:: from KILL
      sql/sp_head.cc:
        Removed THD:: from KILL
      sql/sql_base.cc:
        Removed THD:: from KILL
      sql/sql_cache.cc:
        Removed THD:: from KILL
      sql/sql_class.cc:
        Removed THD:: from KILL
        Added killed_errno()
        Only signal kill to storage engine if HARD bit is set.
      sql/sql_class.h:
        Move KILL options out from THD to make them easier to use in sql_yacc.yy
      sql/sql_connect.cc:
        Removed THD:: from KILL
      sql/sql_delete.cc:
        Removed THD:: from KILL
      sql/sql_error.cc:
        Removed THD:: from KILL
      sql/sql_insert.cc:
        Removed THD:: from KILL
        Simplifed testing if thread is killed.
      sql/sql_lex.h:
        Added kill options to st_lex
      sql/sql_load.cc:
        Removed THD:: from KILL
      sql/sql_parse.cc:
        Added kill options to st_lex
        Simplifed and optimzed testing of thd->killed at end of query
        Added support for KILL USER
        Extended sql_kill() to allow use of more kill signals.
      sql/sql_repl.cc:
        Removed THD:: from KILL
      sql/sql_show.cc:
        Removed THD:: from KILL
        Simplied testing if query/connection was killed
      sql/sql_table.cc:
        Removed THD:: from KILL
      sql/sql_update.cc:
        Removed THD:: from KILL
      sql/sql_yacc.yy:
        Added support for new KILL syntax: KILL [HARD|SOFT] [CONNECTION|QUERY] [ID | USER user_name]
      storage/archive/ha_archive.cc:
        Simplify compilation
      storage/maria/ha_maria.cc:
        Removed THD:: from KILL
      8d0c4696
    • Sergei Golubchik's avatar
  4. 21 Sep, 2011 1 commit
  5. 20 Sep, 2011 2 commits
  6. 17 Sep, 2011 2 commits
    • Sergey Petrunya's avatar
      Merge · 6e0b11df
      Sergey Petrunya authored
      6e0b11df
    • Sergey Petrunya's avatar
      BUG##849717: Crash in Item_func::fix_fields on second execution of a prepared... · b04b47d2
      Sergey Petrunya authored
      BUG##849717: Crash in Item_func::fix_fields on second execution of a prepared statement with semijoin
      - If convert_join_subqueries_to_semijoins() decides to wrap Item_in_subselect in Item_in_optimizer, 
        it should do so in prep_on_expr/prep_where, too, as long as they are present.
        There seems to be two possibilities of how we arrive in this function:
        - prep_on_expr/prep_where==NULL, and will be set later by simplify_joins()
        - prep_on_expr/prep_where!=NULL, and it is a copy_and_or_structure()-made copy of on_expr/where.
        the latter can happen for some (but not all!) nested joins. This bug was that we didn't handle this case.
      b04b47d2
  7. 16 Sep, 2011 3 commits
  8. 15 Sep, 2011 4 commits
  9. 14 Sep, 2011 2 commits
  10. 13 Sep, 2011 2 commits
    • Sergey Petrunya's avatar
      BUG#730133: Wrong result with jkl = 7, BKA, ICP in maria-5.3 + compound index · a76232f9
      Sergey Petrunya authored
      - Mrr_ordered_index_reader::interrupt_read() and resume_read() should 
        save/restore not just index lookup tuple, but entire index tuple.
        Key parts that are not used for index lookup can be still used in
        pushed index condition. Failure to save/restore will cause the index
        condition to be evaluated over the wrong values.
      a76232f9
    • Michael Widenius's avatar
      Increased version number · cbad4f48
      Michael Widenius authored
      Give proper error to client on shutdown.
      
      configure.in:
        Increased version number
      mysql-test/mysql-test-run.pl:
        Ignore errors that one can get while running with --mysqld=--log-warnings=2
      mysql-test/r/variables.result:
        Remember original value of log_warnings
      mysql-test/suite/rpl/r/rpl_idempotency.result:
        Ignore errors that one can get while running with --mysqld=--log-warnings=2
      mysql-test/suite/rpl/t/rpl_idempotency.test:
        Ignore errors that one can get while running with --mysqld=--log-warnings=2
      mysql-test/t/variables.test:
        Remember original value of log_warnings
      sql/mysqld.cc:
        Give proper error to close_connection() on shutdown
      storage/maria/ha_maria.cc:
        Added missing DBUG_RETURN
      cbad4f48
  11. 10 Sep, 2011 2 commits
  12. 09 Sep, 2011 1 commit
    • Michael Widenius's avatar
      Fixed that automatic killing of delayed insert thread (in flush, alter table... · b08627f9
      Michael Widenius authored
      Fixed that automatic killing of delayed insert thread (in flush, alter table etc) will not abort auto-repair of MyISAM table.
      Give more information when finding an error in a MyISAM table.
      When killing system thread, use KILL_SYSTEM_THREAD instead of KILL_CONNECTION to make it easier to ignore the signal in sensitive context (like auto-repair)
      Added new kill level: KILL_SERVER that will in the future to be used to signal killed by shutdown.
      Add more warnings about killed connections when warning level > 3
      
      include/myisamchk.h:
        Added counting of printed info/notes
      mysys/mf_iocache.c:
        Remove duplicate assignment
      sql/handler.cc:
        Added test of KILL_SERVER
      sql/log.cc:
        Ignore new 'kill' error ER_NEW_ABORTING_CONNECTION when requesting query error code.
      sql/mysqld.cc:
        Add more warnings for killed connections when warning level > 3
      sql/scheduler.cc:
        Added checks for new kill signals
      sql/slave.cc:
        Ignore new kill signal ER_NEW_ABORTING_CONNECTION
      sql/sp_head.cc:
        Fixed assignment to bool
        Added testing of new kill signals
      sql/sql_base.cc:
        Use KILL_SYSTEM_THREAD to auto-kill system threads
      sql/sql_class.cc:
        Add more warnings for killed connections when warning level > 3
        thd_killed() now ignores KILL_BAD_DATA and THD::KILL_SYSTEM_THREAD as these should not abort sensitive operations.
      sql/sql_class.h:
        Added KILL_SYSTEM_THREAD and KILL_SERVER
      sql/sql_connect.cc:
        Added handling of KILL_SERVER
      sql/sql_insert.cc:
        Use KILL_SYSTEM_THREAD to auto-kill system threads
        Added handling of KILL_SERVER
      sql/sql_parse.cc:
        Add more warnings for killed connections when warning level > 3
        Added checking that thd->abort_on_warning is reset at end of query.
      sql/sql_show.cc:
        Update condition for when a query is 'killed'
      storage/myisam/ha_myisam.cc:
        Added counting of info/notes printed
      storage/myisam/mi_check.c:
        Always print an an error if we find data errors when checking/repairing a MyISAM table.
        When a repair was killed, don't retry repair.
        Added assert if sort_get_next_record() returned an error without an error message.
        Removed nonsence check "if (sort_param->read_cache.error < 0)" in repair.
      storage/myisam/myisamchk.c:
        Added counting of notes printed
      storage/pbxt/src/thread_xt.cc:
        Better error message.
      b08627f9
  13. 08 Sep, 2011 5 commits
    • Sergey Petrunya's avatar
      BUG#833600: Wrong result with view + outer join + uncorrelated subquery (non-semijoin) · c8c42fed
      Sergey Petrunya authored
      - The bug was caused by outer join being incorrectly converted into inner because of 
        invalid return values of Item_direct_view_ref::not_null_tables().
      - Provided a correct Item_direct_view_ref::not_null_tables() function.
      c8c42fed
    • Sergey Petrunya's avatar
      Automerge. · 14989478
      Sergey Petrunya authored
      14989478
    • Igor Babaev's avatar
      Merge. · 8d6a9da1
      Igor Babaev authored
      8d6a9da1
    • Sergey Petrunya's avatar
      BUG#830993: Crash in end_read_record with derived table · 1c46ce95
      Sergey Petrunya authored
      - Let join buffering code correctly take into account rowids needed 
        by DuplicateElimination when it is calculating minimum record sizes.
      - In JOIN_CACHE::write_record_data, added asserts that prevent us from 
        writing beyond the end of the buffer.
      1c46ce95
    • unknown's avatar
      LP BUG#813418 fix. · 8820f80a
      unknown authored
      The problem was that optimization code did not take into account later feature when instad of NOT before BETWEEN it has negated flag into the Item_func_between inherited from Item_func_neg_opt. So optimizer tried process NOT BETWEEN as BETWEEN.
      
      The patch just switches off the optimisation for NOT BETWEEN as it was before when NOT function was really used.
      8820f80a
  14. 07 Sep, 2011 1 commit
  15. 06 Sep, 2011 5 commits
    • Sergey Petrunya's avatar
      Merge · 75c5a961
      Sergey Petrunya authored
      75c5a961
    • Sergey Petrunya's avatar
      Fix typo bug · 092ec56c
      Sergey Petrunya authored
      092ec56c
    • Igor Babaev's avatar
      Merge. · eeaca56c
      Igor Babaev authored
      eeaca56c
    • Igor Babaev's avatar
      Fixed LP bug #838633. · 000d33e0
      Igor Babaev authored
      For any query JOIN::optimize() should call the method
      SELECT::save_leaf_tables after the last transformation
      that utilizes the statement memory rather than the 
      execution memory.
        
      000d33e0
    • Sergey Petrunya's avatar
      BUG#823930: Wrong result with semijoin materialization and blob fields · add730d3
      Sergey Petrunya authored
      - Make subquery_types_allow_materialization() detect a case where 
        create_tmp_table() would create a blob column which would make it 
        impossible to use materialization
        Non-semi-join materialization worked because it detected that this case
        and felt back to use IN->EXISTS. Semi-join Materialization cannot easily
        fallback, so we have to detect this case early.
      add730d3
  16. 05 Sep, 2011 6 commits