1. 20 May, 2011 1 commit
    • Dmitry Shulga's avatar
      Fixed bug#11749345 (formerly bug#38813) - increasing memory consumption · 733893ba
      Dmitry Shulga authored
      when selecting from I_S and views exist, in SP.
      
      Symptoms: re-execution of prepared statement (or statement in a stored
      routine) which read from one of I_S tables and which in order to fill
      this I_S table had to open a view led to increasing memory consumption.
      
      What happened in this situation was that during the process of view
      opening for purpose of I_S filling view-related structures (like its
      LEX) were allocated on persistent MEM_ROOT of prepared statement (or 
      stored routine). Since this MEM_ROOT is not freed until prepared
      statement deallocation (or expulsion of stored routine from the cache)
      and code responsible for filling I_S is not able to re-use results of
      view opening from previous executions this allocation ended up in
      memory hogging.
      
      This patch solves the problem by ensuring that when a view opened
      for the purpose of I_S filling all its structures are allocated on
      non-persistent runtime MEM_ROOT. This is achieved by activating a
      temporary Query_arena bound to this MEM_ROOT.
      Since this step makes impossible linking of view structures into
      LEX of our prepared statement (or stored routine statement) this
      patch also changes code filling I_S table to install a proxy LEX
      before trying to open a view or a table. Consequently some code
      which was responsible for backing-up/restoring parts of LEX when
      view/table was opened during filling of I_S table became redundant
      and was removed.
      
      This patch doesn't contain test case for this bug as it is hard
      to test memory hogging in our test suite.
      733893ba
  2. 19 May, 2011 2 commits
    • Luis Soares's avatar
      BUG#11746302 · d1de97fc
      Luis Soares authored
      Automerge mysql-5.1-gca into latest mysql-5.1.
      d1de97fc
    • Luis Soares's avatar
      BUG#11746302: 25228: RPL_RELAYSPACE.TEST FAILS ON POWERMACG5, · 4f03d600
      Luis Soares authored
                    VM-WIN2003-32-A, SLES10-IA64-A 
            
      The test case waits for master_pos_wait not to timeout, which
      means that the deadlock between SQL and IO threads was 
      succesfully and automatically dealt with.
            
      However, very rarely, master_pos_wait reports a timeout. This
      happens because the time set for master_pos_wait to wait was
      too small (6 seconds). On slow test env this could be a 
      problem.
            
      We fix this by setting the timeout inline with the one used
      in sync_slave_with_master (300 seconds). In addition we 
      refactored the test case and refined some comments.
      4f03d600
  3. 18 May, 2011 2 commits
    • Mayank Prasad's avatar
      Bug#11764633 : 57491: THD->MAIN_DA.IS_OK() ASSERT IN EMBEDDED · d608ad2d
      Mayank Prasad authored
      Issue:
      While running embedded server, if client issues TEE command (\T foo/bar) and
      "foo/bar" directory doesn't exist, it is suppose to give error. But it was
      aborting.  This was happening because wrong error handler was being called.
      
      Solution:
      Modified calls to correct error handler. In embedded server case, there are 
      two error handler (client and server) which are supposed to be called based 
      on which context code is in. If it is in client context, client error handler
      should be called otherwise server.
      
      Test case:
      Test case automation is not possible as current (following) code doesn't 
      allow '\T' to be executed from command line (OR command read from a file):
      [client/mysql.cc]
      ...
       static int
       com_tee(String *buffer __attribute__((unused)),
               char *line __attribute__((unused)))
       {
         char file_name[FN_REFLEN], *end, *param;
      
         if (status.batch) << THIS IS TRUE WHILE EXECUTING FROM COMMAND LINE.
            return 0;
       ...
      So, not adding test case in GA. WIll add a test case in mysql-trunk after 
      removing above code so that this could be properly tested before GA.
      
      libmysqld/lib_sql.cc:
        Added code to call client/server error handler based on in control is in 
        client/server code respectively.
      sql/mysql_priv.h:
        Added comments for THR_THD, THR_MALLOC keys.
      sql/sql_class.cc:
        Function definition of new function restore_global to removes thread specific 
        data from stack (which was stored in store global).
      sql/sql_class.h:
        Function declaration of new function restore_global.
      d608ad2d
    • Sergey Glukhov's avatar
      Bug#12403504 AFTER FIX FOR #11889186 : ASSERTION FAILED: DELSUM+(INT) Y/4-TEMP > 0 · 3201f92c
      Sergey Glukhov authored
      There are two problems:
      1. There is a missing check for 'year' parameter(year can not be greater than 9999) in
         makedate function. fix: added check that year can not be greater than 9999.
      2. There is a missing check for zero date in from_days() function.
         fix: added zero date check into Item_func_from_days::get_date()
         function.
      
      
      mysql-test/r/func_time.result:
        test case
      mysql-test/t/func_time.test:
        test case
      sql/item_timefunc.cc:
        --added check that year can not be greater than 9999 for makedate() function
        --added zero date check into Item_func_from_days::get_date() function
      3201f92c
  4. 14 May, 2011 1 commit
  5. 13 May, 2011 1 commit
  6. 12 May, 2011 3 commits
  7. 10 May, 2011 2 commits
  8. 09 May, 2011 1 commit
    • Serge Kozlov's avatar
      WL#5867 · 79e4b561
      Serge Kozlov authored
      Replaced the error code by error name
      79e4b561
  9. 06 May, 2011 2 commits
  10. 05 May, 2011 4 commits
    • Luis Soares's avatar
      BUG#12354268 · 902e64da
      Luis Soares authored
      Automerged bzr bundle from bug report:
      luis.soares@oracle.com-20110505224815-6ob90n7suxsoizvs.bundle
      902e64da
    • Luis Soares's avatar
      BUG#11762616: BUG#55229: 'POSTION' · 8a08fd43
      Luis Soares authored
                  
      Fix for all "postion" in Oracle files (s/postion/position). 
      Updated the copyright notices where needed.
      8a08fd43
    • Luis Soares's avatar
      BUG#12354268: MYSQLBINLOG --BASE64-OUTPUT=DECODE-ROWS DOES NOT · 0efb452e
      Luis Soares authored
      WORK WITH --START-POSITION
            
      If setting --start-position to start after the FD event, mysqlbinlog
      will output an error stating that it has not found an FD event.
      However, its not that mysqlbinlog does not find it but rather that it
      does not processes it in the regular way (i.e., it does not print it).
      Given that one is using --base64-output=DECODE-ROWS then not printing
      it is actually fine.
            
      To fix this, we make mysqlbinlog not to complain when it has not
      printed the FD event, is outputing in base64, but is decoding the
      rows.
      0efb452e
    • Tatiana Azundris Nurnberg's avatar
  11. 04 May, 2011 1 commit
    • Alexander Nozdrin's avatar
      Patch for Bug#12394306: the sever may crash if mysql.event is corrupted. · 16f26d2a
      Alexander Nozdrin authored
      The problem was that wrong structure of mysql.event was not detected and
      the server continued to use wrongly-structured data.
      
      The fix is to check the structure of mysql.event after opening before
      any use. That makes operations with events more strict -- some operations
      that might work before throw errors now. That seems to be Ok.
      
      Another side-effect of the patch is that if mysql.event is corrupted,
      unrelated DROP DATABASE statements issue an SQL warning about inability
      to open mysql.event table. 
      16f26d2a
  12. 03 May, 2011 2 commits
  13. 02 May, 2011 1 commit
  14. 29 Apr, 2011 5 commits
    • Nirbhay Choubey's avatar
      Bug#11757855 - 49967: built-in libedit doesn't read · 8843aea7
      Nirbhay Choubey authored
                            .editrc on linux.
      
      MySQL client when build with libedit support ignores
      .editrc at startup.
      
      The reason for this regression was the incluison of a
      safety check, issetugid(), which is not available on
      some linux platforms.
      
      Fixed by adding an equivalent check for platforms which
      have get[e][u|g]id() set of functions.
      
      
      cmd-line-utils/libedit/el.c:
        Bug#11757855 - 49967: built-in libedit doesn't read
                              .editrc on linux.
        
        Added function calls to check user/group IDs on linux
        systems which does not have issetugid() function.
      configure.in:
        Bug#11757855 - 49967: built-in libedit doesn't read
                              .editrc on linux.
        
        Added check for getuid, geteuid, getgid, getegid
        functions.
      8843aea7
    • Bjorn Munch's avatar
      merge from 5.1-mtr · 1e7b79a5
      Bjorn Munch authored
      1e7b79a5
    • Vasil Dimov's avatar
      Sync 5.1 .inc file with 5.5 due to a missing changeset · 6f7d0f18
      Vasil Dimov authored
      Add extra codes to wait_until_disconnected.inc that are present in 5.5,
      but not in 5.1. The missing codes cause innodb_bug59641 to fail in 5.1 on
      Windows PB2 runs. The addition of those codes in 5.5 was done in
      luis.soares@sun.com-20090930233215-aup3kxy4j6ltvjfp
      6f7d0f18
    • Bjorn Munch's avatar
      merge from 5.1 main · 0e1819a4
      Bjorn Munch authored
      0e1819a4
    • Mattias Jonsson's avatar
      removed dead obsolete code · 54c1da00
      Mattias Jonsson authored
      54c1da00
  15. 27 Apr, 2011 3 commits
    • Mattias Jonsson's avatar
      Post push fix for bug#11766249 bug#59316 · 401941c2
      Mattias Jonsson authored
      Partitions can have different ref_length (position data length).
      Removed DBUG_ASSERT which crashed debug builds when using
      MAX_ROWS on some partitions.
      401941c2
    • Nirbhay Choubey's avatar
      BUG#12329909 - BUILDING MYSQL WITH DEBUG SUPPORT · a1f7ceb2
      Nirbhay Choubey authored
                     FAILS WITH LIBEDIT
      
      Fixed by checking the return value of the write()
      function calls and handling the open files and fd
      appropriately.
      
      
      cmd-line-utils/libedit/vi.c:
        BUG#12329909 - BUILDING MYSQL WITH DEBUG SUPPORT
                       FAILS WITH LIBEDIT
        
        Added a check on the return value of the write()
        function calls.
      a1f7ceb2
    • Sergey Glukhov's avatar
      Bug#11889186 60503: CRASH IN MAKE_DATE_TIME WITH DATE_FORMAT / STR_TO_DATE COMBINATION · a60c39a2
      Sergey Glukhov authored
      calc_daynr() function returns negative result
      if malformed date with zero year and month is used.
      Attempt to calculate week day on negative value
      leads to crash. The fix is return NULL for
      'W', 'a', 'w' specifiers if zero year and month is used.
      Additional fix for calc_daynr():
      --added assertion that result can not be negative
      --return 0 if zero year and month is used
      
      
      mysql-test/r/func_time.result:
        test case
      mysql-test/t/func_time.test:
        test case
      sql-common/my_time.c:
        --added assertion that result can not be negative
        --return 0 if zero year and month is used
      sql/item_timefunc.cc:
        eturn NULL for 'W', 'a', 'w' specifiers
        if zero year and month is used.
      a60c39a2
  16. 26 Apr, 2011 3 commits
  17. 25 Apr, 2011 1 commit
  18. 23 Apr, 2011 1 commit
  19. 22 Apr, 2011 1 commit
    • Sergey Glukhov's avatar
      Bug#11756928 48916: SERVER INCORRECTLY PROCESSING HAVING CLAUSES WITH AN ORDER BY CLAUSE · a5e8d902
      Sergey Glukhov authored
      Before sorting HAVING condition is split into two parts,
      first part is a table related condition and the rest of is
      HAVING part. Extraction of HAVING part does not take into account
      the fact that some of conditions might be non-const but
      have 'used_tables' == 0 (independent subqueries)
      and because of that these conditions are cut off by
      make_cond_for_table() function.
      The fix is to use (table_map) 0 instead of used_tables in
      third argument for make_cond_for_table() function.
      It allows to extract elements which belong to sorted
      table and in addition elements which are independend
      subqueries.
      
      
      mysql-test/r/having.result:
        test case
      mysql-test/t/having.test:
        test case
      sql/sql_select.cc:
        The fix is to use (table_map) 0 instead of used_tables in
        third argument for make_cond_for_table() function.
        It allows to extract elements which belong to sorted
        table and in addition elements which are independend
        subqueries.
      a5e8d902
  20. 21 Apr, 2011 1 commit
  21. 20 Apr, 2011 2 commits