1. 05 Jul, 2012 2 commits
    • Georgi Kodinov's avatar
      fixed a missing break · fb3e11d0
      Georgi Kodinov authored
      fb3e11d0
    • Georgi Kodinov's avatar
      Bug #12998841: libmysql divulges plaintext password upon request in 5.5 · 06f6e4fe
      Georgi Kodinov authored
      1. Clear text password client plugin disabled by default.
      2. Added an environment variable LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN, that
      when set to something starting with '1', 'Y' or 'y' will enable the clear
      text
      plugin for all connections.
      3. Added a new mysql_options() option : MYSQL_ENABLE_CLEARTEXT_PLUGIN
      that takes an my_bool argument. When the value of the argument is non-zero
      the clear text plugin is enabled for this connection only.
      4. Added an enable-cleartext-plugin config file option that takes a numeric
      
      argument. If the numeric value of the numeric argument is non-zero the
      clear
      text plugin is enabled for the connection
      5. Added a boolean command line option "--enable_cleartext_plugin" to
      mysql, mysqlslap and mysqladmin. When specified it will call mysql_options
      with the effect of #3
      6. Added a new CLEARTEXT option to the connect command in mysqltest.
      When specified it will enable the cleartext plugin for usage.
      7. Added test cases and updated existing ones that need the clear text
      plugin.
      06f6e4fe
  2. 04 Jul, 2012 1 commit
    • Georgi Kodinov's avatar
      Bug #11753490: 44939: sql dumps containing broad views fail when · 9ce35ffc
      Georgi Kodinov authored
      executing
      
      The problem is that mysql lacks information about the objects a view
      depends on so it can't dump views and tables in the proper order.
      Thus it needs to create "stand-in" myisam tables for each view while 
      dumping the tables that it later drops and replaces with the actual view
      view definition.
      But since views can have much more columns than an actual table creating
      these stand-in tables may be problematic.
      
      There's no way to portably find out how many columns an mysiam table
      can have. It's a complicated formula depending on internal server constants.
      Thus we can't have a reliable error check without repeating the logic and 
      the formula inside mysqldump.
      
      1. Changed the type of the columns of the stand-in tables mysqldump
      makes to satisfy view dependencies from the original type to smallint 
      to save on row space.
      
      2. Added a warning on the mysqldump's standard error for a possible 
      problems replaying the dump file if the columns of a view exceed 1000.
      
      3. Added a test case.
      9ce35ffc
  3. 03 Jul, 2012 3 commits
    • Rohit Kalhans's avatar
      upmerge from mysql-5.1 to mysql-5.5 · 77c599eb
      Rohit Kalhans authored
      77c599eb
    • Rohit Kalhans's avatar
      BUG#11762667:MYSQLBINLOG IGNORES ERRORS WHILE WRITING OUTPUT · 91c8e79f
      Rohit Kalhans authored
      This is a followup patch for the bug enabling the test
      i_binlog.binlog_mysqlbinlog_file_write.test
      this was disabled in mysql trunk and mysql 5.5 as in the release
      build mysqlbinlog was not debug compiled whereas the mysqld was.
      Since have_debug.inc script checks only for mysqld to be debug
      compiled, the test was not being skipped on release builds.
      
      We resolve this problem by creating a new inc file 
      mysqlbinlog_have_debug.inc which checks exclusively for mysqlbinlog
      to be debug compiled. if not it skips the test.
       
      
      mysql-test/include/mysqlbinlog_have_debug.inc:
        new inc file to check if mysqlbinlog is debug compiled.
      91c8e79f
    • Mayank Prasad's avatar
      Bug#13417440 : 63340: ARCHIVE FILE IO NOT INSTRUMENTED · 608c2c01
      Mayank Prasad authored
      Details:
       - Modified test case to make sure its run for all and not only
         for archive Storage Engine.
      608c2c01
  4. 29 Jun, 2012 8 commits
  5. 28 Jun, 2012 5 commits
    • Georgi Kodinov's avatar
      Bug #13708485: malformed resultset packet crashes client · 107c894a
      Georgi Kodinov authored
      Several fixes :
      
      * sql-common/client.c
      Added a validity check of the fields metadata packet sent 
      by the server.
      Now libmysql will check if the length of the data sent by
      the server matches what's expected by the protocol before
      using the data.
      
      * client/mysqltest.cc
      Fixed the error handling code in mysqltest to avoid sending
      new commands when the reading the result set failed (and 
      there are unread data in the pipe).
      
      * sql_common.h + libmysql/libmysql.c + sql-common/client.c
      unpack_fields() now generates a proper error when it fails.
      Added a new argument to this function to support the error 
      generation.
      
      * sql/protocol.cc
      Added a debug trigger to cause the server to send a NULL
      insted of the packet expected by the client for testing 
      purposes.
      107c894a
    • Evgeny Potemkin's avatar
      Bug#14248833: UPDATE ON INNODB TABLE ENTERS RECURSION · 24726234
      Evgeny Potemkin authored
      Introduction of cost based decision on filesort vs index for UPDATE
      statements changed detection of the fact that the index used to scan the
      table is being updated. The new design missed the case of index merge
      when there is no single index to check. That was worked until a recent
      change in InnoDB after which it went into infinite recursion if update of
      the used index wasn't properly detected.
      
      The fix consists of 'used key being updated' detection code from 5.1.
      
      sql/sql_update.cc:
        Bug#14248833: UPDATE ON INNODB TABLE ENTERS RECURSION
        The check for used key being updated is extended to cover the case when
        index merge is used.
      24726234
    • Norvald H. Ryeng's avatar
      Null merge 5.1->5.5. · 970da4bd
      Norvald H. Ryeng authored
      970da4bd
    • Norvald H. Ryeng's avatar
      Merge. · 07a17e30
      Norvald H. Ryeng authored
      07a17e30
    • Norvald H. Ryeng's avatar
      Merge · 2b91121e
      Norvald H. Ryeng authored
      2b91121e
  6. 19 Jun, 2012 2 commits
  7. 18 Jun, 2012 2 commits
    • Norvald H. Ryeng's avatar
      Merge 5.1->5.5. · fc3c4e70
      Norvald H. Ryeng authored
      fc3c4e70
    • Norvald H. Ryeng's avatar
      Bug#13003736 CRASH IN ITEM_REF::WALK WITH SUBQUERIES · cac1cd88
      Norvald H. Ryeng authored
      Problem: Some queries with subqueries and a HAVING clause that
      consists only of a column not in the select or grouping lists causes
      the server to crash.
      
      During parsing, an Item_ref is constructed for the HAVING column. The
      name of the column is resolved when JOIN::prepare calls fix_fields()
      on its having clause. Since the column is not mentioned in the select
      or grouping lists, a ref pointer is not found and a new Item_field is
      created instead. The Item_ref is replaced by the Item_field in the
      tree of HAVING clauses. Since the tree consists only of this item, the
      pointer that is updated is JOIN::having. However,
      st_select_lex::having still points to the Item_ref as the root of the
      tree of HAVING clauses.
      
      The bug is triggered when doing filesort for create_sort_index(). When
      find_all_keys() calls select->cond->walk() it eventually reaches
      Item_subselect::walk() where it continues to walk the having clauses
      from lex->having. This means that it finds the Item_ref instead of the
      new Item_field, and Item_ref::walk() tries to dereference the ref
      pointer, which is still null.
      
      The crash is reproducible only in 5.5, but the problem lies latent in
      5.1 and trunk as well.
      
      Fix: After calling fix_fields on the having clause in JOIN::prepare(),
      set select_lex::having to point to the same item as JOIN::having.
      
      This patch also fixes a bug in 5.1 and 5.5 that is triggered if the
      query is executed as a prepared statement. The Item_field is created
      in the runtime arena when the query is prepared, and the pointer to
      the item is saved by st_select_lex::fix_prepare_information() and
      brought back as a dangling pointer when the query is executed, after
      the runtime arena has been reclaimed.
      
      Fix: Backport fix from trunk that switches to the permanent arena
      before calling Item_ref::fix_fields() in JOIN::prepare().
      
      
      sql/item.cc:
        Set context when creating Item_field.
      sql/sql_select.cc:
        Switch to permanent arena and update select_lex->having.
      cac1cd88
  8. 15 Jun, 2012 2 commits
  9. 14 Jun, 2012 2 commits
  10. 13 Jun, 2012 3 commits
  11. 12 Jun, 2012 3 commits
    • Jon Olav Hauglid's avatar
      Bug#13586591 RQG GRAMMAR CONF/ENGINES/ENGINE_STRESS.YY · 6094d190
      Jon Olav Hauglid authored
                   CRASHES INNODB | TRX_STATE_NOT_STARTED
      
      The problem was that if DELETE with subselect caused a
      deadlock inside InnoDB, this deadlock was not properly
      handled by the SQL layer. This meant that the SQL layer
      would try to unlock the row after InnoDB had rolled
      back the transaction. This caused an assertion inside
      InnoDB.
      
      This patch fixes the problem by checking for errors
      reported by SQL_SELECT::skip_record() and not calling
      unlock_row() if any errors have been reported.
      6094d190
    • Manish Kumar's avatar
      BUG#12400221 - 60926: BINARY LOG EVENTS LARGER THAN MAX_ALLOWED_PACKET · db982ec8
      Manish Kumar authored
      Upmerge from mysql-5.1 -> mysql-5.5
      db982ec8
    • Manish Kumar's avatar
      BUG#12400221 - 60926: BINARY LOG EVENTS LARGER THAN MAX_ALLOWED_PACKET · 4a2d65cc
      Manish Kumar authored
      Problem
      ========
                  
      Replication breaks in the cases if the event length exceeds 
      the size of master Dump thread's max_allowed_packet.
                    
      The reason why this failure is occuring is because the event length is
      more than the total size of the max_allowed_packet, on addition of the  
      max_event_header length exceeds the max_allowed_packet of the DUMP thread.
      This causes the Dump thread to break replication and throw an error.
                            
      That can happen e.g with row-based replication in Update_rows event.
                  
      Fix
      ====
                
      The problem is fixed in 2 steps:
      
      1.) The Dump thread limit to read event is increased to the upper limit
          i.e. Dump thread reads whatever gets logged in the binary log.
      
      2.) On the slave side we increase the the max_allowed_packet for the
          slave's threads (IO/SQL) by increasing it to 1GB.
      
          This is done using the new server option (slave_max_allowed_packet)
          included, is used to regulate the max_allowed_packet of the  
          slave thread (IO/SQL) by the DBA, and facilitates the sending of
          large packets from the master to the slave.
      
          This causes the large packets to be received by the slave and apply
          it successfully.
      
      sql/log_event.cc:
        The max_allowed_packet is not evaluated to the new option 
        slave_max_allowed_packet after the fix.
      sql/log_event.h:
        Added the new option in the log_event.h file.
      sql/mysqld.cc:
        Added a new option to the server.
      sql/slave.cc:
        Increasing the session max_allowed_packet to a large value,
        i.e. not taking global(max_allowed) into consideration, for the slave's threads.
      sql/sql_repl.cc:
        The dump thread's max_allowed_packet is set to the upper limit
        which makes it independent and it now reads whatever gets 
        logged in the binary log.
      4a2d65cc
  12. 08 Jun, 2012 1 commit
  13. 07 Jun, 2012 1 commit
    • Narayanan Venkateswaran's avatar
      WL#6161 Integrating with InnoDB codebase in MySQL 5.5 · 164080e4
      Narayanan Venkateswaran authored
            
      Changes in the InnoDB codebase required to compile and
      integrate the MEB codebase with MySQL 5.5.
      
      @ storage/innobase/btr/btr0btr.c
        Excluded buffer pool usage from MEB build.
       
        buf_pool_from_bpage calls are in buf0buf.ic, and
        the buffer pool functions from that file are
        disabled in MEB.
      @ storage/innobase/buf/buf0buf.c
        Disabling more buffer pool functions unused in MEB.
      @ storage/innobase/dict/dict0dict.c
        Disabling dict_ind_free that is unused in MEB.
      @ storage/innobase/dict/dict0mem.c
        The include
      
        #include "ha_prototypes.h"
      
        Was causing conflicts with definitions in my_global.h
      
        Linking C executable mysqlbackup
        libinnodb.a(dict0mem.c.o): In function `dict_mem_foreign_table_name_lookup_set':
        dict0mem.c:(.text+0x91c): undefined reference to `innobase_get_lower_case_table_names'
        libinnodb.a(dict0mem.c.o): In function `dict_mem_referenced_table_name_lookup_set':
        dict0mem.c:(.text+0x9fc): undefined reference to `innobase_get_lower_case_table_names'
        libinnodb.a(dict0mem.c.o): In function `dict_mem_foreign_table_name_lookup_set':
        dict0mem.c:(.text+0x96e): undefined reference to `innobase_casedn_str'
        libinnodb.a(dict0mem.c.o): In function `dict_mem_referenced_table_name_lookup_set':
        dict0mem.c:(.text+0xa4e): undefined reference to `innobase_casedn_str'
        collect2: ld returned 1 exit status
        make[2]: *** [mysqlbackup] Error 1
      
        innobase_get_lower_case_table_names
        innobase_casedn_str
        are functions that are part of ha_innodb.cc that is not part of the build
              
        dict_mem_foreign_table_name_lookup_set
        function is not there in the current codebase, meaning we do not use it in MEB.
      @ storage/innobase/fil/fil0fil.c
        The srv_fast_shutdown variable is declared in
        srv0srv.c that is not compiled in the
        mysqlbackup codebase.
      
        This throws an undeclared error.
      
        From the Manual
        ---------------
      
        innodb_fast_shutdown
        --------------------
      
        The InnoDB shutdown mode. The default value is 1
        as of MySQL 3.23.50, which causes a “fast� shutdown
        (the normal type of shutdown). If the value is 0,
        InnoDB does a full purge and an insert buffer merge
        before a shutdown. These operations can take minutes,
        or even hours in extreme cases. If the value is 1,
        InnoDB skips these operations at shutdown.
      
        This ideally does not matter from mysqlbackup
        @ storage/innobase/ha/ha0ha.c
        In file included from /home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/ha/ha0ha.c:34:0:
        /home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/include/btr0sea.h:286:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
        make[2]: *** [CMakeFiles/innodb.dir/home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/ha/ha0ha.c.o] Error 1
        make[1]: *** [CMakeFiles/innodb.dir/all] Error 2
        make: *** [all] Error 2
      
        # include "sync0rw.h" is excluded from hotbackup compilation in dict0dict.h
      
        This causes extern rw_lock_t*	btr_search_latch_temp; to throw a failure because
        the definition of rw_lock_t is not found.
      @ storage/innobase/include/buf0buf.h
        Excluding buffer pool functions that are unused from the
        MEB codebase.
      @ storage/innobase/include/buf0buf.ic
        replicated the exclusion of
      
        #include "buf0flu.h"
        #include "buf0lru.h"
        #include "buf0rea.h"
      
        by looking at the current codebase in <meb-trunk>/src/innodb
        @ storage/innobase/include/dict0dict.h
        dict_table_x_lock_indexes, dict_table_x_unlock_indexes, dict_table_is_corrupted,
        dict_index_is_corrupted, buf_block_buf_fix_inc_func are unused in MEB and was
        leading to compilation errors and hence excluded.
      @ storage/innobase/include/dict0dict.ic
        dict_table_x_lock_indexes, dict_table_x_unlock_indexes, dict_table_is_corrupted,
        dict_index_is_corrupted, buf_block_buf_fix_inc_func are unused in MEB and was
        leading to compilation errors and hence excluded.
      @ storage/innobase/include/log0log.h
        /home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/include/log0log.h: At top level:
        /home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/include/log0log.h:767:2: error: expected specifier-qualifier-list before Ã¢â  ‚¬Ëœmutex_t’
      
        mutex_t definitions were excluded as seen from ambient code
        hence excluding definition for log_flush_order_mutex also.
      @ storage/innobase/include/os0file.h
        Bug in InnoDB code, create_mode should have been create.
      @ storage/innobase/include/srv0srv.h
        In file included from /home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/buf/buf0buf.c:50:0:
        /home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/include/srv0srv.h: At top level:
        /home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/include/srv0srv.h:120:16: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘srv_use_native_aio’
      
        srv_use_native_aio - we do not use native aio of the OS anyway from MEB. MEB does not compile
        InnoDB with this option. Hence disabling it.
      @ storage/innobase/include/trx0sys.h
        [ 56%] Building C object CMakeFiles/innodb.dir/home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/trx/trx0sys.c.o
        /home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/trx/trx0sys.c: In function ‘trx_sys_read_file_format_id’:
        /home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/trx/trx0sys.c:1499:20: error: ‘TRX_SYS_FILE_FORMAT_TAG_MAGIC_N’   undeclared (first use in this function)
        /home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/trx/trx0sys.c:1499:20: note: each undeclared identifier is reported only once for  each function it appears in
        /home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/trx/trx0sys.c: At top level:
        /home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/include/buf0buf.h:607:1: warning: ‘buf_block_buf_fix_inc_func’ declared ‘static’ but never defined
        make[2]: *** [CMakeFiles/innodb.dir/home/narayanan/mysql-server/mysql-5.5-meb-rel3.8-innodb-integration-1/storage/innobase/trx/trx0sys.c.o] Error 1
      
        unused calls excluded to enable compilation
      @ storage/innobase/mem/mem0dbg.c
          excluding #include "ha_prototypes.h" that lead to definitions in ha_innodb.cc
      @ storage/innobase/os/os0file.c
          InnoDB not compiled with aio support from MEB anyway. Hence excluding this from
          the compilation.
      @ storage/innobase/page/page0zip.c
        page0zip.c:(.text+0x4e9e): undefined reference to `buf_pool_from_block'
        collect2: ld returned 1 exit status
      
        buf_pool_from_block defined in buf0buf.ic, most of the file is excluded for compilation of MEB
      @ storage/innobase/ut/ut0dbg.c
        excluding #include "ha_prototypes.h" since it leads to definitions in ha_innodb.cc
        innobase_basename(file) is defined in ha_innodb.cc. Hence excluding that also.
      @ storage/innobase/ut/ut0ut.c
        cal_tm unused from MEB, was leading to earnings, hence disabling for MEB.
      164080e4
  14. 05 Jun, 2012 3 commits
  15. 01 Jun, 2012 2 commits