An error occurred fetching the project authors.
  1. 05 May, 2010 1 commit
    • Alexander Barkov's avatar
      Bug#51571 load xml infile causes server crash · 3c93a784
      Alexander Barkov authored
        
        Problem:
        item->name was NULL for Item_user_var_as_out_param
        which made strcmp(something, item->name) crash in the LOAD XML code.
        
        Fix:
        - item_func.h: Adding set_name() in constuctor for Item_user_var_as_out_param
        - sql_load.cc: Changing the condition in write_execute_load_query_log_event() which
        distiguished between Item_user_var_as_out_param and Item_field
        from
          if (item->name == NULL)
        to
          if (item->type() == Item::FIELD_ITEM)
        - loadxml.result, loadxml.test: adding tests
      3c93a784
  2. 16 Apr, 2010 1 commit
    • Kristofer Pettersson's avatar
      Bug#50373 --secure-file-priv="" · 794a4413
      Kristofer Pettersson authored
      The server variable opt_secure_file_priv wasn't
      normalized properly and caused the operations
      LOAD DATA INFILE .. INTO TABLE ..
      and
      SELECT load_file(..)
      to do different interpretations of the 
      --secure-file-priv option.
      
      The patch moves code to the server initialization
      routines so that the path always is normalized
      once and only once.
      
      It was also intended that setting the option
      to an empty string should be equal to 
      lifting all previously set restrictions. This
      is also fixed by this patch.
      
      
      sql/mysqld.cc:
        * If --secure_file_option is an empty string then the option variable
          should be unset.
        * opt_secure_file_option should be normalized once when the server starts.
      sql/sql_load.cc:
        * moved variable normalization code to fix_paths()
      794a4413
  3. 31 Mar, 2010 1 commit
    • Mats Kindahl's avatar
      WL#5030: Split and remove mysql_priv.h · 23d8586d
      Mats Kindahl authored
      This patch:
      
      - Moves all definitions from the mysql_priv.h file into
        header files for the component where the variable is
        defined
      - Creates header files if the component lacks one
      - Eliminates all include directives from mysql_priv.h
      - Eliminates all circular include cycles
      - Rename time.cc to sql_time.cc
      - Rename mysql_priv.h to sql_priv.h
      23d8586d
  4. 09 Mar, 2010 1 commit
    • Alexey Botchkov's avatar
      Bug#51377 Crash in information_schema / processlist on concurrent DDL workload · e1addb05
      Alexey Botchkov authored
          the fill_schema_processlist function accesses THD::query() without proper protection
          so the parallel thread killing can lead to access to the freed meemory.
      
      per-file comments:
        sql/sql_load.cc
      Bug#51377      Crash in information_schema / processlist on concurrent DDL workload
          the THD::set_query_inner() call needs to be protected.
          But here we don't need to change the original thd->query() at all.
        sql/sql_show.cc
      Bug#51377      Crash in information_schema / processlist on concurrent DDL workload
          protect the THD::query() access with the THD::LOCK_thd_data mutex.
      e1addb05
  5. 24 Feb, 2010 1 commit
    • Jon Olav Hauglid's avatar
      Followup to Bug#45225 Locking: hang if drop table with no timeout · e60ef893
      Jon Olav Hauglid authored
      This patch prevents system threads and system table accesses from
      using user-specified values for "lock_wait_timeout". Instead all
      such accesses are done using the default value (1 year).
      
      This prevents background tasks (such as replication, events, 
      accessing stored function definitions, logging, reading time-zone
      information, etc.) from failing in cases where the global value
      of "lock_wait_timeout" is set very low.
      
      The patch also simplifies the open tables API. Rather than adding
      another convenience function for opening and locking system tables,
      this patch removes most of the existing convenience functions for
      open_and_lock_tables_derived(). Before, open_and_lock_tables() was
      a convenience function that enforced derived tables handling, while
      open_and_lock_tables_derived() was the main function where derived
      tables handling was optional. Now, this convencience function is
      gone and the main function is renamed to open_and_lock_tables(). 
      
      No test case added as it would have required the use of --sleep to
      check that system threads and system tables have a different timeout
      value from the user-specified "lock_wait_timeout" system variable.
      e60ef893
  6. 04 Feb, 2010 1 commit
    • Konstantin Osipov's avatar
      Merge next-mr -> next-4284. · 00dc9a6e
      Konstantin Osipov authored
      Cherry-pick a fix Bug#37148 from next-mr, to preserve
      file ids of the added files, and ensure that all the necessary
      changes have been pulled.
      
      Since initially Bug#37148 was null-merged into 6.0,
      the changeset that is now being cherry-picked was likewise
      null merged into next-4284.
      
      Now that Bug#37148 has been reapplied to 6.0, try to make
      it work with next-4284. This is also necessary to be able
      to pull other changes from 5.1-rep into next-4284.
      
      To resolve the merge issues use this changeset applied
      to 6.0:
      revid:jperkin@sun.com-20091216103628-ylhqf7s6yegui2t9
      revno: 3776.1.1
      committer: He Zhenxing <zhenxing.he@sun.com>
      branch nick: 6.0-codebase-bugfixing
      timestamp: Thu 2009-12-17 17:02:50 +0800
      message:
        Fix merge problem with Bug#37148
      
      
      
      00dc9a6e
  7. 24 Jan, 2010 1 commit
  8. 07 Jan, 2010 1 commit
  9. 06 Dec, 2009 1 commit
    • Luis Soares's avatar
      BUG#49479: Slave stops with syntax error: LOAD DATA event without · 59571928
      Luis Soares authored
      escaped field names
      
      When in mixed or statement mode, the master logs LOAD DATA
      queries by resorting to an Execute_load_query_log_event. This
      event does not contain the original query, but a rewritten
      version of it, which includes the table field names. However, the
      rewrite does not escape the field names. If these names match a
      reserved keyword, then the slave will stop with a syntax error
      when executing the event.
      
      We fix this by escaping the fields names as it happens already
      for the table name.
      
      mysql-test/extra/rpl_tests/rpl_loaddata.test:
        Added test case for the reported bug.
      mysql-test/r/mysqlbinlog.result:
        Changed result to support escaped field name.
      mysql-test/suite/binlog/r/binlog_killed_simulate.result:
        Changed result to support escaped field name.
      mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
        Changed result to support escaped field name.
      mysql-test/suite/binlog/r/binlog_stm_blackhole.result:
        Changed result to support escaped field name.
      mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
        Changed result to support escaped field name.
      mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result:
        Changed result to support escaped field name.
      mysql-test/suite/rpl/r/rpl_loaddata.result:
        Added result for new test. 
        Changed show slave status positions which are now different because of
        extra escape character in field names.
      mysql-test/suite/rpl/r/rpl_loaddata_fatal.result:
        Changed show slave status positions which are now different because of
        extra escape character.
      mysql-test/suite/rpl/r/rpl_loaddata_map.result:
        Changed result to support escaped field name.
      mysql-test/suite/rpl/r/rpl_stm_log.result:
        Changed result to support escaped field name.
      mysql-test/t/mysqlbinlog.test:
        Changed positions which is now different because of extra escape 
        character in field names.
      sql/sql_load.cc:
        Appended escape characters before and after field names.
      59571928
  10. 01 Dec, 2009 1 commit
    • Konstantin Osipov's avatar
      Backport of: · 5969dcda
      Konstantin Osipov authored
      ----------------------------------------------------------
      revno: 2630.4.26
      committer: Konstantin Osipov <konstantin@mysql.com>
      branch nick: mysql-6.0-prelocked_mode-to-push
      timestamp: Fri 2008-06-06 23:19:04 +0400
      message:
        WL#3726: work on review comments.
        Remove thd->locked_tables. Always store MYSQL_LOCK instances in
        thd->lock.
        Rename thd->prelocked_mode to thd->locked_tables_mode.
        Use thd->locked_tables_mode to determine if we
        are under LOCK TABLES. Update the code to not assume that
        if thd->lock is set, LOCK TABLES mode is off.
        Review comments.
      
      
      sql/ha_ndbcluster_binlog.cc:
        Don't unlock the lock under LOCK TABLES (safety).
      sql/handler.cc:
        There is no thd->locked_tables any more.
        Update comments.
      sql/lock.cc:
        There is no thd->locked_tables any more.
      sql/log.cc:
        Rename thd->prelocked_mode to thd->locked_tables_mode.
      sql/set_var.cc:
        Use thd->locked_tables_mode to determine if we are under LOCK TABLES.
      sql/sp_head.cc:
        Rename thd->prelocked_mode to thd->locked_tables_mode.
      sql/sql_base.cc:
        Use thd->locked_tables_mode to determine if we are under LOCK TABLES.
        Remove thd->locked_tables.
      sql/sql_cache.cc:
        Use thd->locked_tables_mode to determine if we are under LOCK TABLES.
      sql/sql_class.cc:
        Avoid code duplication.
        Do not release the table locks prematurely if we're under LOCK TABLES.
        Use thd->locked_tables_mode instead of thd->locked_tables.
      sql/sql_class.h:
        Remove thd->locked_tables.
        Make prelocked mode a kind of LOCK TABLES mode.
        Update comments.
      sql/sql_cursor.cc:
        Update comments.
      sql/sql_insert.cc:
        Use thd->locked_tables_mode to determine if we are under LOCK TABLES.
        Rename thd->prelocked_mode to thd->locked_tables_mode.
      sql/sql_load.cc:
        Rename thd->prelocked_mode to thd->locked_tables_mode.
      sql/sql_parse.cc:
        Use thd->locked_tables_mode to determine if we are under LOCK TABLES.
        Remove thd->locked_tables.
      sql/sql_partition.cc:
        Use thd->locked_tables_mode to determine if we are under LOCK TABLES.
      sql/sql_rename.cc:
        Use thd->locked_tables_mode to determine if we are under LOCK TABLES.
      sql/sql_select.cc:
        Use thd->locked_tables_mode to determine if we are under LOCK TABLES.
      sql/sql_table.cc:
        Use thd->locked_tables_mode to determine if we are under LOCK TABLES.
      sql/sql_trigger.cc:
        Use thd->locked_tables_mode to determine if we are under LOCK TABLES.
      sql/sql_update.cc:
        Use thd->locked_tables_mode to determine if we are under LOCK TABLES.
      sql/sql_view.cc:
        Use thd->locked_tables_mode to determine if we are under LOCK TABLES.
      storage/myisam/ha_myisam.cc:
        Use thd->locked_tables_mode to determine if we are under LOCK TABLES.
      5969dcda
  11. 28 Nov, 2009 1 commit
    • unknown's avatar
      Bug #43913 rpl_cross_version can't pass on conflicts complainig clash with --slave-load-tm · b9f9fe2e
      unknown authored
            
      The 'slave_patternload_file' is assigned to the real path of the load data file 
      when initializing the object of Relay_log_info. But the path of the load data
      file is not formatted to real path when executing event from relay log. So the 
      error will be encountered if the path of the load data file is a symbolic link.
      
      Actually the global 'opt_secure_file_priv' is not formatted to real path when 
      loading data from file. So the same thing will happen too.
      
            
      To fix these errors, the path of the load data file should be formatted to 
      real path when executing event from relay log. And the 'opt_secure_file_priv' 
      should be formatted to real path when loading data infile.
      
      
      mysql-test/suite/rpl/r/rpl_loaddata_symlink.result:
        Test result for bug#43913.
      mysql-test/suite/rpl/t/rpl_loaddata_symlink-master.sh:
        Added the test file to create a link from $MYSQLTEST_VARDIR/std_data 
        to $MYSQLTEST_VARDIR/std_data_master_link
      mysql-test/suite/rpl/t/rpl_loaddata_symlink-slave.sh:
        Added the test file to create a link from $MYSQLTEST_VARDIR/std_data 
        to $MYSQLTEST_VARDIR/std_data_slave_link
      mysql-test/suite/rpl/t/rpl_loaddata_symlink.test:
        Added the test file to verify if loading data infile will work fine 
        if the path of the load data file is a symbolic link.
      sql/rpl_rli.cc:
        Added call 'my_realpath' function for avoiding sometimes the 'fn_format' 
        function can't format real path rightly.
      b9f9fe2e
  12. 25 Nov, 2009 1 commit
    • MySQL Build Team's avatar
      Backport into build-200911241145-5.1.40sp1 · 610f0f1b
      MySQL Build Team authored
      > ------------------------------------------------------------
      > revno: 3184.7.1
      > revision-id: luis.soares@sun.com-20091027151553-ri74b2zdchw8wyg7
      > parent: joro@sun.com-20091019135504-e6fmhf4xyy0wdymb
      > committer: Luis Soares <luis.soares@sun.com>
      > branch nick: mysql-5.1-bugteam
      > timestamp: Tue 2009-10-27 15:15:53 +0000
      > message:
      >   BUG#48297: Schema name is ignored when LOAD DATA is written into 
      >   binlog, replication aborts
      >   
      >   In SBR or MBR, the schema name is not being written to the binlog
      >   when executing a LOAD DATA statement. This becomes a problem when
      >   the current database (lets call it db1) is different from the
      >   table's schema (lets call it db2). For instance, take the
      >   following statements:
      >     
      >     use db1;
      >     load data local infile 'infile.txt' into table db2.t
      >   
      >   Should this statement be logged without t's schema (db2), when
      >   replaying it, one can get db1.t populated instead of db2.t (if
      >   db1.t exists). On the other hand, if there is no db1.t at all,
      >   replication will stop.
      >   
      >   We fix this by always logging the table (in load file) with fully
      >   qualified name when its schema is different from the current
      >   database or when no default database was selected.
      610f0f1b
  13. 21 Nov, 2009 1 commit
    • He Zhenxing's avatar
      BUG#37148 Most callers of mysql_bin_log.write ignore the return result · dd383cad
      He Zhenxing authored
      This is the non-ndb part of the patch.
      
      The return value of mysql_bin_log.write was ignored by most callers,
      which may lead to inconsistent on master and slave if the transaction
      was committed while the binlog was not correctly written. If
      my_error() is call in mysql_bin_log.write, this could also lead to
      assertion issue if my_ok() or my_error() is called after.
      
      This fixed the problem by let the caller to check and handle the
      return value of mysql_bin_log.write. This patch only adresses the
      simple cases.
      
      
      mysql-test/include/binlog_inject_error.inc:
        inject binlog write error when doing a query
      mysql-test/suite/binlog/t/binlog_write_error.test:
        Simple test case to check if proper error is reported when injecting binlog write errors.
      sql/events.cc:
        check return value of mysql_bin_log.write
      sql/log.cc:
        check return value of mysql_bin_log.write
      sql/log_event.cc:
        check return value of mysql_bin_log.write
      sql/log_event_old.cc:
        check return value of mysql_bin_log.write
      sql/mysql_priv.h:
        Change write_bin_log to return int instead of void
      sql/rpl_injector.cc:
        check return value of writing binlog
      sql/sp.cc:
        check return value of writing binlog
      sql/sp_head.cc:
        return 1 if writing binlog failed
      sql/sql_acl.cc:
        check return value of writing binlog
      sql/sql_base.cc:
        check return value of writing binlog
      sql/sql_class.h:
        Change binlog_show_create_table to return int
      sql/sql_db.cc:
        Change write_to_binlog to return int
        check return value of writing binlog
      sql/sql_delete.cc:
        check return value of writing binlog
      sql/sql_insert.cc:
        check return value of writing binlog
      sql/sql_load.cc:
        check return value of writing binlog
      sql/sql_parse.cc:
        check return value of writing binlog
      sql/sql_partition.cc:
        check return value of writing binlog
      sql/sql_rename.cc:
        check return value of writing binlog
      sql/sql_repl.cc:
        check return value of writing binlog
      sql/sql_table.cc:
        Change write_bin_log to return int, and return 1 if there was error writing binlog
      sql/sql_tablespace.cc:
        check return value of writing binlog
      sql/sql_trigger.cc:
        check return value of writing binlog
      sql/sql_udf.cc:
        check return value of writing binlog
      sql/sql_update.cc:
        check return value of writing binlog
      sql/sql_view.cc:
        check return value of writing binlog
      dd383cad
  14. 04 Nov, 2009 1 commit
    • Luis Soares's avatar
      BUG#48048: Deprecated constructs need removal in Betony · fb175a1b
      Luis Soares authored
      NOTE: Backport of:
      
      bzr log -r revid:sp1r-serg@sergbook.mysql.com-20070505200319-38337
      ------------------------------------------------------------
      revno: 2469.263.4
      committer: serg@sergbook.mysql.com
      timestamp: Sat 2007-05-05 13:03:19 -0700
      message:
        Removing deprecated features:
        --master-XXX command-line options
        log_bin_trust_routine_creators
        table_type
        BACKUP TABLE ...
        RESTORE TABLE ...
        SHOW PLUGIN
        LOAD TABLE ... FROM MASTER
        LOAD DATA FROM MASTER
        SHOW INNODB STATUS
        SHOW MUTEX STATUS
        SHOW TABLE TYPES
        ... TIMESTAMP(N)
        ... TYPE=engine
        
        RESET SLAVE don't reset connection parameters anymore
        LOAD DATA: check opt_secure_file_priv before access(filename)
        improved WARN_DEPRECATED macro
      
      fb175a1b
  15. 03 Nov, 2009 1 commit
    • Alfranio Correia's avatar
      WL#2687 WL#5072 BUG#40278 BUG#47175 · 19c380aa
      Alfranio Correia authored
      Non-transactional updates that take place inside a transaction present problems
      for logging because they are visible to other clients before the transaction
      is committed, and they are not rolled back even if the transaction is rolled
      back. It is not always possible to log correctly in statement format when both
      transactional and non-transactional tables are used in the same transaction.
      
      In the current patch, we ensure that such scenario is completely safe under the
      ROW and MIXED modes.
      19c380aa
  16. 27 Oct, 2009 1 commit
    • Luis Soares's avatar
      BUG#48297: Schema name is ignored when LOAD DATA is written into · a3829176
      Luis Soares authored
      binlog, replication aborts
      
      In SBR or MBR, the schema name is not being written to the binlog
      when executing a LOAD DATA statement. This becomes a problem when
      the current database (lets call it db1) is different from the
      table's schema (lets call it db2). For instance, take the
      following statements:
        
        use db1;
        load data local infile 'infile.txt' into table db2.t
      
      Should this statement be logged without t's schema (db2), when
      replaying it, one can get db1.t populated instead of db2.t (if
      db1.t exists). On the other hand, if there is no db1.t at all,
      replication will stop.
      
      We fix this by always logging the table (in load file) with fully
      qualified name when its schema is different from the current
      database or when no default database was selected.
      a3829176
  17. 16 Oct, 2009 1 commit
    • Georgi Kodinov's avatar
      Bug #40877: multi statement execution fails in 5.1.30 · 7b4ef910
      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.
      7b4ef910
  18. 12 Oct, 2009 1 commit
  19. 28 Sep, 2009 1 commit
    • Tatiana A. Nurnberg's avatar
      Bug#43746: YACC return wrong query string when parse 'load data infile' sql statement · 4102363f
      Tatiana A. Nurnberg authored
      "load data" statements were written to the binlog as a mix of the original statement
      and bits recreated from parse-info. This relied on implementation details and broke
      with IGNORE_SPACES and versioned comments.
      
      We now completely resynthesize the query for LOAD DATA for binlog (which among other
      things normalizes them somewhat with regard to case, spaces, etc.).
      We have already parsed the query properly, so we make use of that rather
      than mix-and-match string literals and parsed items.
      This should make us safe with regard to versioned comments, even those
      spanning multiple tokens. Also no longer affected by IGNORE_SPACES.
      
      mysql-test/r/mysqlbinlog.result:
        LOAD DATA INFILE normalized
      mysql-test/suite/binlog/r/binlog_killed_simulate.result:
        LOAD DATA INFILE normalized
      mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
        LOAD DATA INFILE normalized
      mysql-test/suite/binlog/r/binlog_stm_blackhole.result:
        LOAD DATA INFILE normalized
      mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
        LOAD DATA INFILE normalized
      mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result:
        LOAD DATA INFILE normalized
      mysql-test/suite/rpl/r/rpl_loaddata.result:
        LOAD DATA INFILE normalized
      mysql-test/suite/rpl/r/rpl_loaddata_fatal.result:
        LOAD DATA INFILE normalized; offsets adjusted to reflect that
      mysql-test/suite/rpl/r/rpl_loaddata_map.result:
        LOAD DATA INFILE normalized
      mysql-test/suite/rpl/r/rpl_loaddatalocal.result:
        test for #43746 - trying to break LOAD DATA part of parser
      mysql-test/suite/rpl/r/rpl_stm_log.result:
        LOAD DATA INFILE normalized
      mysql-test/suite/rpl/t/rpl_loaddatalocal.test:
        try to break the LOAD DATA part of the parser (test for #43746)
      mysql-test/t/mysqlbinlog.test:
        LOAD DATA INFILE normalized; adjust offsets to reflect that
      sql/log_event.cc:
        clean up Load_log_event::print_query and friends so they don't print
        excess spaces. add support for printing charset names to print_query.
      sql/log_event.h:
        We already have three places where we synthesize LOAD DATA queries.
        Better use one of those!
      sql/sql_lex.h:
        When binlogging LOAD DATA statements, we make up the statement to
        be logged (from the parse-info, rather than substrings of the
        original query) now. Consequently, we no longer need (string-)
        pointers into the original query.
      sql/sql_load.cc:
        Completely rewrote write_execute_load_query_log_event() to synthesize the
        LOAD DATA statement wholesale, rather than piece it together from
        synthesized bits and literal excerpts from the original query. This
        will not only give us a nice, normalized statement (all uppercase,
        no excess spaces, etc.), it will also handle comments, including
        versioned comments right, which is certainly more than we can say
        about the previous incarnation.
      sql/sql_yacc.yy:
        We're no longer assembling LOAD DATA statements from bodyparts of the
        original query, so some bookkeeping in the parser can go.
      4102363f
  20. 10 Sep, 2009 1 commit
    • Marc Alff's avatar
      WL#2110 (SIGNAL) · 63e56390
      Marc Alff authored
      WL#2265 (RESIGNAL)
      
      Manual merge of SIGNAL and RESIGNAL to mysql-trunk-signal,
      plus required dependencies.
      63e56390
  21. 31 Jul, 2009 1 commit
    • Gleb Shchepa's avatar
      Bug# 30946: mysqldump silently ignores --default-character-set · 4e95179a
      Gleb Shchepa authored
                  when used with --tab
      
      1) New syntax: added CHARACTER SET clause to the
        SELECT ... INTO OUTFILE (to complement the same clause in
        LOAD DATA INFILE).
        mysqldump is updated to use this in --tab mode.
      
      2) ESCAPED BY/ENCLOSED BY field parameters are documented as
         accepting CHAR argument, however SELECT .. INTO OUTFILE
         silently ignored rests of multisymbol arguments.
         For the symmetrical behavior with LOAD DATA INFILE the
         server has been modified to fail with the same error:
      
           ERROR 42000: Field separator argument is not what is
                        expected; check the manual
      
      3) Current LOAD DATA INFILE recognizes field/line separators
         "as is" without converting from client charset to data
         file charset. So, it is supposed, that input file of
         LOAD DATA INFILE consists of data in one charset and
         separators in other charset. For the compatibility with
         that [buggy] behaviour SELECT INTO OUTFILE implementation
         has been saved "as is" too, but the new warning message
         has been added:
      
           Non-ASCII separator arguments are not fully supported
      
         This message warns on field/line separators that contain
         non-ASCII symbols.
      
      
      client/mysqldump.c:
        mysqldump has been updated to call SELECT ... INTO OUTFILE
        statement with a charset from the --default-charset command
        line parameter.
      mysql-test/r/mysqldump.result:
        Added test case for bug #30946.
      mysql-test/r/outfile_loaddata.result:
        Added test case for bug #30946.
      mysql-test/t/mysqldump.test:
        Added test case for bug #30946.
      mysql-test/t/outfile_loaddata.test:
        Added test case for bug #30946.
      sql/field.cc:
        String conversion code has been moved from check_string_copy_error()
        to convert_to_printable() for reuse.
      sql/share/errmsg.txt:
        New WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED message has been added.
      sql/sql_class.cc:
        The select_export::prepare() method has been modified to:
        
          1) raise the ER_WRONG_FIELD_TERMINATORS error on multisymbol
             ENCLOSED BY/ESCAPED BY field arguments like LOAD DATA INFILE;
        
          2) warn with a new WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED
             message on non-ASCII field or line separators.
        
        The select_export::send_data() merhod has been modified to
        convert item data to output charset (see new SELECT INTO OUTFILE
        syntax). By default the BINARY charset is used for backward
        compatibility.
      sql/sql_class.h:
        The select_export::write_cs field added to keep output
        charset.
      sql/sql_load.cc:
        mysql_load has been modified to warn on non-ASCII field or
        line separators with a new WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED
        message.
      sql/sql_string.cc:
        New global function has been added: convert_to_printable()
        (common code has been moved from check_string_copy_error()).
      sql/sql_string.h:
        New String::is_ascii() method and new global convert_to_printable()
        function have been added.
      sql/sql_yacc.yy:
        New syntax: added CHARACTER SET clause to the
        SELECT ... INTO OUTFILE (to complement the same clause in
        LOAD DATA INFILE). By default the BINARY charset is used for
        backward compatibility.
      4e95179a
  22. 14 Jul, 2009 1 commit
    • Sven Sandberg's avatar
      BUG#39934: Slave stops for engine that only support row-based logging · 41783de5
      Sven Sandberg authored
      General overview:
      The logic for switching to row format when binlog_format=MIXED had
      numerous flaws. The underlying problem was the lack of a consistent
      architecture.
      General purpose of this changeset:
      This changeset introduces an architecture for switching to row format
      when binlog_format=MIXED. It enforces the architecture where it has
      to. It leaves some bugs to be fixed later. It adds extensive tests to
      verify that unsafe statements work as expected and that appropriate
      errors are produced by problems with the selection of binlog format.
      It was not practical to split this into smaller pieces of work.
      
      Problem 1:
      To determine the logging mode, the code has to take several parameters
      into account (namely: (1) the value of binlog_format; (2) the
      capabilities of the engines; (3) the type of the current statement:
      normal, unsafe, or row injection). These parameters may conflict in
      several ways, namely:
       - binlog_format=STATEMENT for a row injection
       - binlog_format=STATEMENT for an unsafe statement
       - binlog_format=STATEMENT for an engine only supporting row logging
       - binlog_format=ROW for an engine only supporting statement logging
       - statement is unsafe and engine does not support row logging
       - row injection in a table that does not support statement logging
       - statement modifies one table that does not support row logging and
         one that does not support statement logging
      Several of these conflicts were not detected, or were detected with
      an inappropriate error message. The problem of BUG#39934 was that no
      appropriate error message was written for the case when an engine
      only supporting row logging executed a row injection with
      binlog_format=ROW. However, all above cases must be handled.
      Fix 1:
      Introduce new error codes (sql/share/errmsg.txt). Ensure that all
      conditions are detected and handled in decide_logging_format()
      
      Problem 2:
      The binlog format shall be determined once per statement, in
      decide_logging_format(). It shall not be changed before or after that.
      Before decide_logging_format() is called, all information necessary to
      determine the logging format must be available. This principle ensures
      that all unsafe statements are handled in a consistent way.
      However, this principle is not followed:
      thd->set_current_stmt_binlog_row_based_if_mixed() is called in several
      places, including from code executing UPDATE..LIMIT,
      INSERT..SELECT..LIMIT, DELETE..LIMIT, INSERT DELAYED, and
      SET @@binlog_format. After Problem 1 was fixed, that caused
      inconsistencies where these unsafe statements would not print the
      appropriate warnings or errors for some of the conflicts.
      Fix 2:
      Remove calls to THD::set_current_stmt_binlog_row_based_if_mixed() from
      code executed after decide_logging_format(). Compensate by calling the
      set_current_stmt_unsafe() at parse time. This way, all unsafe statements
      are detected by decide_logging_format().
      
      Problem 3:
      INSERT DELAYED is not unsafe: it is logged in statement format even if
      binlog_format=MIXED, and no warning is printed even if
      binlog_format=STATEMENT. This is BUG#45825.
      Fix 3:
      Made INSERT DELAYED set itself to unsafe at parse time. This allows
      decide_logging_format() to detect that a warning should be printed or
      the binlog_format changed.
      
      Problem 4:
      LIMIT clause were not marked as unsafe when executed inside stored
      functions/triggers/views/prepared statements. This is
      BUG#45785.
      Fix 4:
      Make statements containing the LIMIT clause marked as unsafe at
      parse time, instead of at execution time. This allows propagating
      unsafe-ness to the view.
      
      
      mysql-test/extra/rpl_tests/create_recursive_construct.inc:
        Added auxiliary file used by binlog_unsafe.test to create and
        execute recursive constructs
        (functions/procedures/triggers/views/prepared statements).
      mysql-test/extra/rpl_tests/rpl_foreign_key.test:
        removed unnecessary set @@session.binlog_format
      mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
        Filter out table id from table map events in binlog listing.
        Got rid of $binlog_format_statement.
      mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test:
        disable warnings around call to unsafe procedure
      mysql-test/include/rpl_udf.inc:
        Disabled warnings for code that generates warnings
        for some binlog formats. That would otherwise cause
        inconsistencies in the result file.
      mysql-test/r/mysqldump.result:
        Views are now unsafe if they contain a LIMIT clause.
        That fixed BUG#45831. Due to BUG#45832, a warning is
        printed for the CREATE VIEW statement.
      mysql-test/r/sp_trans.result:
        Unsafe statements in stored procedures did not give a warning if
        binlog_format=statement. This is BUG#45824. Now they do, so this
        result file gets a new warning.
      mysql-test/suite/binlog/r/binlog_multi_engine.result:
        Error message changed.
      mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result:
        INSERT DELAYED didn't generate a warning when binlog_format=STATEMENT.
        That was BUG#45825. Now there is a warning, so result file needs to be
        updated.
      mysql-test/suite/binlog/r/binlog_stm_ps.result:
        Changed error message.
      mysql-test/suite/binlog/r/binlog_unsafe.result:
        updated result file:
         - error message changed
         - added test for most combinations of unsafe constructs invoked
           from recursive constructs
         - INSERT DELAYED now gives a warning (because BUG#45826 is fixed)
         - INSERT..SELECT..LIMIT now gives a warning from inside recursive
           constructs (because BUG#45785 was fixed)
         - When a recursive construct (e.g., stored proc or function)
           contains more than one statement, at least one of which is
           unsafe, then all statements in the recursive construct give
           warnings. This is a new bug introduced by this changeset.
           It will be addressed in a post-push fix.
      mysql-test/suite/binlog/t/binlog_innodb.test:
        Changed error code for innodb updates with READ COMMITTED or 
        READ UNCOMMITTED transaction isolation level and
        binlog_format=statement.
      mysql-test/suite/binlog/t/binlog_multi_engine.test:
        The error code has changed for statements where more than one
        engine is involved and one of them is self-logging.
      mysql-test/suite/binlog/t/binlog_unsafe-master.opt:
        Since binlog_unsafe now tests unsafe-ness of UDF's, we need an extra
        flag in the .opt file.
      mysql-test/suite/binlog/t/binlog_unsafe.test:
         - Clarified comment.
         - Rewrote first part of test. Now it tests not only unsafe variables
           and functions, but also unsafe-ness due to INSERT..SELECT..LIMIT,
           INSERT DELAYED, insert into two autoinc columns, use of UDF's, and
           access to log tables in the mysql database.
           Also, in addition to functions, procedures, triggers, and prepared
           statements, it now also tests views; and it constructs recursive
           calls in two levels by combining these recursive constructs.
           Part of the logic is in extra/rpl_tests/create_recursive_construct.inc.
         - added tests for all special system variables that should not be unsafe.
         - added specific tests for BUG#45785 and BUG#45825
      mysql-test/suite/rpl/r/rpl_events.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_idempotency.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_mix_found_rows.result:
        Split rpl_found_rows.test into rpl_mix_found_rows.test (a new file) and
        rpl_stm_found_rows.test (renamed rpl_found_rows.test). This file equals
        the second half of the old rpl_found_rows.result, with the following
        modifications:
         - minor formatting changes
         - additional initialization
      mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result:
        Moved out code operating in mixed mode from rpl_stm_insert_delayed
        (into rpl_mix_insert_delayed) and got rid of explicit setting of
        binlog format.
      mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_row_idempotency.result:
        Moved the second half of rpl_idempotency.test, which only
        executed in row mode, to rpl_row_idempotency.test. This is
        the new result file.
      mysql-test/suite/rpl/r/rpl_row_insert_delayed.result:
        Got rid of unnecessary explicit setting of binlog format.
      mysql-test/suite/rpl/r/rpl_stm_found_rows.result:
        Split rpl_found_rows.test into rpl_mix_found_rows.test (a new file) and
        rpl_stm_found_rows.test (renamed rpl_found_rows.test). Changes in
        this file:
         - minor formatting changes
         - warning is now issued for unsafe statements inside procedures
           (since BUG#45824 is fixed)
         - second half of file is moved to rpl_mix_found_rows.result
      mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result:
        Moved out code operating in mixed mode from rpl_stm_insert_delayed
        (into rpl_mix_insert_delayed) and got rid of explicit setting of
        binlog format.
      mysql-test/suite/rpl/r/rpl_stm_loadfile.result:
        error message changed
      mysql-test/suite/rpl/r/rpl_temporary_errors.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_udf.result:
        Remove explicit set of binlog format (and triplicate test execution)
        and rely on test system executing the test in all binlog formats.
      mysql-test/suite/rpl/t/rpl_bug31076.test:
        Test is only valid in mixed or row mode since it generates row events.
      mysql-test/suite/rpl/t/rpl_events.test:
        Removed explicit set of binlog_format and removed duplicate testing.
        Instead, we rely on the test system to try all binlog formats.
      mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test:
        Removed triplicate testing and instead relying on test system.
        Test is only relevant for row format since statement-based replication
        cannot handle extra columns on master.
      mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test:
        Removed triplicate testing and instead relying on test system.
        Test is only relevant for row format since statement-based replication
        cannot handle extra columns on master.
      mysql-test/suite/rpl/t/rpl_idempotency-slave.opt:
        Removed .opt file to avoid server restarts.
      mysql-test/suite/rpl/t/rpl_idempotency.test:
        - Moved out row-only tests to a new test file, rpl_row_idempotency.test.
          rpl_idempotency now only contains tests that execute in all
          binlog_formats.
        - While I was here, also removed .opt file to avoid server restarts.
          The slave_exec_mode is now set inside the test instead.
      mysql-test/suite/rpl/t/rpl_mix_found_rows.test:
        Split rpl_found_rows.test into rpl_mix_found_rows.test (a new file) and
        rpl_stm_found_rows.test (renamed rpl_found_rows.test). This file
        contains the second half of the original rpl_found_rows.test with the
        follwing changes:
         - initialization
         - removed SET_BINLOG_FORMAT and added have_binlog_format_mixed.inc
         - minor formatting changes
      mysql-test/suite/rpl/t/rpl_mix_insert_delayed.test:
        Moved out code operating in mixed mode from rpl_stm_insert_delayed
        (into rpl_mix_insert_delayed) and got rid of explicit setting of
        binlog format.
      mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test:
        Test cannot execute in statement mode, since we no longer
        switch to row format when binlog_format=statement.
        Enforced mixed mode throughout the test.
      mysql-test/suite/rpl/t/rpl_row_idempotency.test:
        Moved the second half of rpl_idempotency.test, which only
        executed in row mode, to this new file. We now rely on the
        test system to set binlog format.
      mysql-test/suite/rpl/t/rpl_row_insert_delayed.test:
         - Got rid of unnecessary explicit setting of binlog format.
         - extra/rpl_tests/rpl_insert_delayed.test does not need the
           $binlog_format_statement variable any more, so that was
           removed.
      mysql-test/suite/rpl/t/rpl_slave_skip.test:
        The test switches binlog_format internally and master generates both
        row and statement events. Hence, the slave must be able to log in both
        statement and row format. Hence test was changed to only execute in
        mixed mode.
      mysql-test/suite/rpl/t/rpl_stm_found_rows.test:
        Split rpl_found_rows.test into rpl_mix_found_rows.test (a new file) and
        rpl_stm_found_rows.test (renamed rpl_found_rows.test). Changes in
        this file:
         - minor formatting changes
         - added have_binlog_format_statement and removed SET BINLOG_FORMAT.
         - second half of file is moved to rpl_mix_found_rows.test
         - added cleanup code
      mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test:
        Moved out code operating in mixed mode from rpl_stm_insert_delayed
        (into rpl_mix_insert_delayed) and got rid of explicit setting of
        binlog format.
      mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test:
        The test switches binlog_format internally and master generates both
        row and statement events. Hence, the slave must be able to log in both
        statement and row format. Hence test was changed to only execute in
        mixed mode on slave.
      mysql-test/suite/rpl/t/rpl_temporary_errors.test:
        Removed explicit set of binlog format. Instead, the test now only
        executes in row mode.
      mysql-test/suite/rpl/t/rpl_udf.test:
        Remove explicit set of binlog format (and triplicate test execution)
        and rely on test system executing the test in all binlog formats.
      mysql-test/suite/rpl_ndb/combinations:
        Added combinations file for rpl_ndb.
      mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result:
        new result file
      mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result:
        updated result file
      mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-master.opt:
        new option file
      mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-slave.opt:
        new option file
      mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test:
        New test case to verify all errors and warnings generated by
        decide_logging_format.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
        While I was here, also made the test clean up after itself.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/t/partition_innodb_stmt.test:
        Changed error code for innodb updates with READ COMMITTED or 
        READ UNCOMMITTED transaction isolation level and
        binlog_format=statement.
      sql/event_db_repository.cc:
        Use member function to read current_stmt_binlog_row_based.
      sql/events.cc:
        Use member function to read current_stmt_binlog_row_based.
      sql/ha_ndbcluster_binlog.cc:
        reset_current_stmt_binlog_row_based() is not a no-op for the ndb_binlog
        thread any more. Instead, the ndb_binlog thread now forces row mode both
        initially and just after calling mysql_parse.  (mysql_parse() is the only
        place where reset_current_stmt_binlog_row_based() may be called from
        the ndb_binlog thread, so these are the only two places that need to
        change.)
      sql/ha_partition.cc:
        Use member function to read current_stmt_binlog_row_based.
      sql/handler.cc:
        Use member function to read current_stmt_binlog_row_based.
      sql/item_create.cc:
        Added DBUG_ENTER to some functions, to be able to trace when
        set_stmt_unsafe is called.
      sql/log.cc:
        Use member function to read current_stmt_binlog_row_based.
      sql/log_event.cc:
         - Moved logic for changing to row format out of do_apply_event (and into
           decide_logging_format).
         - Added @todo comment for post-push cleanup.
      sql/log_event_old.cc:
        Move logic for changing to row format out of do_apply_event (and into
        decide_logging_format).
      sql/mysql_priv.h:
        Make decide_logging_format() a member of the THD class, for two reasons:
         - It is natural from an object-oriented perspective.
         - decide_logging_format() needs to access private members of THD
           (specifically, the new binlog_warning_flags field).
      sql/rpl_injector.cc:
        Removed call to set_current_stmt_binlog_row_based().
        From now on, only decide_logging_fromat is allowed to modify
        current_stmt_binlog_row_based. This call is from the ndb_binlog
        thread, mostly executing code in ha_ndbcluster_binlog.cc.
        This call can be safely removed, because:
         - current_stmt_binlog_row_based is initialized for the ndb_binlog
           thread's THD object when the THD object is created. So we're
           not going to read uninitialized memory.
         - The behavior of ndb_binlog thread does not use the state of the
           current_stmt_binlog_row_based. It is conceivable that the
           ndb_binlog thread would rely on the current_stmt_binlog_format
           in two situations:
            (1) when it calls mysql_parse;
            (2) when it calls THD::binlog_query.
           In case (1), it always clears THD::options&OPTION_BIN_LOG (because
           run_query() in ha_ndbcluster_binlog.cc is only called with
           disable_binlogging = TRUE).
           In case (2), it always uses qtype=STMT_QUERY_TYPE.
      sql/set_var.cc:
        Added @todo comment for post-push cleanup.
      sql/share/errmsg.txt:
        Added new error messages and clarified ER_BINLOG_UNSAFE_STATEMENT.
      sql/sp.cc:
        Added DBUG_ENTER, to be able to trace when set_stmt_unsafe is called.
        Got rid of MYSQL_QUERY_TYPE: it was equivalent to STMT_QUERY_TYPE.
      sql/sp_head.cc:
        Use member function to read current_stmt_binlog_row_based.
      sql/sp_head.h:
        Added DBUG_ENTER, to be able to trace when set_stmt_unsafe is called.
      sql/sql_acl.cc:
        Got rid of MYSQL_QUERY_TYPE: it was equivalent to STMT_QUERY_TYPE.
      sql/sql_base.cc:
         - Made decide_logging_format take care of all logic for deciding the
           logging format, and for determining the related warnings and errors.
           See comment above decide_logging_format for details.
         - Made decide_logging_format a member function of THD, since it needs
           to access private members of THD and since its purpose is to update
           the state of a THD object.
         - Added DBUG_ENTER, to be able to trace when set_stmt_unsafe is called.
      sql/sql_class.cc:
        - Moved logic for determining unsafe warnings away from THD::binlog_query
          (and into decide_logging_format()). Now, it works like this:
          1. decide_logging_format detects that the current statement shall
             produce a warning, if it ever makes it to the binlog
          2. decide_logging_format sets a flag of THD::binlog_warning_flags.
          3. THD::binlog_query reads the flag. If the flag is set, it generates
             a warning.
        - Use member function to read current_stmt_binlog_row_based.
      sql/sql_class.h:
        - Added THD::binlog_warning_flags (see sql_class.cc for explanation).
        - Made decide_logging_format() and reset_for_next_command() member
          functions of THD (instead of standalone functions). This was needed
          for two reasons: (1) the functions need to access the private member
          THD::binlog_warning_flags; (2) the purpose of these functions is to
          update the staet of a THD object, so from an object-oriented point
          of view they should be member functions.
        - Encapsulated current_stmt_binlog_row_based, so it is now private and
          can only be accessed from a member function. Also changed the
          data type to an enumeration instead of a bool.
        - Removed MYSQL_QUERY_TYPE, because it was equivalent to
          STMT_QUERY_TYPE anyways.
        - When reset_current_stmt_binlog_row_based was called from the
          ndb_binlog thread, it would behave as a no-op. This special
          case has been removed, and the behavior of
          reset_current_stmt_binlog_row_based does not depend on which thread
          calls it any more. The special case did not serve any purpose,
          since the ndb binlog thread did not take the
          current_stmt_binlog_row_based flag into account anyways.
      sql/sql_delete.cc:
        - Moved logic for setting row format for DELETE..LIMIT away from
          mysql_prepare_delete.
          (Instead, we mark the statement as unsafe at parse time (sql_yacc.yy)
          and rely on decide_logging_format() (sql_class.cc) to set row format.)
          This is part of the fix for BUG#45831.
        - Use member function to read current_stmt_binlog_row_based.
      sql/sql_insert.cc:
         - Removed unnecessary calls to thd->lex->set_stmt_unsafe() and
           thd->set_current_stmt_binlog_row_based_if_mixed() from
           handle_delayed_insert(). The calls are unnecessary because they
           have already been made; they were made in the constructor of
           the `di' object.
         - Since decide_logging_format() is now a member function of THD, code
           that calls decide_logging_format() had to be updated.
         - Added DBUG_ENTER call, to be able to trace when set_stmt_unsafe is
           called.
         - Moved call to set_stmt_unsafe() for INSERT..SELECT..LIMIT away from
           mysql_insert_select_prepare() (and into decide_logging_format).
           This is part of the fix for BUG#45831.
         - Use member function to read current_stmt_binlog_row_based.
      sql/sql_lex.h:
         - Added the flag BINLOG_STMT_FLAG_ROW_INJECTION to enum_binlog_stmt_flag.
           This was necessary so that a statement can identify itself as a row
           injection.
         - Added appropriate setter and getter functions for the new flag.
         - Added or clarified some comments.
         - Added DBUG_ENTER()
      sql/sql_load.cc:
        Use member function to read current_stmt_binlog_row_based.
      sql/sql_parse.cc:
         - Made mysql_reset_thd_for_next_command() clear thd->binlog_warning_flags.
         - Since thd->binlog_warning_flags is private, it must be set in a
           member function of THD. Hence, moved the body of
           mysql_reset_thd_for_next_command() to the new member function
           THD::reset_thd_for_next_command(), and made
           mysql_reset_thd_for_next_command() call
           THD::reset_thd_for_next_command().
         - Removed confusing comment.
         - Use member function to read current_stmt_binlog_row_based.
      sql/sql_repl.cc:
        Use member function to read current_stmt_binlog_row_based.
      sql/sql_table.cc:
        Use member function to read current_stmt_binlog_row_based.
      sql/sql_udf.cc:
        Use member function to read current_stmt_binlog_row_based.
      sql/sql_update.cc:
        Moved logic for setting row format for UPDATE..LIMIT away from
        mysql_prepare_update.
        (Instead, we mark the statement as unsafe at parse time (sql_yacc.yy)
        and rely on decide_logging_format() (sql_class.cc) to set row format.)
        This is part of the fix for BUG#45831.
      sql/sql_yacc.yy:
        Made INSERT DELAYED, INSERT..SELECT..LIMIT, UPDATE..LIMIT, and
        DELETE..LIMIT mark themselves as unsafe at parse time (instead
        of at execution time).
        This is part of the fixes BUG#45831 and BUG#45825.
      storage/example/ha_example.cc:
        Made exampledb accept inserts. This was needed by the new test case
        rpl_ndb_binlog_format_errors, because it needs an engine that
        is statement-only (and accepts inserts).
      storage/example/ha_example.h:
        Made exampledb a statement-only engine instead of a row-only engine.
        No existing test relied exampledb's row-only capabilities. The new
        test case rpl_ndb_binlog_format_errors needs an engine that is
        statement-only.
      storage/innobase/handler/ha_innodb.cc:
        - Changed error error code and message given by innodb when 
          binlog_format=STATEMENT and transaction isolation level is
          READ COMMITTED or READ UNCOMMITTED.
        - While I was here, also simplified the condition for
          checking when to give the error.
      41783de5
  23. 17 Jun, 2009 1 commit
    • Staale Smedseng's avatar
      Bug #43414 Parenthesis (and other) warnings compiling MySQL · 3b0e6e41
      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.
      3b0e6e41
  24. 10 Jun, 2009 1 commit
    • Staale Smedseng's avatar
      Bug #43414 Parenthesis (and other) warnings compiling MySQL · a1035097
      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.
      a1035097
  25. 30 May, 2009 1 commit
    • He Zhenxing's avatar
      BUG#41948 Query_log_event constructor needlessly contorted · abf5f8da
      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
      abf5f8da
  26. 21 Feb, 2009 1 commit
    • Alfranio Correia's avatar
      BUG#38174 secure-file-priv breaks LOAD DATA INFILE replication in statement mode · d822ab89
      Alfranio Correia authored
                        
      If secure-file-priv was set on slave, it became unable to execute
      LOAD DATA INFILE statements sent from master using mixed or
      statement-based replication.
                        
      This patch fixes the issue by ignoring this security restriction
      and checking if the files are created and read by the slave in the
      --slave-load-tmpdir while executing the SQL Thread.
      d822ab89
  27. 10 Feb, 2009 1 commit
  28. 17 Sep, 2008 1 commit
    • Tatiana A. Nurnberg's avatar
      Bug#37114: sql_mode NO_BACKSLASH_ESCAPES does not work properly with LOAD DATA INFILE · 2f082d9d
      Tatiana A. Nurnberg authored
      NO_BACKSLASH_ESCAPES was not heeded in LOAD DATA INFILE
      and SELECT INTO OUTFILE.  It is now.
      
      mysql-test/r/loaddata.result:
        Show that SQL-mode NO_BACKSLASH_ESCAPES is heeded in
        INFILE/OUTFILE, and that dump/restore cycles work!
      mysql-test/t/loaddata.test:
        Show that SQL-mode NO_BACKSLASH_ESCAPES is heeded in
        INFILE/OUTFILE, and that dump/restore cycles work!
      sql/sql_class.cc:
        Add function to enquire whether ESCAPED BY was given.
        When doing SELECT...OUTFILE, use ESCAPED BY if specifically
        given; otherwise use sensible default value depending on
        SQL-mode features NO_BACKSLASH_ESCAPES.
      sql/sql_class.h:
        Add function to enquire whether ESCAPED BY was given.
      sql/sql_load.cc:
        When doing LOAD DATA INFILE, use ESCAPED BY if specifically
        given; otherwise use sensible default value depending on
        SQL-mode features NO_BACKSLASH_ESCAPES.
      2f082d9d
  29. 28 Mar, 2008 1 commit
    • unknown's avatar
      Fix for Bug#35469: server crash with LOAD DATA INFILE to a VIEW. · 4ec65151
      unknown authored
      The problem was that LOAD DATA code (sql_load.cc) didn't take into
      account that there may be items, representing references to other
      columns. This is a usual case in views. The crash happened because
      Item_direct_view_ref was casted to Item_user_var_as_out_param,
      which is not a base class.
      
      The fix is to
        1) Handle references properly;
        2) Ensure that an item is treated as a user variable only when
           it is a user variable indeed;
        3) Report an error if LOAD DATA is used to load data into
           non-updatable column.
      
      
      mysql-test/r/loaddata.result:
        Update result file.
      mysql-test/t/loaddata.test:
        Add a test case form Bug#35469: server crash with
        LOAD DATA INFILE to a VIEW.
      sql/share/errmsg.txt:
        Introduce a new error.
      sql/sql_load.cc:
        Handle reference-items properly.
      mysql-test/std_data/bug35649.data:
        Add a data file for the test case.
      4ec65151
  30. 21 Mar, 2008 1 commit
    • unknown's avatar
      Bug #26461: Intrinsic data type bool (1 byte) redefined to BOOL (4 bytes) · cebb6727
      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.
      cebb6727
  31. 19 Feb, 2008 2 commits
    • unknown's avatar
      Rename send_ok to my_ok. Similarly to my_error, it only records the status, · 14021c96
      unknown authored
      does not send it to the client.
      
      
      14021c96
    • unknown's avatar
      A fix and a test case for Bug#12713 "Error in a stored function called from · 526798db
      unknown authored
      a SELECT doesn't cause ROLLBACK of statem".
      
      The idea of the fix is to ensure that we always commit the current
      statement at the end of dispatch_command(). In order to not issue
      redundant disc syncs, an optimization of the two-phase commit
      protocol is implemented to bypass the two phase commit if
      the transaction is read-only.
      
      
      mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
        Update test results.
      mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
        Update test results.
      mysql-test/suite/rpl_ndb/t/disabled.def:
        Disable the tests, for which this changeset reveals a bug:
        the injector thread does not always add 'statement commit' to the
        rows injected in circular replication set up.
        To be investigated separately.
      sql/ha_ndbcluster_binlog.cc:
        Add close_thread_tables() to run_query: this ensures
        that all tables are closed and there is no pending statement transaction.
      sql/handler.cc:
        Implement optimisation of read-only transactions.
        If a transaction consists only of DML statements that do not change
        data, we do not perform a two-phase commit for it 
        (run one phase commit only).
      sql/handler.h:
        Implement optimisation of read-only transactions.
        If a transaction consists only of DML statements that do not change
        data, we do not perform a two-phase commit for it 
        (run one phase commit only).
      sql/log.cc:
        Mark the binlog transaction read-write whenever it's started.
        We never read from binlog, so it's safe and least intrusive to add
        this mark up here.
      sql/log_event.cc:
        Update to the new layout of thd->transaction.
      sql/rpl_injector.cc:
        Always commit statement transaction before committing the global one.
      sql/sp.cc:
        Ad comments.
      sql/sp_head.cc:
        Add comments.
      sql/sql_base.cc:
        Commit transaction at the end of the statement. Always.
      sql/sql_class.cc:
        Update thd_ha_data to return the right pointer in the new layout.
        
        Fix select_dumpvar::send_data to properly return operation status.
        A test case from commit.inc would lead to an assertion failure in the 
        diagnostics area (double assignment). Not test otherwise by the test suite.
      sql/sql_class.h:
        Implement a new layout of storage engine transaction info in which 
        it is easy to access all members related to the handlerton only
        based on ht->slot.
      sql/sql_cursor.cc:
        Update to the new layout of thd->transaction.
      sql/sql_delete.cc:
        Remove wrong and now redundant calls to ha_autocommit_or_rollback.
        The transaction is committed in one place, at the end of the statement.
        Remove calls to mysql_unlock_tables, since some engines count locks
        and commit statement transaction in unlock_tables(), which essentially
        equates mysql_unlock_tables to ha_autocommit_or_rollback.
        Previously it was necessary to unlock tables soon because we wanted
        to avoid sending of 'ok' packet to the client under locked tables.
        This is no longer necessary, since OK packet is also sent from one place
        at the end of transaction.
      sql/sql_do.cc:
        Add DO always clears the error, we must rollback the current
        statement before this happens. Otherwise the statement will be committed,
        and not rolled back in the end.
      sql/sql_insert.cc:
        Remove wrong and now redundant calls to ha_autocommit_or_rollback.
        The transaction is committed in one place, at the end of the statement.
        Remove calls to mysql_unlock_tables, since some engines count locks
        and commit statement transaction in unlock_tables(), which essentially
        equates mysql_unlock_tables to ha_autocommit_or_rollback.
        Previously it was necessary to unlock tables soon because we wanted
        to avoid sending of 'ok' packet to the client under locked tables.
        This is no longer necessary, since OK packet is also sent from one place
        at the end of transaction.
      sql/sql_load.cc:
        Remove wrong and now redundant calls to ha_autocommit_or_rollback.
        The transaction is committed in one place, at the end of the statement.
        Remove calls to mysql_unlock_tables, since some engines count locks
        and commit statement transaction in unlock_tables(), which essentially
        equates mysql_unlock_tables to ha_autocommit_or_rollback.
        Previously it was necessary to unlock tables soon because we wanted
        to avoid sending of 'ok' packet to the client under locked tables.
        This is no longer necessary, since OK packet is also sent from one place
        at the end of transaction.
      sql/sql_parse.cc:
        Implement optimisation of read-only transactions: bypass 2-phase
        commit for them.
        Always commit statement transaction before commiting the global one.
        Fix an unrelated crash in check_table_access, when called from 
        information_schema.
      sql/sql_partition.cc:
        Partitions commit at the end of a DDL operation.
        Make sure that send_ok() is done only if the commit has succeeded.
      sql/sql_table.cc:
        Use ha_autocommit_or_rollback and end_active_trans everywhere.
        Add end_trans to mysql_admin_table, so that it leaves no pending
        transaction.
      sql/sql_udf.cc:
        Remvove a redundant call to close_thread_tables()
      sql/sql_update.cc:
        Remove wrong and now redundant calls to ha_autocommit_or_rollback.
        The transaction is committed in one place, at the end of the statement.
        Remove calls to mysql_unlock_tables, since some engines count locks
        and commit statement transaction in unlock_tables(), which essentially
        equates mysql_unlock_tables to ha_autocommit_or_rollback.
        Previously it was necessary to unlock tables soon because we wanted
        to avoid sending of 'ok' packet to the client under locked tables.
        This is no longer necessary, since OK packet is also sent from one place
        at the end of transaction.
      mysql-test/include/commit.inc:
        New BitKeeper file ``mysql-test/include/commit.inc''
      mysql-test/r/commit_1innodb.result:
        New BitKeeper file ``mysql-test/r/commit_1innodb.result''
      mysql-test/t/commit_1innodb.test:
        New BitKeeper file ``mysql-test/t/commit_1innodb.test''
      526798db
  32. 30 Oct, 2007 1 commit
    • unknown's avatar
      Manual merge 5.0-rpl -> 5.1-rpl. · 356bdcb7
      unknown authored
      involved bug#12691, bug#27571
      
      
      mysql-test/suite/rpl/r/rpl_sp_effects.result:
        results changed
      sql/slave.cc:
        pended manual merge done (mats)
      sql/sql_delete.cc:
        manual merge
      sql/sql_insert.cc:
        manual merge
      sql/sql_load.cc:
        manual merge
      sql/sql_update.cc:
        manual merge.
      356bdcb7
  33. 29 Oct, 2007 1 commit
    • unknown's avatar
      Bug #27571 asynchronousity in setting mysql_`query`::error and · 95f3db7b
      unknown authored
                 Query_log_event::error_code
      
      A query can perform completely having the local var error of mysql_$query
      zero, where $query in insert, update, delete, load,
      and be  binlogged with error_code e.g KILLED_QUERY while there is no
      reason do to so.
      That can happen because Query_log_event consults thd->killed flag to
      evaluate error_code.
      
      Fixed with implementing a scheme suggested and partly implemented at
      time of bug@22725 work-on. error_status is cached immediatly after the
      control leaves the main rows-loop and that instance always corresponds
      to `error' the local of mysql_$query functions. The cached value
      is passed to Query_log_event constructor, not the default thd->killed
      which can be changed in between of the caching and the constructing.
      
      
      mysql-test/r/binlog_killed.result:
        results changed
      mysql-test/t/binlog_killed.test:
        Demonstrating that effective killing during rows-loop execution leads to the speficied actions:
        binlogging with the error for a query modified a not-transactional table or
        rolling back effects for transactional table;
        
        fixing possible non-determinism with ID when query_log_enabled;
        
        leave commented out tests for multi-update,delete due to another bug;
        
        removing an obsolete tests template;
        
        changing system rm to --remove_file.
      sql/log_event.cc:
        adding killed status arg
      sql/log_event.h:
        added killed status arg
      sql/sql_delete.cc:
        deploying the update part patch for delete, multi-delete
      sql/sql_insert.cc:
        deploying the update-part patch for insert..select
      sql/sql_load.cc:
        deploying the update-part patch for load data.
        simulation added.
      sql/sql_update.cc:
        Impementing the fix as described in the comments left by bug@22725.
        Also simulation of killing after the loop that would affect binlogging in the old code.
      mysql-test/t/binlog_killed_bug27571-master.opt:
        post rows-loop killing simulation's options
      mysql-test/t/binlog_killed_bug27571.test:
        Checking that if killing happens inbetween of the end of rows loop and
        recording into binlog that will not lead to recording any error incl
        the killed error.
      mysql-test/t/binlog_killed_simulate-master.opt:
        simulation options
      mysql-test/t/binlog_killed_simulate.test:
        tests for 
        a query (update is choosen) being killed after the row-loop;
        load data killed within the loop - effective killed error in the event is gained.
      95f3db7b
  34. 21 Aug, 2007 1 commit
    • unknown's avatar
      Bug #23333 stored function + non-transac table + transac table = breaks stmt-based binlog · a0849011
      unknown authored
      Binlogging of the statement with a side effect like a modified non-trans table did not happen.
      The artifact involved all binloggable dml queries.
      
      Fixed with changing the binlogging conditions all over the code to exploit thd->transaction.stmt.modified_non_trans_table
      introduced by the patch for bug@27417.
      
      Multi-delete case has own specific addressed by another bug@29136. Multi-update case has been addressed by bug#27716 and
      patch and will need merging.
      
      
      mysql-test/r/mix_innodb_myisam_binlog.result:
        results changed
      mysql-test/r/sp_trans_log.result:
        results changed
      mysql-test/t/mix_innodb_myisam_binlog.test:
        specific to the bug tests added
      mysql-test/t/sp_trans_log.test:
        refining of the proof of that there is an event in binlog
      sql/sql_delete.cc:
        deploying the binlogging check with thd->transaction.stmt.modified_non_trans_table
      sql/sql_insert.cc:
        binlogging when thd->transaction.stmt.modified_non_trans_table is TRUE. Merge with Bug#29571.
      sql/sql_load.cc:
        binlogging when thd->transaction.stmt.modified_non_trans_table is true
      sql/sql_update.cc:
        binlogging when thd->transaction.stmt.modified_non_trans_table is true
      a0849011
  35. 30 Jul, 2007 1 commit
    • unknown's avatar
      (pushing for Andrei) · 1307d3b8
      unknown authored
      Bug #27417 thd->no_trans_update.stmt lost value inside of SF-exec-stack
        
      Once had been set the flag might later got reset inside of a stored routine 
      execution stack.
      The reason was in that there was no check if a new statement started at time 
      of resetting.
      The artifact affects most of binlogable DML queries. Notice, that multi-update 
      is wrapped up within
        bug@27716 fix, multi-delete bug@29136.
        
      Fixed with saving parent's statement flag of whether the statement modified 
      non-transactional table, and unioning (merging) the value with that was gained 
      in mysql_execute_command.
        
      Resettling thd->no_trans_update members into thd->transaction.`member`;
      Asserting code;
      Effectively the following properties are held.
        
      1. At the end of a substatement thd->transaction.stmt.modified_non_trans_table
         reflects the fact if such a table got modified by the substatement.
         That also respects THD::really_abort_on_warnin() requirements.
      2. Eventually thd->transaction.stmt.modified_non_trans_table will be computed as
         the union of the values of all invoked sub-statements.
         That fixes this bug#27417;
      
      Computing of thd->transaction.all.modified_non_trans_table is refined to base to 
      the stmt's value for all the case including insert .. select statement which 
      before the patch had an extra issue bug@28960.
      Minor issues are covered with mysql_load, mysql_delete, and binloggin of insert in
      to temp_table select. 
        
      The supplied test verifies limitely, mostly asserts. The ultimate testing is defered
      for bug@13270, bug@23333.
      
      
      mysql-test/r/mix_innodb_myisam_binlog.result:
        results changed
      mysql-test/t/mix_innodb_myisam_binlog.test:
        regression test incl the related bug#28960.
      sql/ha_ndbcluster.cc:
        thd->transaction.{all,stmt}.modified_non_trans_table
        instead of
        thd->no_trans_update.{all,stmt}
      sql/handler.cc:
        thd->transaction.{all,stmt}.modified_non_trans_table
        instead of
        thd->no_trans_update.{all,stmt}
      sql/handler.h:
        new member added
      sql/log.cc:
        thd->transaction.{all,stmt}.modified_non_trans_table
        instead of
        thd->no_trans_update.{all,stmt}
      sql/set_var.cc:
        thd->transaction.{all,stmt}.modified_non_trans_table
        instead of
        thd->no_trans_update.{all,stmt}
      sql/sp_head.cc:
        thd->transaction.{all,stmt}.modified_non_trans_table
        instead of
        thd->no_trans_update.{all,stmt}
        
        and saving and merging stmt's flag at the end of a substatement.
      sql/sql_class.cc:
        thd->transaction.{all,stmt}.modified_non_trans_table
        instead of
        thd->no_trans_update.{all,stmt}
      sql/sql_class.h:
        thd->transaction.{all,stmt}.modified_non_trans_table
        instead of
        thd->no_trans_update.{all,stmt}
      sql/sql_delete.cc:
        correcting basic delete incl truncate branch and multi-delete queries to set
        stmt.modified_non_trans_table;
        optimization to set the flag at the end of per-row loop;
        multi-delete still has an extra issue similar to bug#27716 of multi-update 
        - to be address with bug_29136 fix.
      sql/sql_insert.cc:
        thd->transaction.{all,stmt}.modified_non_trans_table
        instead of
        thd->no_trans_update.{all,stmt}
      sql/sql_load.cc:
        eliminating a separate issue where the stmt flag was saved and re-stored after 
        write_record that actually could change it and the change would be lost but 
        should remain permanent;
        thd->transaction.{all,stmt}.modified_non_trans_table
        instead of
        thd->no_trans_update.{all,stmt}
      sql/sql_parse.cc:
        initialization to transaction.stmt.modified_non_trans_table at the common part 
        of all types of statements processing - mysql_execute_command().
      sql/sql_table.cc:
        moving the reset up to the mysql_execute_command() caller
      sql/sql_update.cc:
        correcting update query case (multi-update part of the issues covered by other 
        bug#27716 fix)
        thd->transaction.{all,stmt}.modified_non_trans_table
        instead of
        thd->no_trans_update.{all,stmt}
      1307d3b8
  36. 03 Jul, 2007 1 commit
    • unknown's avatar
      Fixed bug #29294. · 166d3c91
      unknown authored
      The `SELECT 'r' INTO OUTFILE ... FIELDS ENCLOSED BY 'r' ' statement
      encoded the 'r' string to a 4 byte string of value x'725c7272'
      (sequence of 4 characters: r\rr).
      The LOAD DATA statement decoded this string to a 1 byte string of
      value x'0d' (ASCII Carriage Return character) instead of the original
      'r' character.
      The same error also happened with the FIELDS ENCLOSED BY clause
      followed by special characters: 'n', 't', 'r', 'b', '0', 'Z' and 'N'.
      
      NOTE 1: This is a result of the undocumented feature: the LOAD DATA INFILE
      recognises 2-byte input sequences like \n, \t, \r and \Z in addition
      to documented 2-byte sequences: \0 and \N. This feature should be
      documented (here backspace character is a default ESCAPED BY character,
      in the real-life example it may be any ESCAPED BY character).
      
      NOTE 2, changed behaviour:
      Now the `SELECT INTO OUTFILE' statement with the `FIELDS ENCLOSED BY'
      clause followed by one of: 'n', 't', 'r', 'b', '0', 'Z' or 'N' characters
      encodes this special character itself by doubling it ('r' --> 'rr'),
      not by prepending it with an escape character.
      
      
      sql/sql_class.h:
        Fixed bug #29294.
        The ESCAPE_CHARS macro constant is defined to enumerate
        symbolic names of espace-sequences like  '\n', '\t' etc.
        The select_export::is_ambiguous_field_sep field has been added
        to distinguish special values of the field_sep field from
        another values (see ESCAPE_CHARS).
      sql/sql_class.cc:
        Fixed bug #29294.
        The select_export::send_data method has been modified to
        encode special values of the field_sep field by
        doubling of those values instead of prepending them with a
        value of the escape_char field.
        Example: The SELECT 'r' INTO OUTFILE FIELDS ENCLOSED BY 'r'
        now produces the 'rr' output string instead of x'5c72'
        (i.e. instead of sequence of 2 bytes: \ and r).
      sql/sql_load.cc:
        Fixed bug #29294.
        Added commentary for the READ_INFO::unescape method.
      mysql-test/t/loaddata.test:
        Updated test case for bug #29294.
      mysql-test/r/loaddata.result:
        Updated test case for bug #29294.
      166d3c91
  37. 10 May, 2007 1 commit
    • unknown's avatar
      WL#3817: Simplify string / memory area types and make things more consistent (first part) · f252f924
      unknown authored
      The following type conversions was done:
      
      - Changed byte to uchar
      - Changed gptr to uchar*
      - Change my_string to char *
      - Change my_size_t to size_t
      - Change size_s to size_t
      
      Removed declaration of byte, gptr, my_string, my_size_t and size_s. 
      
      Following function parameter changes was done:
      - All string functions in mysys/strings was changed to use size_t
        instead of uint for string lengths.
      - All read()/write() functions changed to use size_t (including vio).
      - All protocoll functions changed to use size_t instead of uint
      - Functions that used a pointer to a string length was changed to use size_t*
      - Changed malloc(), free() and related functions from using gptr to use void *
        as this requires fewer casts in the code and is more in line with how the
        standard functions work.
      - Added extra length argument to dirname_part() to return the length of the
        created string.
      - Changed (at least) following functions to take uchar* as argument:
        - db_dump()
        - my_net_write()
        - net_write_command()
        - net_store_data()
        - DBUG_DUMP()
        - decimal2bin() & bin2decimal()
      - Changed my_compress() and my_uncompress() to use size_t. Changed one
        argument to my_uncompress() from a pointer to a value as we only return
        one value (makes function easier to use).
      - Changed type of 'pack_data' argument to packfrm() to avoid casts.
      - Changed in readfrm() and writefrom(), ha_discover and handler::discover()
        the type for argument 'frmdata' to uchar** to avoid casts.
      - Changed most Field functions to use uchar* instead of char* (reduced a lot of
        casts).
      - Changed field->val_xxx(xxx, new_ptr) to take const pointers.
      
      Other changes:
      - Removed a lot of not needed casts
      - Added a few new cast required by other changes
      - Added some cast to my_multi_malloc() arguments for safety (as string lengths
        needs to be uint, not size_t).
      - Fixed all calls to hash-get-key functions to use size_t*. (Needed to be done
        explicitely as this conflict was often hided by casting the function to
        hash_get_key).
      - Changed some buffers to memory regions to uchar* to avoid casts.
      - Changed some string lengths from uint to size_t.
      - Changed field->ptr to be uchar* instead of char*. This allowed us to
        get rid of a lot of casts.
      - Some changes from true -> TRUE, false -> FALSE, unsigned char -> uchar
      - Include zlib.h in some files as we needed declaration of crc32()
      - Changed MY_FILE_ERROR to be (size_t) -1.
      - Changed many variables to hold the result of my_read() / my_write() to be
        size_t. This was needed to properly detect errors (which are
        returned as (size_t) -1).
      - Removed some very old VMS code
      - Changed packfrm()/unpackfrm() to not be depending on uint size
        (portability fix)
      - Removed windows specific code to restore cursor position as this
        causes slowdown on windows and we should not mix read() and pread()
        calls anyway as this is not thread safe. Updated function comment to
        reflect this. Changed function that depended on original behavior of
        my_pwrite() to itself restore the cursor position (one such case).
      - Added some missing checking of return value of malloc().
      - Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid 'long' overflow.
      - Changed type of table_def::m_size from my_size_t to ulong to reflect that
        m_size is the number of elements in the array, not a string/memory
        length.
      - Moved THD::max_row_length() to table.cc (as it's not depending on THD).
        Inlined max_row_length_blob() into this function.
      - More function comments
      - Fixed some compiler warnings when compiled without partitions.
      - Removed setting of LEX_STRING() arguments in declaration (portability fix).
      - Some trivial indentation/variable name changes.
      - Some trivial code simplifications:
        - Replaced some calls to alloc_root + memcpy to use
          strmake_root()/strdup_root().
        - Changed some calls from memdup() to strmake() (Safety fix)
        - Simpler loops in client-simple.c
      
      
      BitKeeper/etc/ignore:
        added libmysqld/ha_ndbcluster_cond.cc
        ---
        added debian/defs.mk debian/control
      client/completion_hash.cc:
        Remove not needed casts
      client/my_readline.h:
        Remove some old types
      client/mysql.cc:
        Simplify types
      client/mysql_upgrade.c:
        Remove some old types
        Update call to dirname_part
      client/mysqladmin.cc:
        Remove some old types
      client/mysqlbinlog.cc:
        Remove some old types
        Change some buffers to be uchar to avoid casts
      client/mysqlcheck.c:
        Remove some old types
      client/mysqldump.c:
        Remove some old types
        Remove some not needed casts
        Change some string lengths to size_t
      client/mysqlimport.c:
        Remove some old types
      client/mysqlshow.c:
        Remove some old types
      client/mysqlslap.c:
        Remove some old types
        Remove some not needed casts
      client/mysqltest.c:
        Removed some old types
        Removed some not needed casts
        Updated hash-get-key function arguments
        Updated parameters to dirname_part()
      client/readline.cc:
        Removed some old types
        Removed some not needed casts
        Changed some string lengths to use size_t
      client/sql_string.cc:
        Removed some old types
      dbug/dbug.c:
        Removed some old types
        Changed some string lengths to use size_t
        Changed some prototypes to avoid casts
      extra/comp_err.c:
        Removed some old types
      extra/innochecksum.c:
        Removed some old types
      extra/my_print_defaults.c:
        Removed some old types
      extra/mysql_waitpid.c:
        Removed some old types
      extra/perror.c:
        Removed some old types
      extra/replace.c:
        Removed some old types
        Updated parameters to dirname_part()
      extra/resolve_stack_dump.c:
        Removed some old types
      extra/resolveip.c:
        Removed some old types
      include/config-win.h:
        Removed some old types
      include/decimal.h:
        Changed binary strings to be uchar* instead of char*
      include/ft_global.h:
        Removed some old types
      include/hash.h:
        Removed some old types
      include/heap.h:
        Removed some old types
        Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
      include/keycache.h:
        Removed some old types
      include/m_ctype.h:
        Removed some old types
        Changed some string lengths to use size_t
        Changed character length functions to return uint
        unsigned char -> uchar
      include/m_string.h:
        Removed some old types
        Changed some string lengths to use size_t
      include/my_alloc.h:
        Changed some string lengths to use size_t
      include/my_base.h:
        Removed some old types
      include/my_dbug.h:
        Removed some old types
        Changed some string lengths to use size_t
        Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
      include/my_getopt.h:
        Removed some old types
      include/my_global.h:
        Removed old types:
        my_size_t -> size_t
        byte -> uchar
        gptr -> uchar *
      include/my_list.h:
        Removed some old types
      include/my_nosys.h:
        Removed some old types
      include/my_pthread.h:
        Removed some old types
      include/my_sys.h:
        Removed some old types
        Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
        Changed some string lengths to use size_t
        my_malloc() / my_free() now uses void *
        Updated parameters to dirname_part() & my_uncompress()
      include/my_tree.h:
        Removed some old types
      include/my_trie.h:
        Removed some old types
      include/my_user.h:
        Changed some string lengths to use size_t
      include/my_vle.h:
        Removed some old types
      include/my_xml.h:
        Removed some old types
        Changed some string lengths to use size_t
      include/myisam.h:
        Removed some old types
      include/myisammrg.h:
        Removed some old types
      include/mysql.h:
        Removed some old types
        Changed byte streams to use uchar* instead of char*
      include/mysql_com.h:
        Removed some old types
        Changed some string lengths to use size_t
        Changed some buffers to be uchar* to avoid casts
      include/queues.h:
        Removed some old types
      include/sql_common.h:
        Removed some old types
      include/sslopt-longopts.h:
        Removed some old types
      include/violite.h:
        Removed some old types
        Changed some string lengths to use size_t
      libmysql/client_settings.h:
        Removed some old types
      libmysql/libmysql.c:
        Removed some old types
      libmysql/manager.c:
        Removed some old types
      libmysqld/emb_qcache.cc:
        Removed some old types
      libmysqld/emb_qcache.h:
        Removed some old types
      libmysqld/lib_sql.cc:
        Removed some old types
        Removed some not needed casts
        Changed some buffers to be uchar* to avoid casts
        true -> TRUE, false -> FALSE
      mysys/array.c:
        Removed some old types
      mysys/charset.c:
        Changed some string lengths to use size_t
      mysys/checksum.c:
        Include zlib to get definition for crc32
        Removed some old types
      mysys/default.c:
        Removed some old types
        Changed some string lengths to use size_t
      mysys/default_modify.c:
        Changed some string lengths to use size_t
        Removed some not needed casts
      mysys/hash.c:
        Removed some old types
        Changed some string lengths to use size_t
        Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
        hash_element now takes 'ulong' as the index type (cleanup)
      mysys/list.c:
        Removed some old types
      mysys/mf_cache.c:
        Changed some string lengths to use size_t
      mysys/mf_dirname.c:
        Removed some old types
        Changed some string lengths to use size_t
        Added argument to dirname_part() to avoid calculation of length for 'to'
      mysys/mf_fn_ext.c:
        Removed some old types
        Updated parameters to dirname_part()
      mysys/mf_format.c:
        Removed some old types
        Changed some string lengths to use size_t
      mysys/mf_getdate.c:
        Removed some old types
      mysys/mf_iocache.c:
        Removed some old types
        Changed some string lengths to use size_t
        Changed calculation of 'max_length' to be done the same way in all functions
      mysys/mf_iocache2.c:
        Removed some old types
        Changed some string lengths to use size_t
        Clean up comments
        Removed not needed indentation
      mysys/mf_keycache.c:
        Removed some old types
      mysys/mf_keycaches.c:
        Removed some old types
      mysys/mf_loadpath.c:
        Removed some old types
      mysys/mf_pack.c:
        Removed some old types
        Changed some string lengths to use size_t
        Removed some not needed casts
        Removed very old VMS code
        Updated parameters to dirname_part()
        Use result of dirnam_part() to remove call to strcat()
      mysys/mf_path.c:
        Removed some old types
      mysys/mf_radix.c:
        Removed some old types
      mysys/mf_same.c:
        Removed some old types
      mysys/mf_sort.c:
        Removed some old types
      mysys/mf_soundex.c:
        Removed some old types
      mysys/mf_strip.c:
        Removed some old types
      mysys/mf_tempdir.c:
        Removed some old types
      mysys/mf_unixpath.c:
        Removed some old types
      mysys/mf_wfile.c:
        Removed some old types
      mysys/mulalloc.c:
        Removed some old types
      mysys/my_alloc.c:
        Removed some old types
        Changed some string lengths to use size_t
        Use void* as type for allocated memory area
        Removed some not needed casts
        Changed argument 'Size' to 'length' according coding guidelines
      mysys/my_chsize.c:
        Changed some buffers to be uchar* to avoid casts
      mysys/my_compress.c:
        More comments
        Removed some old types
        Changed string lengths to use size_t
        Changed arguments to my_uncompress() to make them easier to understand
        Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
        Changed type of 'pack_data' argument to packfrm() to avoid casts.
      mysys/my_conio.c:
        Changed some string lengths to use size_t
      mysys/my_create.c:
        Removed some old types
      mysys/my_div.c:
        Removed some old types
      mysys/my_error.c:
        Removed some old types
      mysys/my_fopen.c:
        Removed some old types
      mysys/my_fstream.c:
        Removed some old types
        Changed some string lengths to use size_t
        writen -> written
      mysys/my_getopt.c:
        Removed some old types
      mysys/my_getwd.c:
        Removed some old types
        More comments
      mysys/my_init.c:
        Removed some old types
      mysys/my_largepage.c:
        Removed some old types
        Changed some string lengths to use size_t
      mysys/my_lib.c:
        Removed some old types
      mysys/my_lockmem.c:
        Removed some old types
      mysys/my_malloc.c:
        Removed some old types
        Changed malloc(), free() and related functions to use void *
        Changed all functions to use size_t
      mysys/my_memmem.c:
        Indentation cleanup
      mysys/my_once.c:
        Removed some old types
        Changed malloc(), free() and related functions to use void *
      mysys/my_open.c:
        Removed some old types
      mysys/my_pread.c:
        Removed some old types
        Changed all functions to use size_t
        Added comment for how my_pread() / my_pwrite() are supposed to work.
        Removed windows specific code to restore cursor position as this causes slowdown on windows and we should not mix read() and pread() calls anyway as this is not thread safe.
        (If we ever would really need this, it should be enabled only with a flag argument)
      mysys/my_quick.c:
        Removed some old types
        Changed all functions to use size_t
      mysys/my_read.c:
        Removed some old types
        Changed all functions to use size_t
      mysys/my_realloc.c:
        Removed some old types
        Use void* as type for allocated memory area
        Changed all functions to use size_t
      mysys/my_static.c:
        Removed some old types
      mysys/my_static.h:
        Removed some old types
      mysys/my_vle.c:
        Removed some old types
      mysys/my_wincond.c:
        Removed some old types
      mysys/my_windac.c:
        Removed some old types
      mysys/my_write.c:
        Removed some old types
        Changed all functions to use size_t
      mysys/ptr_cmp.c:
        Removed some old types
        Changed all functions to use size_t
      mysys/queues.c:
        Removed some old types
      mysys/safemalloc.c:
        Removed some old types
        Changed malloc(), free() and related functions to use void *
        Changed all functions to use size_t
      mysys/string.c:
        Removed some old types
        Changed all functions to use size_t
      mysys/testhash.c:
        Removed some old types
      mysys/thr_alarm.c:
        Removed some old types
      mysys/thr_lock.c:
        Removed some old types
      mysys/tree.c:
        Removed some old types
      mysys/trie.c:
        Removed some old types
      mysys/typelib.c:
        Removed some old types
      plugin/daemon_example/daemon_example.cc:
        Removed some old types
      regex/reginit.c:
        Removed some old types
      server-tools/instance-manager/buffer.cc:
        Changed some string lengths to use size_t
        Changed buffer to be of type uchar*
      server-tools/instance-manager/buffer.h:
        Changed some string lengths to use size_t
        Changed buffer to be of type uchar*
      server-tools/instance-manager/commands.cc:
        Removed some old types
        Changed some string lengths to use size_t
        Changed buffer to be of type uchar*
      server-tools/instance-manager/instance_map.cc:
        Removed some old types
        Changed some string lengths to use size_t
        Changed buffer to be of type uchar*
      server-tools/instance-manager/instance_options.cc:
        Changed buffer to be of type uchar*
        Replaced alloc_root + strcpy() with strdup_root()
      server-tools/instance-manager/mysql_connection.cc:
        Changed buffer to be of type uchar*
      server-tools/instance-manager/options.cc:
        Removed some old types
      server-tools/instance-manager/parse.cc:
        Changed some string lengths to use size_t
      server-tools/instance-manager/parse.h:
        Removed some old types
        Changed some string lengths to use size_t
      server-tools/instance-manager/protocol.cc:
        Changed some buffers to be uchar* to avoid casts
        Changed some string lengths to use size_t
      server-tools/instance-manager/protocol.h:
        Changed some string lengths to use size_t
      server-tools/instance-manager/user_map.cc:
        Removed some old types
        Changed some string lengths to use size_t
      sql/derror.cc:
        Removed some old types
        Changed some buffers to be uchar* to avoid casts
        Changed some string lengths to use size_t
      sql/discover.cc:
        Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
        Changed some string lengths to use size_t
        Changed some buffers to be uchar* to avoid casts
      sql/event_data_objects.cc:
        Removed some old types
        Added missing casts for alloc() and sprintf()
      sql/event_db_repository.cc:
        Changed some buffers to be uchar* to avoid casts
        Added missing casts for sprintf()
      sql/event_queue.cc:
        Removed some old types
      sql/field.cc:
        Removed some old types
        Changed memory buffers to be uchar*
        Changed some string lengths to use size_t
        Removed a lot of casts
        Safety fix in Field_blob::val_decimal() to not access zero pointer
      sql/field.h:
        Removed some old types
        Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes). 
        Changed some string lengths to use size_t
        Removed some not needed casts
        Changed val_xxx(xxx, new_ptr) to take const pointers
      sql/field_conv.cc:
        Removed some old types
        Added casts required because memory area pointers are now uchar*
      sql/filesort.cc:
        Initalize variable that was used unitialized in error conditions
      sql/gen_lex_hash.cc:
        Removed some old types
        Changed memory buffers to be uchar*
        Changed some string lengths to use size_t
        Removed a lot of casts
        Safety fix in Field_blob::val_decimal() to not access zero pointer
      sql/gstream.h:
        Added required cast
      sql/ha_ndbcluster.cc:
        Removed some old types
        Updated hash-get-key function arguments
        Changed some buffers to be uchar* to avoid casts
        Added required casts
        Removed some not needed casts
      sql/ha_ndbcluster.h:
        Removed some old types
      sql/ha_ndbcluster_binlog.cc:
        Removed some old types
        Changed some buffers to be uchar* to avoid casts
        Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
        Changed some string lengths to use size_t
        Added missing casts for alloc() and sprintf()
      sql/ha_ndbcluster_binlog.h:
        Removed some old types
      sql/ha_ndbcluster_cond.cc:
        Removed some old types
        Removed some not needed casts
      sql/ha_ndbcluster_cond.h:
        Removed some old types
      sql/ha_partition.cc:
        Removed some old types
        Changed prototype for change_partition() to avoid casts
      sql/ha_partition.h:
        Removed some old types
      sql/handler.cc:
        Removed some old types
        Changed some string lengths to use size_t
      sql/handler.h:
        Removed some old types
        Changed some string lengths to use size_t
        Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
      sql/hash_filo.h:
        Removed some old types
        Changed all functions to use size_t
      sql/hostname.cc:
        Removed some old types
      sql/item.cc:
        Removed some old types
        Changed some string lengths to use size_t
        Use strmake() instead of memdup() to create a null terminated string.
        Updated calls to new Field()
      sql/item.h:
        Removed some old types
        Changed malloc(), free() and related functions to use void *
        Changed some buffers to be uchar* to avoid casts
      sql/item_cmpfunc.cc:
        Removed some old types
        Changed some buffers to be uchar* to avoid casts
      sql/item_cmpfunc.h:
        Removed some old types
      sql/item_create.cc:
        Removed some old types
      sql/item_func.cc:
        Removed some old types
        Changed some buffers to be uchar* to avoid casts
        Removed some not needed casts
        Added test for failing alloc() in init_result_field()
        Remove old confusing comment
        Fixed compiler warning
      sql/item_func.h:
        Removed some old types
      sql/item_row.cc:
        Removed some old types
      sql/item_row.h:
        Removed some old types
      sql/item_strfunc.cc:
        Include zlib (needed becasue we call crc32)
        Removed some old types
      sql/item_strfunc.h:
        Removed some old types
        Changed some types to match new function prototypes
      sql/item_subselect.cc:
        Removed some old types
      sql/item_subselect.h:
        Removed some old types
      sql/item_sum.cc:
        Removed some old types
        Changed some buffers to be uchar* to avoid casts
        Removed some not needed casts
      sql/item_sum.h:
        Removed some old types
      sql/item_timefunc.cc:
        Removed some old types
        Changed some string lengths to use size_t
      sql/item_timefunc.h:
        Removed some old types
      sql/item_xmlfunc.cc:
        Changed some string lengths to use size_t
      sql/item_xmlfunc.h:
        Removed some old types
      sql/key.cc:
        Removed some old types
        Removed some not needed casts
      sql/lock.cc:
        Removed some old types
        Added some cast to my_multi_malloc() arguments for safety
      sql/log.cc:
        Removed some old types
        Changed some string lengths to use size_t
        Changed some buffers to be uchar* to avoid casts
        Changed usage of pwrite() to not assume it holds the cursor position for the file
        Made usage of my_read() safer
      sql/log_event.cc:
        Removed some old types
        Added checking of return value of malloc() in pack_info()
        Changed some buffers to be uchar* to avoid casts
        Removed some 'const' to avoid casts
        Added missing casts for alloc() and sprintf()
        Added required casts
        Removed some not needed casts
        Added some cast to my_multi_malloc() arguments for safety
      sql/log_event.h:
        Removed some old types
        Changed some buffers to be uchar* to avoid casts
      sql/log_event_old.cc:
        Changed some buffers to be uchar* to avoid casts
        Removed some not needed casts
      sql/log_event_old.h:
        Changed some buffers to be uchar* to avoid casts
      sql/mf_iocache.cc:
        Removed some old types
      sql/my_decimal.cc:
        Changed memory area to use uchar*
      sql/my_decimal.h:
        Changed memory area to use uchar*
      sql/mysql_priv.h:
        Removed some old types
        Changed malloc(), free() and related functions to use void *
        Changed some string lengths to use size_t
        Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
        Changed some buffers to be uchar* to avoid casts
      sql/mysqld.cc:
        Removed some old types
      sql/net_serv.cc:
        Removed some old types
        Changed some string lengths to use size_t
        Changed some buffers to be uchar* to avoid casts
        Ensure that vio_read()/vio_write() return values are stored in a size_t variable
        Removed some not needed casts
      sql/opt_range.cc:
        Removed some old types
        Changed some buffers to be uchar* to avoid casts
        Removed some not needed casts
      sql/opt_range.h:
        Removed some old types
        Changed some buffers to be uchar* to avoid casts
      sql/opt_sum.cc:
        Removed some old types
        Removed some not needed casts
      sql/parse_file.cc:
        Removed some old types
        Changed some string lengths to use size_t
        Changed alloc_root + memcpy + set end 0 -> strmake_root()
      sql/parse_file.h:
        Removed some old types
      sql/partition_info.cc:
        Removed some old types
        Added missing casts for alloc()
        Changed some buffers to be uchar* to avoid casts
      sql/partition_info.h:
        Changed some buffers to be uchar* to avoid casts
      sql/protocol.cc:
        Removed some old types
        Changed some buffers to be uchar* to avoid casts
        Removed some not needed casts
      sql/protocol.h:
        Removed some old types
        Changed some buffers to be uchar* to avoid casts
        Changed some string lengths to use size_t
      sql/records.cc:
        Removed some old types
      sql/repl_failsafe.cc:
        Removed some old types
        Changed some string lengths to use size_t
        Added required casts
      sql/rpl_filter.cc:
        Removed some old types
        Updated hash-get-key function arguments
        Changed some string lengths to use size_t
      sql/rpl_filter.h:
        Changed some string lengths to use size_t
      sql/rpl_injector.h:
        Removed some old types
      sql/rpl_record.cc:
        Removed some old types
        Removed some not needed casts
        Changed some buffers to be uchar* to avoid casts
      sql/rpl_record.h:
        Removed some old types
        Changed some buffers to be uchar* to avoid casts
      sql/rpl_record_old.cc:
        Removed some old types
        Changed some buffers to be uchar* to avoid casts
        Removed some not needed casts
      sql/rpl_record_old.h:
        Removed some old types
        Changed some buffers to be uchar* to avoid cast
      sql/rpl_rli.cc:
        Removed some old types
      sql/rpl_tblmap.cc:
        Removed some old types
      sql/rpl_tblmap.h:
        Removed some old types
      sql/rpl_utility.cc:
        Removed some old types
      sql/rpl_utility.h:
        Removed some old types
        Changed type of m_size from my_size_t to ulong to reflect that m_size is the number of elements in the array, not a string/memory length
      sql/set_var.cc:
        Removed some old types
        Updated parameters to dirname_part()
      sql/set_var.h:
        Removed some old types
      sql/slave.cc:
        Removed some old types
        Changed some string lengths to use size_t
      sql/slave.h:
        Removed some old types
      sql/sp.cc:
        Removed some old types
        Added missing casts for printf()
      sql/sp.h:
        Removed some old types
        Updated hash-get-key function arguments
      sql/sp_cache.cc:
        Removed some old types
        Added missing casts for printf()
        Updated hash-get-key function arguments
      sql/sp_head.cc:
        Removed some old types
        Added missing casts for alloc() and printf()
        Added required casts
        Updated hash-get-key function arguments
      sql/sp_head.h:
        Removed some old types
      sql/sp_pcontext.cc:
        Removed some old types
      sql/sp_pcontext.h:
        Removed some old types
      sql/sql_acl.cc:
        Removed some old types
        Changed some string lengths to use size_t
        Changed some buffers to be uchar* to avoid casts
        Removed some not needed casts
        Added required casts
      sql/sql_analyse.cc:
        Changed some buffers to be uchar* to avoid casts
      sql/sql_analyse.h:
        Changed some buffers to be uchar* to avoid casts
      sql/sql_array.h:
        Removed some old types
      sql/sql_base.cc:
        Removed some old types
        Updated hash-get-key function arguments
      sql/sql_binlog.cc:
        Removed some old types
        Added missing casts for printf()
      sql/sql_cache.cc:
        Removed some old types
        Updated hash-get-key function arguments
        Removed some not needed casts
        Changed some string lengths to use size_t
      sql/sql_cache.h:
        Removed some old types
        Removed reference to not existing function cache_key()
        Updated hash-get-key function arguments
      sql/sql_class.cc:
        Removed some old types
        Updated hash-get-key function arguments
        Added missing casts for alloc()
        Updated hash-get-key function arguments
        Moved THD::max_row_length() to table.cc (as it's not depending on THD)
        Removed some not needed casts
      sql/sql_class.h:
        Removed some old types
        Changed malloc(), free() and related functions to use void *
        Removed some not needed casts
        Changed some string lengths to use size_t
        Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
      sql/sql_connect.cc:
        Removed some old types
        Added required casts
      sql/sql_db.cc:
        Removed some old types
        Removed some not needed casts
        Added some cast to my_multi_malloc() arguments for safety
        Added missing casts for alloc()
      sql/sql_delete.cc:
        Removed some old types
      sql/sql_handler.cc:
        Removed some old types
        Updated hash-get-key function arguments
        Added some cast to my_multi_malloc() arguments for safety
      sql/sql_help.cc:
        Removed some old types
        Changed some buffers to be uchar* to avoid casts
        Removed some not needed casts
      sql/sql_insert.cc:
        Removed some old types
        Added missing casts for alloc() and printf()
      sql/sql_lex.cc:
        Removed some old types
      sql/sql_lex.h:
        Removed some old types
        Removed some not needed casts
      sql/sql_list.h:
        Removed some old types
        Removed some not needed casts
      sql/sql_load.cc:
        Removed some old types
        Removed compiler warning
      sql/sql_manager.cc:
        Removed some old types
      sql/sql_map.cc:
        Removed some old types
      sql/sql_map.h:
        Removed some old types
      sql/sql_olap.cc:
        Removed some old types
      sql/sql_parse.cc:
        Removed some old types
        Trivial move of code lines to make things more readable
        Changed some string lengths to use size_t
        Added missing casts for alloc()
      sql/sql_partition.cc:
        Removed some old types
        Removed compiler warnings about not used functions
        Changed some buffers to be uchar* to avoid casts
        Removed some not needed casts
      sql/sql_partition.h:
        Removed some old types
        Changed some buffers to be uchar* to avoid casts
      sql/sql_plugin.cc:
        Removed some old types
        Added missing casts for alloc()
        Updated hash-get-key function arguments
      sql/sql_prepare.cc:
        Removed some old types
        Changed some buffers to be uchar* to avoid casts
        Added missing casts for alloc() and printf()
      sql-common/client.c:
        Removed some old types
        Changed some memory areas to use uchar*
      sql-common/my_user.c:
        Changed some string lengths to use size_t
      sql-common/pack.c:
        Changed some buffers to be uchar* to avoid casts
      sql/sql_repl.cc:
        Added required casts
        Changed some buffers to be uchar* to avoid casts
        Changed some string lengths to use size_t
      sql/sql_select.cc:
        Removed some old types
        Changed some buffers to be uchar* to avoid casts
        Removed some old types
      sql/sql_select.h:
        Removed some old types
        Changed some buffers to be uchar* to avoid casts
      sql/sql_servers.cc:
        Removed some old types
        Updated hash-get-key function arguments
      sql/sql_show.cc:
        Removed some old types
        Added missing casts for alloc()
        Removed some not needed casts
      sql/sql_string.cc:
        Removed some old types
        Added required casts
      sql/sql_table.cc:
        Removed some old types
        Removed compiler warning about not used variable
        Changed some buffers to be uchar* to avoid casts
        Removed some not needed casts
      sql/sql_test.cc:
        Removed some old types
      sql/sql_trigger.cc:
        Removed some old types
        Added missing casts for alloc()
      sql/sql_udf.cc:
        Removed some old types
        Updated hash-get-key function arguments
      sql/sql_union.cc:
        Removed some old types
      sql/sql_update.cc:
        Removed some old types
        Removed some not needed casts
      sql/sql_view.cc:
        Removed some old types
      sql/sql_yacc.yy:
        Removed some old types
        Changed some string lengths to use size_t
        Added missing casts for alloc()
      sql/stacktrace.c:
        Removed some old types
      sql/stacktrace.h:
        Removed some old types
      sql/structs.h:
        Removed some old types
      sql/table.cc:
        Removed some old types
        Updated hash-get-key function arguments
        Changed some buffers to be uchar* to avoid casts
        Removed setting of LEX_STRING() arguments in declaration
        Added required casts
        More function comments
        Moved max_row_length() here from sql_class.cc/sql_class.h
      sql/table.h:
        Removed some old types
        Changed some string lengths to use size_t
      sql/thr_malloc.cc:
        Use void* as type for allocated memory area
        Changed all functions to use size_t
      sql/tzfile.h:
        Changed some buffers to be uchar* to avoid casts
      sql/tztime.cc:
        Changed some buffers to be uchar* to avoid casts
        Updated hash-get-key function arguments
        Added missing casts for alloc()
        Removed some not needed casts
      sql/uniques.cc:
        Removed some old types
        Removed some not needed casts
      sql/unireg.cc:
        Removed some old types
        Changed some buffers to be uchar* to avoid casts
        Removed some not needed casts
        Added missing casts for alloc()
      storage/archive/archive_reader.c:
        Removed some old types
      storage/archive/azio.c:
        Removed some old types
        Removed some not needed casts
      storage/archive/ha_archive.cc:
        Removed some old types
        Changed type for 'frmblob' in archive_discover() to match handler
        Updated hash-get-key function arguments
        Removed some not needed casts
      storage/archive/ha_archive.h:
        Removed some old types
      storage/blackhole/ha_blackhole.cc:
        Removed some old types
      storage/blackhole/ha_blackhole.h:
        Removed some old types
      storage/csv/ha_tina.cc:
        Removed some old types
        Updated hash-get-key function arguments
        Changed some buffers to be uchar* to avoid casts
      storage/csv/ha_tina.h:
        Removed some old types
        Removed some not needed casts
      storage/csv/transparent_file.cc:
        Removed some old types
        Changed type of 'bytes_read' to be able to detect read errors
        Fixed indentation
      storage/csv/transparent_file.h:
        Removed some old types
      storage/example/ha_example.cc:
        Removed some old types
        Updated hash-get-key function arguments
      storage/example/ha_example.h:
        Removed some old types
      storage/federated/ha_federated.cc:
        Removed some old types
        Updated hash-get-key function arguments
        Removed some not needed casts
      storage/federated/ha_federated.h:
        Removed some old types
      storage/heap/_check.c:
        Changed some buffers to be uchar* to avoid casts
      storage/heap/_rectest.c:
        Removed some old types
      storage/heap/ha_heap.cc:
        Removed some old types
      storage/heap/ha_heap.h:
        Removed some old types
      storage/heap/heapdef.h:
        Removed some old types
      storage/heap/hp_block.c:
        Removed some old types
        Changed some string lengths to use size_t
      storage/heap/hp_clear.c:
        Removed some old types
      storage/heap/hp_close.c:
        Removed some old types
      storage/heap/hp_create.c:
        Removed some old types
      storage/heap/hp_delete.c:
        Removed some old types
      storage/heap/hp_hash.c:
        Removed some old types
      storage/heap/hp_info.c:
        Removed some old types
      storage/heap/hp_open.c:
        Removed some old types
      storage/heap/hp_rfirst.c:
        Removed some old types
      storage/heap/hp_rkey.c:
        Removed some old types
      storage/heap/hp_rlast.c:
        Removed some old types
      storage/heap/hp_rnext.c:
        Removed some old types
      storage/heap/hp_rprev.c:
        Removed some old types
      storage/heap/hp_rrnd.c:
        Removed some old types
      storage/heap/hp_rsame.c:
        Removed some old types
      storage/heap/hp_scan.c:
        Removed some old types
      storage/heap/hp_test1.c:
        Removed some old types
      storage/heap/hp_test2.c:
        Removed some old types
      storage/heap/hp_update.c:
        Removed some old types
      storage/heap/hp_write.c:
        Removed some old types
        Changed some string lengths to use size_t
      storage/innobase/handler/ha_innodb.cc:
        Removed some old types
        Updated hash-get-key function arguments
        Added missing casts for alloc() and printf()
        Removed some not needed casts
      storage/innobase/handler/ha_innodb.h:
        Removed some old types
      storage/myisam/ft_boolean_search.c:
        Removed some old types
      storage/myisam/ft_nlq_search.c:
        Removed some old types
      storage/myisam/ft_parser.c:
        Removed some old types
        Changed some buffers to be uchar* to avoid casts
      storage/myisam/ft_static.c:
        Removed some old types
      storage/myisam/ft_stopwords.c:
        Removed some old types
      storage/myisam/ft_update.c:
        Removed some old types
        Changed some buffers to be uchar* to avoid casts
      storage/myisam/ftdefs.h:
        Removed some old types
        Changed some buffers to be uchar* to avoid casts
      storage/myisam/fulltext.h:
        Removed some old types
      storage/myisam/ha_myisam.cc:
        Removed some old types
      storage/myisam/ha_myisam.h:
        Removed some old types
      storage/myisam/mi_cache.c:
        Removed some old types
        Changed some buffers to be uchar* to avoid casts
      storage/myisam/mi_check.c:
        Removed some old types
      storage/myisam/mi_checksum.c:
        Removed some old types
      storage/myisam/mi_close.c:
        Removed some old types
      storage/myisam/mi_create.c:
        Removed some old types
      storage/myisam/mi_delete.c:
        Removed some old types
      storage/myisam/mi_delete_all.c:
        Removed some old types
      storage/myisam/mi_dynrec.c:
        Removed some old types
      storage/myisam/mi_extra.c:
        Removed some old types
      storage/myisam/mi_key.c:
        Removed some old types
      storage/myisam/mi_locking.c:
        Removed some old types
      storage/myisam/mi_log.c:
        Removed some old types
      storage/myisam/mi_open.c:
        Removed some old types
        Removed some not needed casts
        Check argument of my_write()/my_pwrite() in functions returning int
        Added casting of string lengths to size_t
      storage/myisam/mi_packrec.c:
        Removed some old types
        Changed some buffers to be uchar* to avoid casts
      storage/myisam/mi_page.c:
        Removed some old types
      storage/myisam/mi_preload.c:
        Removed some old types
      storage/myisam/mi_range.c:
        Removed some old types
      storage/myisam/mi_rfirst.c:
        Removed some old types
      storage/myisam/mi_rkey.c:
        Removed some old types
      storage/myisam/mi_rlast.c:
        Removed some old types
      storage/myisam/mi_rnext.c:
        Removed some old types
      storage/myisam/mi_rnext_same.c:
        Removed some old types
      storage/myisam/mi_rprev.c:
        Removed some old types
      storage/myisam/mi_rrnd.c:
        Removed some old types
      storage/myisam/mi_rsame.c:
        Removed some old types
      storage/myisam/mi_rsamepos.c:
        Removed some old types
      storage/myisam/mi_scan.c:
        Removed some old types
      storage/myisam/mi_search.c:
        Removed some old types
      storage/myisam/mi_static.c:
        Removed some old types
      storage/myisam/mi_statrec.c:
        Removed some old types
      storage/myisam/mi_test1.c:
        Removed some old types
      storage/myisam/mi_test2.c:
        Removed some old types
      storage/myisam/mi_test3.c:
        Removed some old types
      storage/myisam/mi_unique.c:
        Removed some old types
      storage/myisam/mi_update.c:
        Removed some old types
      storage/myisam/mi_write.c:
        Removed some old types
      storage/myisam/myisam_ftdump.c:
        Removed some old types
      storage/myisam/myisamchk.c:
        Removed some old types
      storage/myisam/myisamdef.h:
        Removed some old types
      storage/myisam/myisamlog.c:
        Removed some old types
        Indentation fix
      storage/myisam/myisampack.c:
        Removed some old types
      storage/myisam/rt_index.c:
        Removed some old types
      storage/myisam/rt_split.c:
        Removed some old types
      storage/myisam/sort.c:
        Removed some old types
      storage/myisam/sp_defs.h:
        Removed some old types
      storage/myisam/sp_key.c:
        Removed some old types
      storage/myisammrg/ha_myisammrg.cc:
        Removed some old types
      storage/myisammrg/ha_myisammrg.h:
        Removed some old types
      storage/myisammrg/myrg_close.c:
        Removed some old types
      storage/myisammrg/myrg_def.h:
        Removed some old types
      storage/myisammrg/myrg_delete.c:
        Removed some old types
      storage/myisammrg/myrg_open.c:
        Removed some old types
        Updated parameters to dirname_part()
      storage/myisammrg/myrg_queue.c:
        Removed some old types
      storage/myisammrg/myrg_rfirst.c:
        Removed some old types
      storage/myisammrg/myrg_rkey.c:
        Removed some old types
      storage/myisammrg/myrg_rlast.c:
        Removed some old types
      storage/myisammrg/myrg_rnext.c:
        Removed some old types
      storage/myisammrg/myrg_rnext_same.c:
        Removed some old types
      storage/myisammrg/myrg_rprev.c:
        Removed some old types
      storage/myisammrg/myrg_rrnd.c:
        Removed some old types
      storage/myisammrg/myrg_rsame.c:
        Removed some old types
      storage/myisammrg/myrg_update.c:
        Removed some old types
      storage/myisammrg/myrg_write.c:
        Removed some old types
      storage/ndb/include/util/ndb_opts.h:
        Removed some old types
      storage/ndb/src/cw/cpcd/main.cpp:
        Removed some old types
      storage/ndb/src/kernel/vm/Configuration.cpp:
        Removed some old types
      storage/ndb/src/mgmclient/main.cpp:
        Removed some old types
      storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
        Removed some old types
        Removed old disabled code
      storage/ndb/src/mgmsrv/main.cpp:
        Removed some old types
      storage/ndb/src/ndbapi/NdbBlob.cpp:
        Removed some old types
      storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
        Removed not used variable
      storage/ndb/src/ndbapi/NdbOperationInt.cpp:
        Added required casts
      storage/ndb/src/ndbapi/NdbScanOperation.cpp:
        Added required casts
      storage/ndb/tools/delete_all.cpp:
        Removed some old types
      storage/ndb/tools/desc.cpp:
        Removed some old types
      storage/ndb/tools/drop_index.cpp:
        Removed some old types
      storage/ndb/tools/drop_tab.cpp:
        Removed some old types
      storage/ndb/tools/listTables.cpp:
        Removed some old types
      storage/ndb/tools/ndb_config.cpp:
        Removed some old types
      storage/ndb/tools/restore/consumer_restore.cpp:
        Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
      storage/ndb/tools/restore/restore_main.cpp:
        Removed some old types
      storage/ndb/tools/select_all.cpp:
        Removed some old types
      storage/ndb/tools/select_count.cpp:
        Removed some old types
      storage/ndb/tools/waiter.cpp:
        Removed some old types
      strings/bchange.c:
        Changed function to use uchar * and size_t
      strings/bcmp.c:
        Changed function to use uchar * and size_t
      strings/bmove512.c:
        Changed function to use uchar * and size_t
      strings/bmove_upp.c:
        Changed function to use uchar * and size_t
      strings/ctype-big5.c:
        Changed functions to use size_t
        Changed character length functions to return uint
      strings/ctype-bin.c:
        Changed functions to use size_t
      strings/ctype-cp932.c:
        Changed functions to use size_t
        Changed character length functions to return uint
      strings/ctype-czech.c:
        Fixed indentation
        Changed functions to use size_t
      strings/ctype-euc_kr.c:
        Changed functions to use size_t
        Changed character length functions to return uint
      strings/ctype-eucjpms.c:
        Changed functions to use size_t
        Changed character length functions to return uint
        unsigned char -> uchar
      strings/ctype-gb2312.c:
        Changed functions to use size_t
        Changed character length functions to return uint
      strings/ctype-gbk.c:
        Changed functions to use size_t
        Changed character length functions to return uint
      strings/ctype-latin1.c:
        Changed functions to use size_t
        Changed character length functions to return uint
        unsigned char -> uchar
      strings/ctype-mb.c:
        Changed functions to use size_t
        Changed character length functions to return uint
      strings/ctype-simple.c:
        Changed functions to use size_t
        Simpler loops for caseup/casedown
        unsigned int -> uint
        unsigned char -> uchar
      strings/ctype-sjis.c:
        Changed functions to use size_t
        Changed character length functions to return uint
      strings/ctype-tis620.c:
        Changed functions to use size_t
        Changed character length functions to return uint
        unsigned char -> uchar
      strings/ctype-uca.c:
        Changed functions to use size_t
        unsigned char -> uchar
      strings/ctype-ucs2.c:
        Moved inclusion of stdarg.h to other includes
        usigned char -> uchar
        Changed functions to use size_t
        Changed character length functions to return uint
      strings/ctype-ujis.c:
        Changed functions to use size_t
        Changed character length functions to return uint
        unsigned char -> uchar
      strings/ctype-utf8.c:
        Changed functions to use size_t
        unsigned char -> uchar
        Indentation fixes
      strings/ctype-win1250ch.c:
        Indentation fixes
        Changed functions to use size_t
      strings/ctype.c:
        Changed functions to use size_t
      strings/decimal.c:
        Changed type for memory argument to uchar *
      strings/do_ctype.c:
        Indentation fixes
      strings/my_strtoll10.c:
        unsigned char -> uchar
      strings/my_vsnprintf.c:
        Changed functions to use size_t
      strings/r_strinstr.c:
        Removed some old types
        Changed functions to use size_t
      strings/str_test.c:
        Removed some old types
      strings/strappend.c:
        Changed functions to use size_t
      strings/strcont.c:
        Removed some old types
      strings/strfill.c:
        Removed some old types
      strings/strinstr.c:
        Changed functions to use size_t
      strings/strlen.c:
        Changed functions to use size_t
      strings/strmake.c:
        Changed functions to use size_t
      strings/strnlen.c:
        Changed functions to use size_t
      strings/strnmov.c:
        Changed functions to use size_t
      strings/strto.c:
        unsigned char -> uchar
      strings/strtod.c:
        Changed functions to use size_t
      strings/strxnmov.c:
        Changed functions to use size_t
      strings/xml.c:
        Changed functions to use size_t
        Indentation fixes
      tests/mysql_client_test.c:
        Removed some old types
      tests/thread_test.c:
        Removed some old types
      vio/test-ssl.c:
        Removed some old types
      vio/test-sslclient.c:
        Removed some old types
      vio/test-sslserver.c:
        Removed some old types
      vio/vio.c:
        Removed some old types
      vio/vio_priv.h:
        Removed some old types
        Changed vio_read()/vio_write() to work with size_t
      vio/viosocket.c:
        Changed vio_read()/vio_write() to work with size_t
        Indentation fixes
      vio/viossl.c:
        Changed vio_read()/vio_write() to work with size_t
        Indentation fixes
      vio/viosslfactories.c:
        Removed some old types
      vio/viotest-ssl.c:
        Removed some old types
      win/README:
        More explanations
      f252f924
  38. 08 May, 2007 2 commits
    • unknown's avatar
      Bug#27670: LOAD DATA does not set CURRENT_TIMESTAMP default value for a · 80788a34
      unknown authored
      TIMESTAMP field when no value has been provided.
      
      The LOAD DATA sets the current time in the TIMESTAMP field with
      CURRENT_TIMESTAMP default value when the field is detected as a null.
      But when the LOAD DATA command loads data from a file that doesn't contain
      enough data for all fields then the rest of fields are simply set to null
      without any check. This leads to no value being inserted to such TIMESTAMP
      field.
      
      Now the read_sep_field() and the read_fixed_length() functions set current
      time to the TIMESTAMP field with CURRENT_TIMESTAMP default value in all cases
      when a NULL value is loaded to the field.
      
      
      mysql-test/t/loaddata.test:
        Added a test case for the bug#27670: LOAD DATA does not set CURRENT_TIMESTAMP
        default value for a TIMESTAMP field when no value has been provided.
      mysql-test/r/loaddata.result:
        Added a test case for the bug#27670: LOAD DATA does not set CURRENT_TIMESTAMP
        default value for a TIMESTAMP field when no value has been provided.
      sql/sql_load.cc:
        Bug#27670: LOAD DATA does not set CURRENT_TIMESTAMP default value for a
        TIMESTAMP field when no value has been provided.
        Now the read_sep_field() and the read_fixed_length() functions set current
        time to the TIMESTAMP field with CURRENT_TIMESTAMP default value in all cases
        when a NULL value is loaded to the field.
      80788a34
    • unknown's avatar
      BUG#17233 : LOAD DATA INFILE: failure causes mysqld dbug_assert, binlog not flushed · f508249f
      unknown authored
      This patch corrects a bug involving a LOAD DATA INFILE operation on a 
      transactional table. It corrects a problem in the error handler by moving
      the transactional table check and autocommit_or_rollback operation to the 
      end of the error handler. 
      
      The problem was an assert was thrown after the operation completed. The 
      assert found a non-sunk event in the transaction cache. The events in the 
      transaction cache were added after commit_or_rollack and thereafter nothing 
      removed them.
      
      An additional test case was added to detect this
      condition.
      
      
      mysql-test/extra/rpl_tests/rpl_loaddata.test:
        BUG#17233 : LOAD DATA INFILE: failure causes mysqld dbug_assert, binlog not flushed 
            
        This patch adds an additional test to rpl_loaddata for handling the
        duplicate key error on LOAD DATA INFILE.
      mysql-test/r/rpl_loaddata.result:
        BUG#17233 : LOAD DATA INFILE: failure causes mysqld dbug_assert, binlog not flushed 
            
        This patch adds the results for the additional test for properly handling the
        duplicate key error on LOAD DATA INFILE.
      sql/sql_load.cc:
        BUG#17233 : LOAD DATA INFILE: failure causes mysqld dbug_assert, binlog not flushed 
        
        This patch moves the check for a transactional table and rollback in the
        error handler for mysql_load(). The patch moves the transactional table
        check to the end of the error handler matching the implementation for other
        similar operations (see sql_insert).
      f508249f