An error occurred fetching the project authors.
  1. 26 Mar, 2011 1 commit
  2. 03 Jan, 2011 1 commit
    • Michael Widenius's avatar
      Implementation of MWL#172: Add support for prepared statements to HANDLER READ · 4e9bf0ed
      Michael Widenius authored
      It includes speed optimizations for HANDLER READ by caching as much as possible in HANDLER OPEN
      Other things:
      - Added mysqld option --disable-thr-alarm to be able to benchmark things without thr_alarm
      - Changed 'Locked' state to 'System lock' and 'Table lock' (these where used in the code but never shown to end user)
      - Better error message if mysql_install_db.sh fails
      - Moved handler function prototypes to sql_handler.h
      - Remove not anymore used 'thd->locked' member
      
      
      include/thr_alarm.h:
        Added my_disable_thr_alarm
      include/thr_lock.h:
        Add new member to THR_LOCK_DATA to remember original lock type state. This is needed as thr_unlock() resets type to TL_UNLOCK.
      mysql-test/include/check_no_concurrent_insert.inc:
        Locked -> Table lock
      mysql-test/include/handler.inc:
        Locked -> Table lock
      mysql-test/r/handler_innodb.result:
        Updated results for new tests
      mysql-test/r/handler_myisam.result:
        Updated results for new tests
      mysql-test/r/sp-threads.result:
        Locked -> Table lock
      mysql-test/suite/binlog/t/binlog_stm_row.test:
        Locked -> Table lock
      mysql-test/suite/funcs_1/datadict/processlist_val.inc:
        Locked -> Table lock
      mysql-test/suite/pbxt/t/lock_multi.test:
        Locked -> Table lock
      mysql-test/suite/sys_vars/r/concurrent_insert_func.result:
        Locked -> Table lock
      mysql-test/suite/sys_vars/t/concurrent_insert_func.test:
        Locked -> Table lock
      mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test:
        Locked -> Table lock
      mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test:
        Locked -> Table lock
      mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test:
        Locked -> Table lock
      mysql-test/t/insert_notembedded.test:
        Locked -> Table lock
      mysql-test/t/lock_multi.test:
        Locked -> Table lock
      mysql-test/t/merge-big.test:
        Locked -> Table lock
      mysql-test/t/multi_update.test:
        Locked -> Table lock
      mysql-test/t/query_cache_28249.test:
        Locked -> Table lock
      mysql-test/t/sp_notembedded.test:
        Locked -> Table lock
      mysql-test/t/sp_sync.test:
        Locked -> Table lock
      mysql-test/t/status.test:
        Locked -> Table lock
      mysql-test/t/trigger_notembedded.test:
        Locked -> Table lock
      mysys/thr_alarm.c:
        Added option to disable thr_alarm
      mysys/thr_lock.c:
        Detect loops
      scripts/mysql_install_db.sh:
        Give better error message if something goes wrong
      sql/Makefile.am:
        Added sql_handler.h
      sql/lock.cc:
        Split functions to allow one to cache value if store_lock() (for HANDLER functions).
        - Split mysql_lock_tables() into two functions, where first one allocates MYSQL_LOCK and other other one uses it.
        - Made get_lock_data() an external function.
        - Added argument to mysql_unlock_tables() to not free sql_lock.
        - Added argument to reset_lock_data() to reset lock structure to initial state (as after get_lock_data())
      sql/mysql_priv.h:
        Moved handler function prototypes to sql_handler.h
        Added new lock functions.
      sql/mysqld.cc:
        Added --thread-alarm startup option
      sql/net_serv.cc:
        Don't call vio_blocking() if not needed
      sql/sql_base.cc:
        include sql_handler.h
      sql/sql_class.cc:
        include sql_handler.h
        Remove not anymore used 'thd->locked' member
      sql/sql_class.h:
        Remove not anymore used 'thd->locked' member
      sql/sql_db.cc:
        include sql_handler.h
      sql/sql_delete.cc:
        include sql_handler.h
      sql/sql_handler.cc:
        Rewrote all code to use SQL_HANDLER instead of TABLE_LIST (original interface)
        Rewrote mysql_ha_open() to cache all things from TABLE_LIST and items for field list, where etc.
        In mysql_ha_open() also cache MYSQL_LOCK structure from get_lock_data().
        Split functions into smaller sub functions (needed to be able to implement mysql_ha_read_prepare())
        Added mysql_ha_read_prepare() to allow one to prepare HANDLER READ.
      sql/sql_handler.h:
        Interface to sql_handler.cc
      sql/sql_parse.cc:
        include sql_handler.h
      sql/sql_prepare.cc:
        Added mysql_test_handler_read(), prepare for HANDLER READ
      sql/sql_rename.cc:
        include sql_handler.h
      sql/sql_show.cc:
        Removed usage of thd->locked
      sql/sql_table.cc:
        include sql_handler.h
      sql/sql_trigger.cc:
        include sql_handler.h
      4e9bf0ed
  3. 23 Sep, 2010 1 commit
    • Michael Widenius's avatar
      Fix usage of mysqld option --new, --old, --safe and --skip_new to not disable... · ddfe2129
      Michael Widenius authored
      Fix usage of mysqld option --new, --old, --safe and --skip_new to not disable things that are proven stable or enable things that are not usefull.
      
      
      sql/field.cc:
        Remove feature of 'new_mode' that was never implemtented in a newer MySQL version.
      sql/item_cmpfunc.cc:
        Boyer more is stable; Don't have to be protected by --skip-new anymore
      sql/mysqld.cc:
        Don't disable some proven stable functions with --skip-new
      sql/records.cc:
        Don't disable record caching with --safe-mode anymore
      sql/sql_delete.cc:
        Do fast truncate even if --skip-new or --safe is used
      sql/sql_parse.cc:
        Use always mysql_optimizer() for optimizer (instead of mysql_recreate_table() in case of --safe or --skip-new)
      sql/sql_select.cc:
        Don't disable 'only_eq_ref_tables' if --safe is used.
      sql/sql_yacc.yy:
        Removed not meaningfull test of --old
      ddfe2129
  4. 19 Jul, 2010 1 commit
    • Jon Olav Hauglid's avatar
      Bug #54734 assert in Diagnostics_area::set_ok_status · b10bd9b9
      Jon Olav Hauglid authored
      This assert checks that the server does not try to send OK to the
      client if there has been some error during processing. This is done
      to make sure that the error is in fact sent to the client.
      
      The problem was that view errors during processing of WHERE conditions
      in UPDATE statements where not detected by the update code. It therefore
      tried to send OK to the client, triggering the assert.
      The bug was only noticeable in debug builds.
      
      This patch fixes the problem by making sure that the update code
      checks for errors during condition processing and acts accordingly.
      b10bd9b9
  5. 17 Jul, 2010 1 commit
    • Igor Babaev's avatar
      Fixed bug #604503. · 1b165329
      Igor Babaev authored
      If the expression for a virtual column of table contained datetime
      comparison then the execution of the second query that used this
      virtual column caused a crash. It happened because the execution
      of the first query that used this virtual column inserted a cached
      item into the expression tree. The cached tree was allocated in
      the statement memory while the expression tree was allocated in
      the table memory.
      Now the cached items that are inserted into expressions for virtual
      columns with datetime comparisons are always allocated in the same
      mem_root as the expressions for virtual columns. So now the inserted
      cached items are valid for any queries that use these virtual columns. 
      1b165329
  6. 16 Jul, 2010 1 commit
    • Michael Widenius's avatar
      Fix for LP#588251: doStartTableScan() result not checked. · b55104d9
      Michael Widenius authored
      The issue was that we didn't always check result of ha_rnd_init() which caused a problem for handlers that returned an error in this code.
      - Changed prototype of ha_rnd_init() to ensure that we get a compile warning if result is not checked.
      - Added ha_rnd_init_with_error() that prints error on failure.
      - Checked all usage of ha_rnd_init() and ensure we generate an error message on failures.
      - Changed init_read_record() to return 1 on failure.
      
      
      
      
      sql/create_options.cc:
        Fixed wrong printf
      sql/event_db_repository.cc:
        Check result from init_read_record()
      sql/events.cc:
        Check result from init_read_record()
      sql/filesort.cc:
        Check result from ha_rnd_init()
      sql/ha_partition.cc:
        Check result from ha_rnd_init()
      sql/ha_partition.h:
        Fixed compiler warning
      sql/handler.cc:
        Added ha_rnd_init_with_error()
        Check result from ha_rnd_init()
      sql/handler.h:
        Added ha_rnd_init_with_error()
        Changed prototype of ha_rnd_init() to ensure that we get a compile warning if result is not checked
      sql/item_subselect.cc:
        Check result from ha_rnd_init()
      sql/log.cc:
        Check result from ha_rnd_init()
      sql/log_event.cc:
        Check result from ha_rnd_init()
      sql/log_event_old.cc:
        Check result from ha_rnd_init()
      sql/mysql_priv.h:
        init_read_record() now returns error code on failure
      sql/opt_range.cc:
        Check result from ha_rnd_init()
      sql/records.cc:
        init_read_record() now returns error code on failure
        Check result from ha_rnd_init()
      sql/sql_acl.cc:
        Check result from init_read_record()
      sql/sql_cursor.cc:
        Print error if ha_rnd_init() fails
      sql/sql_delete.cc:
        Check result from init_read_record()
      sql/sql_help.cc:
        Check result from init_read_record()
      sql/sql_plugin.cc:
        Check result from init_read_record()
      sql/sql_select.cc:
        Check result from ha_rnd_init()
        Print error if ha_rnd_init() fails.
      sql/sql_servers.cc:
        Check result from init_read_record()
      sql/sql_table.cc:
        Check result from init_read_record()
      sql/sql_udf.cc:
        Check result from init_read_record()
      sql/sql_update.cc:
        Check result from init_read_record()
      storage/example/ha_example.cc:
        Don't return error on rnd_init()
      storage/ibmdb2i/ha_ibmdb2i.cc:
        Removed not relevant comment
      b55104d9
  7. 03 Jul, 2010 1 commit
    • Igor Babaev's avatar
      Fixed bug #601164. · cb25707c
      Igor Babaev authored
      The functions mysql_delete and mysql_update lacked calls of
      updated_virtual_fields(). This caused wrong results for
      some DELETEs/UPDATEs.
      Added test cases for this bug.
      cb25707c
  8. 10 Jun, 2010 1 commit
    • Davi Arnaut's avatar
      Bug#42733: Type-punning warnings when compiling MySQL -- · fd4b3c6c
      Davi Arnaut authored
                  strict aliasing violations.
      
      One somewhat major source of strict-aliasing violations and
      related warnings is the SQL_LIST structure. For example,
      consider its member function `link_in_list` which takes
      a pointer to pointer of type T (any type) as a pointer to
      pointer to unsigned char. Dereferencing this pointer, which
      is done to reset the next field, violates strict-aliasing
      rules and might cause problems for surrounding code that
      uses the next field of the object being added to the list.
      
      The solution is to use templates to parametrize the SQL_LIST
      structure in order to deference the pointers with compatible
      types. As a side bonus, it becomes possible to remove quite
      a few casts related to acessing data members of SQL_LIST.
      
      sql/handler.h:
        Use the appropriate template type argument.
      sql/item.cc:
        Remove now-unnecessary cast.
      sql/item_subselect.cc:
        Remove now-unnecessary casts.
      sql/item_sum.cc:
        Use the appropriate template type argument.
        Remove now-unnecessary cast.
      sql/mysql_priv.h:
        Move SQL_LIST structure to sql_list.h
        Use the appropriate template type argument.
      sql/sp.cc:
        Remove now-unnecessary casts.
      sql/sql_delete.cc:
        Use the appropriate template type argument.
        Remove now-unnecessary casts.
      sql/sql_derived.cc:
        Remove now-unnecessary casts.
      sql/sql_lex.cc:
        Remove now-unnecessary casts.
      sql/sql_lex.h:
        SQL_LIST now takes a template type argument which must
        match the type of the elements of the list. Use forward
        declaration when the type is not available, it is used
        in pointers anyway.
      sql/sql_list.h:
        Rename SQL_LIST to SQL_I_List. The template parameter is
        the type of object that is stored in the list.
      sql/sql_olap.cc:
        Remove now-unnecessary casts.
      sql/sql_parse.cc:
        Remove now-unnecessary casts.
      sql/sql_prepare.cc:
        Remove now-unnecessary casts.
      sql/sql_select.cc:
        Remove now-unnecessary casts.
      sql/sql_show.cc:
        Remove now-unnecessary casts.
      sql/sql_table.cc:
        Remove now-unnecessary casts.
      sql/sql_trigger.cc:
        Remove now-unnecessary casts.
      sql/sql_union.cc:
        Remove now-unnecessary casts.
      sql/sql_update.cc:
        Remove now-unnecessary casts.
      sql/sql_view.cc:
        Remove now-unnecessary casts.
      sql/sql_yacc.yy:
        Remove now-unnecessary casts.
      storage/myisammrg/ha_myisammrg.cc:
        Remove now-unnecessary casts.
      fd4b3c6c
  9. 26 May, 2010 1 commit
    • Igor Babaev's avatar
      Changed the fixes for the following bugs: · 13c736f5
      Igor Babaev authored
      Bug #39022: completed
      Bug #39653: reverted as invalid
      Bug #45640: ameliorated, simplified, optimized
      Bug #48483: completed
      Bug #49324: improved
      Bug #51242/52336: reverted, applied a real fix.
      13c736f5
  10. 14 May, 2010 1 commit
    • Gleb Shchepa's avatar
      Bug #53450: Crash / assertion "virtual int · 2cfa397d
      Gleb Shchepa authored
                  ha_myisam::index_first(uchar*)") at assert.c:81
      
      Single-table DELETE crash/assertion similar to single-table
      UPDATE bug 14272.
      
      Same resolution as for the bug 14272:
      Don't run index scan when we should use quick select.
      This could cause failures because there are table handlers (like federated)
      that support quick select scanning but do not support index scanning.
      
      
      mysql-test/r/delete.result:
        Test case for bug #53450.
      mysql-test/t/delete.test:
        Test case for bug #53450.
      sql/sql_delete.cc:
        Bug #53450: Crash / assertion "virtual int
                    ha_myisam::index_first(uchar*)") at assert.c:81
        
        The mysql_delete function has been modified to not to use
        init_read_record_idx instead of init_read_record for the
        quick select.
      2cfa397d
  11. 12 May, 2010 1 commit
    • Staale Smedseng's avatar
      Bug #49756 Rows_examined is always 0 in the slow query log for · 5bb5e0f2
      Staale Smedseng authored
      update statements
            
      Only SELECT statements report any examined rows in the slow
      log. Slow UPDATE, DELETE and INSERT statements report 0 rows
      examined, unless the statement has a condition including a
      SELECT substatement.
            
      This patch adds counting of examined rows for the UPDATE and
      DELETE statements. An INSERT ... VALUES statement will still 
      not report any rows as examined.
      
      
      
      sql/sql_class.h:
        Added more docs for THD::examined_row_count.
      sql/sql_delete.cc:
        Add incrementing thd->examined_row_count.
      sql/sql_update.cc:
        Add incrementing thd->examined_row_count.
      5bb5e0f2
  12. 10 Mar, 2010 1 commit
    • Michael Widenius's avatar
      Fix for: Bug#44987 DELETE IGNORE and FK constraint · 85702855
      Michael Widenius authored
      - Now DELETE IGNORE skips over rows with a foreign key constraints (as it was supposed to do)
      
      
      mysql-test/r/foreign_key.result:
        Test case for Bug#44987 DELETE IGNORE and FK constraint
      mysql-test/t/foreign_key.test:
        Test case for Bug#44987 DELETE IGNORE and FK constraint
      sql/sql_delete.cc:
        Firx for Bug#44987 DELETE IGNORE and FK constraint
        Now DELETE IGNORE skips over rows with a foreign key constraints (as it was supposed to do)
        Bug fix inspired by: Moritz Mertinkat
      85702855
  13. 26 Feb, 2010 1 commit
  14. 24 Feb, 2010 1 commit
    • Luis Soares's avatar
      BUG#51251: Wrong binlogging in case of TRUNCATE <temporary InnoDB table> · 4119ff81
      Luis Soares authored
      For temporary tables that are created with an engine that does
      not provide the HTON_CAN_RECREATE, the truncate operation is
      performed resorting to the optimized handler::ha_delete_all_rows
      method. However, this means that the truncate will share
      execution path, from mysql_delete, with truncate on regular
      tables and other delete operations. As a consequence the truncate
      operation, for the temporary table is logged, even if in row mode
      because there is no distinction between this and the other delete
      operations at binlogging time.
      
      We fix this by checking if: (i) the binlog format, when the
      truncate operation was issued, is ROW; (ii) if the operation is a
      truncate; and (iii) if the table is a temporary table; before
      writing to the binary log. If all three conditions are met, we
      skip writing to the binlog. A side effect of this fix is that we
      limit the scope of setting and resetting the
      current_stmt_binlog_row_based. Now we just set and reset it
      inside mysql_delete in the boundaries of the
      handler::ha_write_row loop. This way we have access to
      thd->current_stmt_binlog_row_based real value inside
      mysql_delete.
      
      mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
        Updated result for spurious truncate table.
      mysql-test/suite/binlog/t/binlog_row_innodb_truncate.test:
        Test case.
      sql/sql_delete.cc:
        Added check in mysql_delete before writing the TRUNCATE statement
        to the binary log. Additionally, removed the set/reset of
        current_stmt_binlog_row_based so that it happens just in the 
        boundaries of the handler::ha_write_row loop inside mysql_delete.
      4119ff81
  15. 10 Feb, 2010 1 commit
    • Michael Widenius's avatar
      When one does a drop table, the indexes are not flushed to disk before drop... · c7b97d14
      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.
      c7b97d14
  16. 24 Jan, 2010 1 commit
  17. 22 Nov, 2009 1 commit
    • unknown's avatar
      Bug #48350 truncate temporary table crashes replication · fa4c0203
      unknown authored
      In RBR, All statements operating on temporary tables should not be binlogged.
      Despite this fact, after executing 'TRUNCATE... ' on a temporary table, 
      the command is still logged, even if in row-based mode. Consequently, this raises
      problems in the slave as the table may not exist, resulting in an
      execution failure. Ultimately, this causes the slave to report
      an error and abort.
      
      After this patch, 'TRUNCATE ...' statement on a temporary table will not be
      binlogged in RBR.
      fa4c0203
  18. 18 Nov, 2009 1 commit
    • Magne Mahre's avatar
      Bug #46425 crash in Diagnostics_area::set_ok_status , empty statement, · a9d63391
      Magne Mahre authored
                 DELETE IGNORE
      
      The ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG error was set in the
      diagnostics area when it happened, but the DELETE cleanup code
      never checked for a non-fatal error condition, thus trying to
      set diag.area to "ok".  This triggered an assert checking that
      the diag.area was empty.
      
      The fix was to test if there existed a non-fatal error condition
      (thd->is_error() before ok'ing the operation.
      a9d63391
  19. 16 Nov, 2009 1 commit
    • Michael Widenius's avatar
      Safety change to ensure read/black trees (used with heap tables) works on 64... · 40197f0f
      Michael Widenius authored
      Safety change to ensure read/black trees (used with heap tables) works on 64 bit setups where ulong <> size_t
      Don't retry test cases by default
      Fixed bug where we could (under unlikely error conditions) access not initialized variable
      
      include/my_tree.h:
        Safety change to ensure read/black trees (used with heap tables) works on 64 bit setups where ulong <> size_t
        (Pointed out by Bryan Aker)
      mysql-test/mysql-test-run.pl:
        Don't retry test cases by default
        This makes it too easy to miss failures and we have anyway to fix race conditions, not ignore them.
      mysys/tree.c:
        Safety change to ensure read/black trees (used with heap tables) works on 64 bit setups where ulong <> size_t
      sql/sql_delete.cc:
        Fixed bug where we could (under unlikely error conditions) access not initialized variable.
        (Pointed out by Bryan Aker)
      40197f0f
  20. 16 Oct, 2009 1 commit
    • Georgi Kodinov's avatar
      Bug #40877: multi statement execution fails in 5.1.30 · 9c6668d6
      Georgi Kodinov authored
            
      Implemented the server infrastructure for the fix:
      
      1. Added a function LEX_STRING *thd_query_string(THD) to return
      a LEX_STRING structure instead of char *.
      This is the function that must be called in innodb instead of 
      thd_query()
      
      2. Did some encapsulation in THD : aggregated thd_query and 
      thd_query_length into a LEX_STRING and made accessor and mutator 
      methods for easy code updating. 
      
      3. Updated the server code to use the new methods where applicable.
      9c6668d6
  21. 28 Sep, 2009 1 commit
    • Martin Hansson's avatar
      · 24f97dc1
      Martin Hansson authored
      Bug#46958: Assertion in Diagnostics_area::set_ok_status, 
      trigger, merge table
                  
      The problem with break statements is that they have very
      local effects. Hence a break statement within the inner loop
      of a nested-loops join caused execution to proceed to the
      next table even though a serious error occurred. The problem
      was fixed by breaking out the inner loop into its own
      method. The change empowers all errors to terminate the
      execution.
                  
      The errors that will now halt multi-DELETE execution
      altogether are 
        - triggers returning errors
        - handler errors
        - server being killed
      
      
      mysql-test/r/delete.result:
        Bug#46958: Test result.
      mysql-test/t/delete.test:
        Bug#46958: Test case.
      sql/sql_class.h:
        Bug#46958: New method declaration.
      sql/sql_delete.cc:
        Bug#46958: New method implementation.
      24f97dc1
  22. 22 Sep, 2009 1 commit
    • MySQL Build Team's avatar
      Backport into build-200909221805-5.1.37sp1 · e06fe916
      MySQL Build Team authored
      > ------------------------------------------------------------
      > revno: 3075
      > revision-id: ramil@mysql.com-20090821055535-a5aeas33epokjjnp
      > parent: joro@sun.com-20090820141122-gq6eyozybvar4o4s
      > committer: Ramil Kalimullin <ramil@mysql.com>
      > branch nick: mysql-5.1-bugteam
      > timestamp: Fri 2009-08-21 10:55:35 +0500
      > message:
      >   Fix for bug #46456 [Ver->Prg]: HANDLER OPEN + TRUNCATE + DROP
      >   (temporary) TABLE, crash
      >   
      >   Problem: if one has an open "HANDLER t1", further "TRUNCATE t1" 
      >   doesn't close the handler and leaves handler table hash in an 
      >   inconsistent state, that may lead to a server crash.
      >   
      >   Fix: TRUNCATE should implicitly close all open handlers.
      >   
      >   Doc. request: the fact should be described in the manual accordingly.
      e06fe916
  23. 21 Aug, 2009 1 commit
    • Ramil Kalimullin's avatar
      Fix for bug #46456 [Ver->Prg]: HANDLER OPEN + TRUNCATE + DROP · 61d4fabd
      Ramil Kalimullin authored
      (temporary) TABLE, crash
      
      Problem: if one has an open "HANDLER t1", further "TRUNCATE t1" 
      doesn't close the handler and leaves handler table hash in an 
      inconsistent state, that may lead to a server crash.
      
      Fix: TRUNCATE should implicitly close all open handlers.
      
      Doc. request: the fact should be described in the manual accordingly.
      
      
      mysql-test/r/handler_myisam.result:
        Fix for bug #46456 [Ver->Prg]: HANDLER OPEN + TRUNCATE + DROP
        (temporary) TABLE, crash
          - test result.
      mysql-test/t/handler_myisam.test:
        Fix for bug #46456 [Ver->Prg]: HANDLER OPEN + TRUNCATE + DROP
        (temporary) TABLE, crash
          - test case.
      sql/sql_delete.cc:
        Fix for bug #46456 [Ver->Prg]: HANDLER OPEN + TRUNCATE + DROP
         (temporary) TABLE, crash
          - remove all truncated tables from the HANDLER's hash.
      61d4fabd
  24. 13 Jul, 2009 1 commit
    • Georgi Kodinov's avatar
      Bug #40113: Embedded SELECT inside UPDATE or DELETE can timeout · 045741fb
      Georgi Kodinov authored
      without error
      
      When using quick access methods for searching rows in UPDATE or 
      DELETE there was no check if a fatal error was not already sent 
      to the client while evaluating the quick condition.
      As a result a false OK (following the error) was sent to the 
      client and the error was thus transformed into a warning.
      
      Fixed by checking for errors sent to the client during 
      SQL_SELECT::check_quick() and treating them as real errors.
      
      Fixed a wrong test case in group_min_max.test
      Fixed a wrong return code in mysql_update() and mysql_delete()
      
      mysql-test/r/bug40113.result:
        Bug #40013: test case
      mysql-test/r/group_min_max.result:
        Bug #40013: fixed a wrong test case
      mysql-test/t/bug40113-master.opt:
        Bug #40013: test case
      mysql-test/t/bug40113.test:
        Bug #40013: test case
      mysql-test/t/group_min_max.test:
        Bug #40013: fixed a wrong test case
      sql/sql_delete.cc:
        Bug #40113: check for errors evaluating the quick select
      sql/sql_update.cc:
        Bug #40113: check for errors evaluating the quick select
      045741fb
  25. 19 Jun, 2009 1 commit
    • Sergey Glukhov's avatar
      Bug#44834 strxnmov is expected to behave as you'd expect · 524191be
      Sergey Glukhov authored
      The problem: described in the bug report.
      The fix:
      --increase buffers where it's necessary
        (buffers which are used in stxnmov)
      --decrease buffer lengths which are used
      
      
      client/mysql.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/ha_ndbcluster.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/ha_ndbcluster_binlog.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/handler.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/log.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/mysqld.cc:
        removed unnecessary line
      sql/parse_file.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/sql_acl.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/sql_base.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/sql_db.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/sql_delete.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/sql_partition.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/sql_rename.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/sql_show.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/sql_table.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/sql_view.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      524191be
  26. 18 Jun, 2009 1 commit
    • Alfranio Correia's avatar
      BUG#43929 binlog corruption when max_binlog_cache_size is exceeded · eb708edc
      Alfranio Correia authored
      Large transactions and statements may corrupt the binary log if the size of the
      cache, which is set by the max_binlog_cache_size, is not enough to store the
      the changes.
      
      In a nutshell, to fix the bug, we save the position of the next character in the
      cache before starting processing a statement. If there is a problem, we simply
      restore the position thus removing any effect of the statement from the cache.
      Unfortunately, to avoid corrupting the binary log, we may end up loosing changes
      on non-transactional tables if they do not fit in the cache. In such cases, we
      store an Incident_log_event in order to stop the slave and alert users that some
      changes were not logged.
      
      Precisely, for every non-transactional changes that do not fit into the cache,
      we do the following:
        a) the statement is *not* logged
        b) an incident event is logged after committing/rolling back the transaction,
        if any. Note that if a failure happens before writing the incident event to
        the binary log, the slave will not stop and the master will not have reported
        any error.
        c) its respective statement gives an error
      
      For transactional changes that do not fit into the cache, we do the following:
        a) the statement is *not* logged
        b) its respective statement gives an error
      
      To work properly, this patch requires two additional things. Firstly, callers to
      MYSQL_BIN_LOG::write and THD::binlog_query must handle any error returned and
      take the appropriate actions such as undoing the effects of a statement. We
      already changed some calls in the sql_insert.cc, sql_update.cc and sql_insert.cc
      modules but the remaining calls spread all over the code should be handled in
      BUG#37148. Secondly, statements must be either classified as DDL or DML because
      DDLs that do not get into the cache must generate an incident event since they
      cannot be rolled back.
      eb708edc
  27. 17 Jun, 2009 1 commit
    • Staale Smedseng's avatar
      Bug #43414 Parenthesis (and other) warnings compiling MySQL · 2be7b06b
      Staale Smedseng authored
      with gcc 4.3.2
            
      Compiling MySQL with gcc 4.3.2 and later produces a number of 
      warnings, many of which are new with the recent compiler
      versions.
                        
      This bug will be resolved in more than one patch to limit the
      size of changesets. This is the second patch, fixing more
      of the warnings.
      2be7b06b
  28. 10 Jun, 2009 1 commit
    • Staale Smedseng's avatar
      Bug #43414 Parenthesis (and other) warnings compiling MySQL · 9e7c9d10
      Staale Smedseng authored
      with gcc 4.3.2
      
      Compiling MySQL with gcc 4.3.2 and later produces a number of 
      warnings, many of which are new with the recent compiler
      versions.
                  
      This bug will be resolved in more than one patch to limit the
      size of changesets. This is the second patch, fixing more
      of the warnings.
      9e7c9d10
  29. 30 May, 2009 1 commit
    • He Zhenxing's avatar
      BUG#41948 Query_log_event constructor needlessly contorted · 38e27260
      He Zhenxing authored
      Make the caller of Query_log_event, Execute_load_log_event
      constructors and THD::binlog_query to provide the error code
      instead of having the constructors to figure out the error code.
      
      sql/log_event.cc:
        Changed constructors of Query_log_event and Execute_load_log_event to accept the error code argument instead of figuring it out by itself
      sql/log_event.h:
        Changed constructors of Query_log_event and Execute_load_log_event to accept the error code argument
      38e27260
  30. 06 May, 2009 1 commit
    • Anurag Shekhar's avatar
      Bug #39918 memory (heap) engine crashing with b-tree index and DELETE · c7c169ed
      Anurag Shekhar authored
               with seg fault
      
      Multiple-table DELETE from a table joined to itself may cause
      server crash. This was originally discovered with MEMORY engine,
      but may affect other engines with different symptoms.
      
      The problem was that the server violated SE API by performing
      parallel table scan in one handler and removing records in
      another (delete on the fly optimization).
      
      
      mysql-test/r/heap_btree.result:
        Updated test result after adding new test for this bug.
      mysql-test/t/heap_btree.test:
        Updated test result after adding new test for the bug report.
      sql/sql_delete.cc:
        Updated to check if the files in delete list appears in join list and disable 
        delete while scanning, if it appears.
      c7c169ed
  31. 27 Mar, 2009 2 commits
    • Kristofer Pettersson's avatar
      Bug#40127 Multiple table DELETE IGNORE hangs on foreign key constraint violation · 5d4c84b7
      Kristofer Pettersson authored
                on 5.0            
      The server crashes on an assert in net_end_statement indicating that the
      Diagnostics area wasn't set properly during execution.
      This happened on a multi table DELETE operation using the IGNORE keyword.
      The keyword is suppose to allow for execution to continue on a best effort
      despite some non-fatal errors. Instead execution stopped and no client
      response was sent which would have led to a protocol error if it hadn't been
      for the assert.
      This patch corrects this issue by checking for the existence of an IGNORE
      option before setting an error state during row-by-row delete iteration.
      
      
      mysql-test/r/innodb_mysql.result:
        * Added test case for bug40127
      mysql-test/t/innodb_mysql.test:
        * Added test case for bug40127
      sql/sql_delete.cc:
        * IGNORE option wasn't implemented in multi_delete::send_data
          and multi_delete::do_deletes
      5d4c84b7
    • He Zhenxing's avatar
      BUG#37145 Killing a statement doing DDL may log binlog event with error code 1053 · 11cd6177
      He Zhenxing authored
      When the thread executing a DDL was killed after finished its
      execution but before writing the binlog event, the error code in
      the binlog event could be set wrongly to ER_SERVER_SHUTDOWN or
      ER_QUERY_INTERRUPTED.
      
      This patch fixed the problem by ignoring the kill status when
      constructing the event for DDL statements.
      
      This patch also included the following changes in order to
      provide the test case.
      
       1) modified mysqltest to support variable for connection command
      
       2) modified mysql-test-run.pl, add new variable MYSQL_SLAVE to
          run mysql client against the slave mysqld.
      11cd6177
  32. 06 Feb, 2009 1 commit
    • Mats Kindahl's avatar
      Bug #36763 · 2dc08879
      Mats Kindahl authored
      TRUNCATE TABLE fails to replicate when stmt-based binlogging is not supported.
      
      There were two separate problems with the code, both of which are fixed with
      this patch:
      
      1. An error was printed by InnoDB for TRUNCATE TABLE in statement mode when
         the in isolation levels READ COMMITTED and READ UNCOMMITTED since InnoDB
         does permit statement-based replication for DML statements. However,
         the TRUNCATE TABLE is not transactional, but is a DDL, and should therefore
         be allowed to be replicated as a statement.
      
      2. The statement was not logged in mixed mode because of the error above, but
         the error was not reported to the client.
      
      This patch fixes the problem by treating TRUNCATE TABLE a DDL, that is, it is
      always logged as a statement and not reporting an error from InnoDB for TRUNCATE
      TABLE.
      
      
      mysql-test/extra/binlog_tests/binlog_truncate.test:
        Adding new test to check that TRUNCATE TABLE is written correctly
        to the binary log.
      mysql-test/extra/rpl_tests/rpl_truncate.test:
        Removing redundant testing by eliminating settings of BINLOG_FORMAT.
      mysql-test/extra/rpl_tests/rpl_truncate_helper.test:
        Replacing slave and master reset code with include file.
        Removing settings of BINLOG_FORMAT.
        Replacing printing of table contents to compare master and slave
        with diff_tables.inc.
      mysql-test/suite/binlog/t/binlog_truncate_innodb.test:
        Adding test for testing that TRUNCATE TABLE is logged correctly for InnoDB
        in all isolation levels.
      mysql-test/suite/binlog/t/binlog_truncate_myisam.test:
        Adding test for testing that TRUNCATE TABLE is logged correctly for MyISAM.
      mysql-test/suite/binlog/t/disabled.def:
        Disabling binlog_truncate_innodb since it does not work (yet).
      sql/sql_base.cc:
        Correcting setting of capabilities flags to make the comparison with 0
        later in the code work correctly.
      sql/sql_delete.cc:
        Re-organizing code to ensure that TRUNCATE TABLE is logged in statement
        format and that row format is not used unless there are rows to log (which
        there are not when delete_all_rows() is called, so this has to be logged
        as a statement).
      2dc08879
  33. 31 Jan, 2009 1 commit
    • Michael Widenius's avatar
      Fixed compiler warnings found by gcc 4.3.2 · b8fcb0cc
      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
      b8fcb0cc
  34. 28 Jan, 2009 1 commit
    • Alfranio Correia's avatar
      BUG#35583 mysqlbinlog replay fails with ERROR 1146 when temp tables are used · c0806aba
      Alfranio Correia authored
            
      When using CREATE TEMPORARY TABLE LIKE to create a temporary table, 
      or using TRUNCATE to delete all rows of a temporary table, they 
      did not set the tmp_table_used flag, and cause the omission of
      "SET @@session.pseudo_thread_id" when dumping binlog with mysqlbinlog,
      and cause error when replay the statements.
            
      This patch fixed the problem by setting tmp_table_used in these two
      cases. (Done by He Zhenxing 2009-01-12)
      
      
      mysql-test/suite/binlog/r/binlog_tmp_table.result:
        Add test case for BUG#35583
      mysql-test/suite/binlog/t/binlog_tmp_table.test:
        Add test case for BUG#35583
      sql/sql_delete.cc:
        set thd->tmp_table_used when truncate temporary table
      sql/sql_table.cc:
        set thd->tmp_table_used when using create like to create temporary tables
      c0806aba
  35. 09 Jan, 2009 1 commit
    • Davi Arnaut's avatar
      Bug#37016: TRUNCATE TABLE removes some rows but not all · 87f368eb
      Davi Arnaut authored
      The special TRUNCATE TABLE (DDL) transaction wasn't being properly
      rolled back if a error occurred during row by row deletion. The
      error can be caused by a foreign key restriction imposed by InnoDB
      SE and would cause the server to erroneously issue a implicit
      commit.
      
      The solution is to rollback the transaction if a truncation via row
      by row deletion fails, otherwise commit. All effects of a TRUNCATE 
      ABLE operation are rolled back if a row by row deletion fails.
      
      mysql-test/include/commit.inc:
        Truncate always starts a transaction and commits at the end.
        The commit at the end increases the count by two, one is the
        storage engine commit and the other is the binary log.
      mysql-test/r/commit_1innodb.result:
        Update test case results.
      mysql-test/r/innodb_mysql.result:
        Update test case results.
      mysql-test/t/innodb_mysql.test:
        Add test case for Bug#37016
      sql/sql_delete.cc:
        Move truncation using row by row deletion to its own function.
        If row by row deletion fails, rollback the transaction.
        
        Remove the meddling with disabling and enabling of autocommit
        as TRUNCATE transaction is now explicitly ended (committed
        or rolled back).
      87f368eb
  36. 03 Nov, 2008 1 commit
    • Kristofer Pettersson's avatar
      Bug#29507 TRUNCATE shows to many rows effected · 435b96ef
      Kristofer Pettersson authored
      TRUNCATE TABLE for InnoDB tables returned a count showing an approximation
      of the number of rows affected to gain efficiency.
      Now the statement always returns 0 rows affected for clarity.
      
      sql/sql_delete.cc:
        * Set row count to 0 if auto increment was reset which can happen
        if TRUNCATE TABLE was issued.
      435b96ef
  37. 15 Jul, 2008 1 commit
    • Sergey Petrunia's avatar
      BUG#35478: sort_union() returns bad data when sort_buffer_size is hit · 04037f54
      Sergey Petrunia authored
      - In QUICK_INDEX_MERGE_SELECT::read_keys_and_merge: when we got table->sort from Unique,
        tell init_read_record() not to use rr_from_cache() because a) rowids are already sorted
        and b) it might be that the the data is used by filesort(), which will need record rowids
        (which rr_from_cache() cannot provide).
      - Fully de-initialize the table->sort read in QUICK_INDEX_MERGE_SELECT::get_next(). This fixes BUG#35477.
      (bk trigger: file as fix for BUG#35478).
      
      sql/filesort.cc:
        BUG#35478: sort_union() returns bad data when sort_buffer_size is hit
        - make find_all_keys() use quick->get_next() instead of init_read_record(r)/r.read_record() calls
        - added dbug printout
      sql/mysql_priv.h:
        BUG#35478: sort_union() returns bad data when sort_buffer_size is hit
        - Added parameter to init_read_record
      sql/opt_range.cc:
        BUG#35478: sort_union() returns bad data when sort_buffer_size is hit
        - In QUICK_INDEX_MERGE_SELECT::read_keys_and_merge: when we got table->sort from Unique,
          tell init_read_record() not to use rr_from_cache() because a) rowids are already sorted
          and b) it might be that the the data is used by filesort(), which will need record rowids
          (which rr_from_cache() cannot provide).
        - Fully de-initialize the table->sort read in QUICK_INDEX_MERGE_SELECT::get_next().
      sql/records.cc:
        BUG#35478: sort_union() returns bad data when sort_buffer_size is hit
        - Added disable_rr_cache parameter to init_read_record
        - Added comment
      sql/sql_acl.cc:
        BUG#35478: sort_union() returns bad data when sort_buffer_size is hit
        - Added parameter to init_read_record
      sql/sql_delete.cc:
        BUG#35478: sort_union() returns bad data when sort_buffer_size is hit
        - Added parameter to init_read_record
      sql/sql_help.cc:
        BUG#35478: sort_union() returns bad data when sort_buffer_size is hit
        - Added parameter to init_read_record
      sql/sql_select.cc:
        BUG#35478: sort_union() returns bad data when sort_buffer_size is hit
        - Added parameter to init_read_record
      sql/sql_table.cc:
        BUG#35478: sort_union() returns bad data when sort_buffer_size is hit
        - Added parameter to init_read_record
      sql/sql_udf.cc:
        BUG#35478: sort_union() returns bad data when sort_buffer_size is hit
        - Added parameter to init_read_record
      sql/sql_update.cc:
        BUG#35478: sort_union() returns bad data when sort_buffer_size is hit
        - Added parameter to init_read_record
      04037f54
  38. 21 Mar, 2008 1 commit
    • unknown's avatar
      Bug #26461: Intrinsic data type bool (1 byte) redefined to BOOL (4 bytes) · edd613be
      unknown authored
      The bool data type was redefined to BOOL (4 bytes on windows).
      Removed the #define and fixed some of the warnings that were uncovered
      by this.
      Note that the fix also disables 2 warnings :
      4800 : 'type' : forcing value to bool 'true' or 'false' (performance warning)
      4805: 'operation' : unsafe mix of type 'type' and type 'type' in operation
      
      These warnings will be handled in a separate bug, as they are performance related or bogus.
      
      Fixed to int the return type of functions that return more than 
      2 distinct values.
      
      
      CMakeLists.txt:
        Bug #26461: disable the C4800 and C4805 warnings temporarily
      include/config-win.h:
        Bug #26461: 
         - no need for this define for Windows.
         - windows C++ compilers have a bool type
      include/my_global.h:
        Bug #26461: removed bool_defined (no longer needed)
      sql/handler.h:
        Bug #26461: bool functions must return boolean values
      sql/mysql_priv.h:
        Bug #26461: fixed return type of functions that return more than
        2 distinct values.
      sql/procedure.h:
        Bug #26461: fixed return type of functions that return more than
        2 distinct values.
      sql/sql_acl.cc:
        Bug #26461: fixed return type of functions that return more than
        2 distinct values.
      sql/sql_acl.h:
        Bug #26461: fixed return type of functions that return more than
        2 distinct values.
      sql/sql_analyse.cc:
        Bug #26461: fixed return type of functions that return more than
        2 distinct values.
      sql/sql_analyse.h:
        Bug #26461: fixed return type of functions that return more than
        2 distinct values.
      sql/sql_base.cc:
        Bug #26461: fixed return type of functions that return more than
        2 distinct values.
      sql/sql_db.cc:
        Bug #26461: fixed return type of functions that return more than
        2 distinct values.
      sql/sql_delete.cc:
        Bug #26461: fixed return type of functions that return more than
        2 distinct values.
      sql/sql_load.cc:
        Bug #26461: fixed return type of functions that return more than
        2 distinct values.
      sql/sql_parse.cc:
        Bug #26461: fixed return type of functions that return more than
        2 distinct values.
      sql/sql_prepare.cc:
        Bug #26461: fixed return type of functions that return more than
        2 distinct values.
      sql/sql_update.cc:
        Bug #26461: fixed return type of functions that return more than
        2 distinct values.
      edd613be
  39. 18 Mar, 2008 1 commit
    • unknown's avatar
      BUG#34768 - nondeterministic INSERT using LIMIT logged in stmt mode if · 5d36e601
      unknown authored
                  binlog_format=mixed
      
      Statement-based replication of DELETE ... LIMIT, UPDATE ... LIMIT,
      INSERT ... SELECT ... LIMIT is not safe as order of rows is not
      defined.
      
      With this fix, we issue a warning that this statement is not safe to
      replicate in statement mode, or go to row-based mode in mixed mode.
      
      Note that we may consider a statement as safe if ORDER BY primary_key
      is present. However it may confuse users to see very similiar statements
      replicated differently.
      
      Note 2: regular UPDATE statement (w/o LIMIT) is unsafe as well, but
      this patch doesn't address this issue. See comment from Kristian
      posted 18 Mar 10:55.
      
      
      mysql-test/suite/binlog/r/binlog_stm_ps.result:
        Updated a test case according to fix for BUG#34768:
        INSERT ... SELECT ... LIMIT is now replicated in row mode.
      mysql-test/suite/binlog/r/binlog_unsafe.result:
        A test case for BUG#34768.
      mysql-test/suite/binlog/t/binlog_unsafe.test:
        A test case for BUG#34768.
      sql/sql_delete.cc:
        Statement-based replication of DELETE ... LIMIT is not safe as order of
        rows is not defined, so in mixed mode we go to row-based.
      sql/sql_insert.cc:
        Statement-based replication of INSERT ... SELECT ... LIMIT is not safe
        as order of rows is not defined, so in mixed mode we go to row-based.
      sql/sql_update.cc:
        Statement-based replication of UPDATE ... LIMIT is not safe as order of
        rows is not defined, so in mixed mode we go to row-based.
      5d36e601