1. 12 Dec, 2008 4 commits
    • Gleb Shchepa's avatar
      cd42f4ba
    • Gleb Shchepa's avatar
      Bug #40761: Assert on sum function on · af5cf536
      Gleb Shchepa authored
                  IF(..., CAST(longtext AS UNSIGNED), signed_val)
                  (was: LEFT JOIN on inline view crashes server)
      
      Select from a LONGTEXT column wrapped with an expression
      like "IF(..., CAST(longtext_column AS UNSIGNED), smth_signed)"
      failed an assertion or crashed the server. IFNULL function was
      affected too.
      
      LONGTEXT column item has a maximum length of 32^2-1 bytes,
      at the same time this is a maximum possible length of any
      MySQL item. CAST(longtext_column AS UNSIGNED) returns some
      unsigned numeric result of length 32^2-1, so the result of
      IF/IFNULL function of this number and some other signed number
      will have text length of (32^2-1)+1=32^2 (one byte for the
      minus sign) - there is integer overflow, and the length is
      equal to zero. That caused assert/crash.
      
      CAST AS UNSIGNED function has been modified to limit maximal
      length of resulting number to 67 (maximal length of DECIMAL
      and two characters for minus sign and dot).
      
      
      mysql-test/r/func_if.result:
        Added test case for bug #40761.
      mysql-test/t/func_if.test:
        Added test case for bug #40761.
      sql/item_func.h:
        Bug #40761: Assert on sum function on
                    IF(..., CAST(longtext AS UNSIGNED), signed_val)
        
        CAST AS UNSIGNED function has been modified to limit maximal
        length of resulting number to 67 (maximal length of DECIMAL
        and two characters for minus sign and dot).
      af5cf536
    • Gleb Shchepa's avatar
      rollback of bug #40761 fix · 74984768
      Gleb Shchepa authored
      74984768
    • Gleb Shchepa's avatar
      rollback of bug #40761 fix · 5ff1bcbc
      Gleb Shchepa authored
      5ff1bcbc
  2. 11 Dec, 2008 10 commits
    • Gleb Shchepa's avatar
      a4467c97
    • Gleb Shchepa's avatar
      Bug #40761: Assert on sum function on · ffe23f0e
      Gleb Shchepa authored
                  IF(..., CAST(longtext AS UNSIGNED), signed_val)
                  (was: LEFT JOIN on inline view crashes server)
      
      Select from a LONGTEXT column wrapped with an expression
      like "IF(..., CAST(longtext_column AS UNSIGNED), smth_signed)"
      failed an assertion or crashed the server. IFNULL function was
      affected too.
      
      LONGTEXT column item has a maximum length of 32^2-1 bytes,
      at the same time this is a maximum possible length of any
      MySQL item. CAST(longtext_column AS UNSIGNED) returns some
      unsigned numeric result of length 32^2-1, so the result of
      IF/IFNULL function of this number and some other signed number
      will have text length of (32^2-1)+1=32^2 (one byte for the
      minus sign) - there is integer overflow, and the length is
      equal to zero. That caused assert/crash.
      
      The bug has been fixed by the same solution as in the CASE
      function implementation.
      
      
      mysql-test/r/func_if.result:
        Added test case for bug #40761.
      mysql-test/t/func_if.test:
        Added test case for bug #40761.
      sql/item_cmpfunc.cc:
        Bug #40761: Assert on sum function on
                    IF(..., CAST(longtext AS UNSIGNED), signed_val)
        
        1. Item_func_case::agg_str_lengths method has been moved
           to the Item_func superclass.
        2. Item_func_ifnull/Item_func_if::fix_length_and_dec methods
           have been updated to calculate max_length, decimals and
           unsigned flag like Item_func_case.
      sql/item_cmpfunc.h:
        Bug #40761: Assert on sum function on
                    IF(..., CAST(longtext AS UNSIGNED), signed_val)
        
        Item_func_case::agg_str_lengths method has been moved to
        the Item_func superclass.
      sql/item_func.cc:
        Bug #40761: Assert on sum function on
                    IF(..., CAST(longtext AS UNSIGNED), signed_val)
        
        Item_func_case::agg_str_lengths method has been moved to
        the Item_func superclass.
      sql/item_func.h:
        Bug #40761: Assert on sum function on
                    IF(..., CAST(longtext AS UNSIGNED), signed_val)
        
        Item_func_case::agg_str_lengths method has been moved to
        the Item_func superclass.
      ffe23f0e
    • Chad MILLER's avatar
      Merge from bugteam trunk. · 0837c111
      Chad MILLER authored
      0837c111
    • Chad MILLER's avatar
      Merge fix for Bug 33812 from 5.0-bugteam. · a633e0b9
      Chad MILLER authored
      a633e0b9
    • Chad MILLER's avatar
      Bug#33812: mysql client incorrectly parsing DELIMITER · d84690c9
      Chad MILLER authored
      Fix parsing of mysql client commands, especially in relation to
      single-line comments when --comments was specified.
      
      This is a little tricky, because we need to allow single-line
      comments in the middle of statements, but we don't want to allow
      client commands in the middle of statements. So in
      comment-preservation mode, we go ahead and send single-line
      comments to the server immediately when we encounter them on their
      own. 
      
      This is still slightly flawed, in that it does not handle a
      single-line comment with leading spaces, followed by a client-side
      command when --comment has been enabled. But this isn't a new
      problem, and it is quite an edge condition. Fixing it would require
      a more extensive overall of how the mysql client parses commands. 
      d84690c9
    • Luis Soares's avatar
      BUG#38826 · 32c1790b
      Luis Soares authored
      Merge from 5.0-bugteam. Additional fix for unused ret variable warning.
      
      32c1790b
    • Luis Soares's avatar
      Fix PB warnings for parenthesis and valgrind leak report. · ac27e637
      Luis Soares authored
      BUG#38826
      ac27e637
    • Sergey Glukhov's avatar
      5.0-bugteam->5.1-bugteam merge · 54f65ef1
      Sergey Glukhov authored
      54f65ef1
    • Sergey Glukhov's avatar
      fix for pushbuild failure on 64 linux · d2cd545b
      Sergey Glukhov authored
      d2cd545b
    • Sergey Glukhov's avatar
  3. 10 Dec, 2008 18 commits
  4. 09 Dec, 2008 8 commits