1. 30 Jul, 2009 2 commits
    • Joerg Bruehe's avatar
      Merge the fix for bug#42213 into 5.0-build. · bdf6ecc4
      Joerg Bruehe authored
      bdf6ecc4
    • Joerg Bruehe's avatar
      Our autoconf function "MYSQL_STACK_DIRECTION" will not work · 53b114c2
      Joerg Bruehe authored
      correctly if the compiler optimizes too clever.
      
      This has happaned on HP-UX 11.23 (IA64) at optimization
      level "+O2", causing bug#42213:
         Check for "stack overrun" doesn't work, server crashes
      
      Fix it by adding a pragma that prevents this optimization.
      As a result, it should be safe to use "+O2" on this platform
      (unless there is some other, optimizer-related, bug which
      is just currently masked because we use resudec optimization).
      
      
      config/ac-macros/misc.m4:
        Our autoconf function "MYSQL_STACK_DIRECTION" is meant to
        determine whether the stack grows towards higher or towards
        lower addresses.
        It does this by comparing the addresses of a variable
        (which is local to a recursive function) on different
        nesting levels.
        
        This approach requires that the function is really
        implemented as a recursive function, with each nested call
        allocating a new stack frame containing the local variable.
        If, however, the compiler is optimizing so clever that the
        recursive function is implemented by a loop, then this
        test will not produce correct results.
        
        This has happened on HP-UX 11.23 (IA64) when HP's compiler
        was called with optimization "+O2" (not with "+O1"),
        reported as bug#42213.
        
        Rather than starting a race with the compiler and making
        the function so complicated that this optimization does
        not happen, the idea is to prevent the optimization
        by adding a pragma. For HP, this is "#pragma noinline".
        
        If we encounter other compilers which also optimize
        too clever, we may add their pragmas here.
        
        It is a debatable issue whether such pragmas should be
        guarded by conditional compiling or not, the reviewers
        voted to do it.
        It seems HP has different compilers, "ANSI C" and "aCC",
        on the affected platform "__HP_cc" ("ANSI C") is predefined.
        To be on the safe side, the pragma will also take effect
        if HP's "aCC" compiler is used, or any other compiler on HP-UX.
      53b114c2
  2. 21 Jul, 2009 1 commit
  3. 16 Jul, 2009 1 commit
  4. 13 Jul, 2009 2 commits
  5. 10 Jul, 2009 4 commits
  6. 09 Jul, 2009 1 commit
  7. 07 Jul, 2009 2 commits
  8. 06 Jul, 2009 7 commits
  9. 03 Jul, 2009 4 commits
  10. 02 Jul, 2009 1 commit
  11. 01 Jul, 2009 1 commit
    • Staale Smedseng's avatar
      Bug #45790 Potential DoS vector: Writing of user input to log · b3cedc24
      Staale Smedseng authored
      without proper formatting
            
      The problem is that a suitably crafted database identifier
      supplied to COM_CREATE_DB or COM_DROP_DB can cause a SIGSEGV,
      and thereby a denial of service. The database name is printed
      to the log without using a format string, so potential
      attackers can control the behavior of my_b_vprintf() by
      supplying their own format string. A CREATE or DROP privilege
      would be required.
            
      This patch supplies a format string to the printing of the
      database name. A test case is added to mysql_client_test.
      
      
      sql/sql_parse.cc:
        Added format strings.
      tests/mysql_client_test.c:
        Added new test case.
      b3cedc24
  12. 29 Jun, 2009 2 commits
  13. 26 Jun, 2009 2 commits
    • Alexey Kopytov's avatar
      Automerge. · 359bfc13
      Alexey Kopytov authored
      359bfc13
    • Joerg Bruehe's avatar
      This is a fix for bug#37808 · 0e9c86f5
      Joerg Bruehe authored
         "make_binary_distribution" does not always generate correct names
      
      Originally, we solved deficiencies of the predefined "autoconf" macros
      (at least on OS X 10.5, they do not correctly differ between "x86" and
      "x86_64") by providing explicit "--platform" arguments.
      
      With this patch, "make_binary_distribution" evaluates CFLAGS, so it
      "just works" because CFLAGS contains information about the target CPU.
      
      This patch is accompanied by a change in our build tools that drops the
      setting of "--platform" arguments.
      
      scripts/make_binary_distribution.sh:
        This is a fix for bug#37808
           "make_binary_distribution" does not always generate correct names
        
        Our platform names are the combination of operating system, architecture (CPU),
        and a possible suffix (typically "64bit", if a CPU is available in 32 bit too).
        We get these values from some predefined "autoconf" macros.
        
        However, these macros are not perfect, especially on OS X 10.5 they do not
        differ correctly between x86 (32 bit) and x86_64 (64 bit).
        Originally, we solved that by providing an explicit "--platform" argument,
        but it is better to get rid of that and ensure the script "just works".
        
        The best indication we have about the CPU is the "CFLAGS" value provided
        with "configure" and used in "make": It describes for which CPU the
        binaries are generated, not just which one was running the build.
        This approach should work even if we implement cross-compilation.
        
        So this patch evaluates CFLAGS and extracts its "-arch XYZ" part.
        
        When touching the file, I also replaced some tab characters by blanks.
      0e9c86f5
  14. 25 Jun, 2009 2 commits
    • Satya B's avatar
      Applying InnoDB snashot 5.0-ss5406, part 2. Fixes BUG#40565 · e621fd77
      Satya B authored
      BUG#40565 - Update Query Results in "1 Row Affected" But Should Be "Zero Rows"
      
      Detailed revision comments:
      
      r5232 | marko | 2009-06-03 14:31:04 +0300 (Wed, 03 Jun 2009) | 21 lines
      branches/5.0: Merge r3590 from branches/5.1 in order to fix Bug #40565
      (Update Query Results in "1 Row Affected" But Should Be "Zero Rows").
      
      Also, add a test case for Bug #40565.
      
      rb://128 approved by Heikki Tuuri
        ------------------------------------------------------------------------
        r3590 | marko | 2008-12-18 15:33:36 +0200 (Thu, 18 Dec 2008) | 11 lines
      
        branches/5.1: When converting a record to MySQL format, copy the default
        column values for columns that are SQL NULL.  This addresses failures in
        row-based replication (Bug #39648).
      
        row_prebuilt_t: Add default_rec, for the default values of the columns in
        MySQL format.
      
        row_sel_store_mysql_rec(): Use prebuilt->default_rec instead of
        padding columns.
      
        rb://64 approved by Heikki Tuuri
        ------------------------------------------------------------------------
      e621fd77
    • Satya B's avatar
      Applying InnoDB snashot 5.0-ss5406, part 1. Fixes BUG#38479 · 0ed00852
      Satya B authored
      BUG#38479 - valgrind warnings in show table status for innodb tables
      
      Detailed revision comments:
      
      r5080 | vasil | 2009-05-22 14:45:34 +0300 (Fri, 22 May 2009) | 6 lines
      branches/5.0:
      
      Fix Bug#38479 valgrind warnings in show table status for innodb tables
      
      by initializing prebuilt->hint_need_to_fetch_extra_cols.
      
      0ed00852
  15. 22 Jun, 2009 1 commit
  16. 19 Jun, 2009 6 commits
    • Matthias Leich's avatar
      48fdae56
    • Matthias Leich's avatar
    • Matthias Leich's avatar
      Fix for Bug#40545, Bug#40209, Bug#40618, Bug#38346 · 7578ce33
      Matthias Leich authored
        Details:
        - Limit the queries to character sets and collations
          which are most probably available in all build types.
          But try to preserve the intention of the tests.
        - Remove the variants adjusted to some build types.
      
        Note:
        1. The results of the review by Bar are included.
        2. I am not able to check the correctness of this patch
           on any existing build type and any MySQL version.
           So it could happen that the new test fails somewhere.
      7578ce33
    • Georgi Kodinov's avatar
      Bug #36654: mysqld_multi cannot start instances with different versions · e54a05f5
      Georgi Kodinov authored
      occasionally.
      
      mysql_multi can call mysqld_safe. In doing this it's not changing the 
      current working directory. This may cause confusion in the case where 
      mysqld_multi is handling instances of servers of different versions 
      and the current working directory is the installation directory of one 
      of these servers.
      
      Fixed by enhancing the meaning of basedir in [mysqldN] sections of 
      mysqld_multi. If specified, mysqld_multi will change the current 
      working directory to the basedir directory before starting the server 
      in mysqld_multi ... start ... and then change it back to what it was.
      
      scripts/mysqld_multi.sh:
        Bug #36654: optionally preserve, change and restore the cwd when 
        starting server instances
      e54a05f5
    • V Narayanan's avatar
      Bug#43572 Handle failures from hash_init · d1ed43c9
      V Narayanan authored
            
      Failure to allocate memory for the hash->array element,
      caused hash_init to return without initializing the other
      members of the hash. Thus although the dynamic array
      buffer may be allocated at a later point in the code, the
      incompletely initialized hash caused fatal failures.
      
      This patch moves the initialization of the other members
      of the hash above the array allocation, so that the usage
      of this hash will not result in fatal failures.
      
      include/hash.h:
        Bug#43572 Handle failures from hash_init
        
        hash_inited is used to verify that the hash is
        valid. After the change induced by the current
        patch hash->array.buffer !=0 is not a valid check
        for this condition, since, the dynamic array can
        be allocated even at a later time. Bootstrap SQL
        script is setting some variables, which are
        actually not set due to this hash_inited issue.
        Thus we get empty grant tables.
        
        A better way to check if the hash is valid is
        to verify that hash->blength is greater than 0.
      mysys/hash.c:
        Bug#43572 Handle failures from hash_init
        
        Move the initialization of the other members
        of the hash above the array allocation, so that
        the usage of this hash will not result in fatal
        failures.
      d1ed43c9
    • Staale Smedseng's avatar
      Bug #32223 SETting max_allowed_packet variable · 4fbd8db9
      Staale Smedseng authored
            
      Inconsistent behavior of session variable max_allowed_packet 
      (and net_buffer_length); only assignment to the global variable 
      has any effect, without this being obvious to the user.
            
      The patch for Bug#22891 is backported to 5.0, making the two
      session variables read-only. As this is a backport to GA 
      software, the error used when trying to assign to the read-
      only variable is ER_UNKNOWN_ERROR. The error message is the 
      same as in 5.1+.
      
      mysql-test/t/variables.test:
        Tests are changed to account for the new semantics, and assignment to the read-only variables is added to test 
        the emission of the correct error message.
      sql/set_var.cc:
        Both max_allowed_packet and net_buffer_length are changed 
        to be of type sys_var_thd_ulong_session_readonly. ER_UNKNOWN_ERROR is used to indicate an attempt to assign 
        to an instance of a read-only variable.
      sql/set_var.h:
        Class sys_var_thd_ulong_session_readonly is added.
      4fbd8db9
  17. 18 Jun, 2009 1 commit