1. 27 Feb, 2008 2 commits
    • unknown's avatar
      Merge bk@192.168.21.1:mysql-5.0-opt · de47861e
      unknown authored
      into  mysql.com:/home/hf/work/25097/my50-25097
      
      
      libmysql/libmysql.c:
        Auto merged
      libmysqld/lib_sql.cc:
        Auto merged
      sql/log.cc:
        Auto merged
      de47861e
    • unknown's avatar
      Bug #25097 mysql_server_init fails silently if no errmsg.sys is present. · 86260744
      unknown authored
      There was no way to return an error from the client library
      if no MYSQL connections was established.
      So here i added variables to store that king of errors and
      made functions like mysql_error(NULL) to return these.
      
      
      client/mysql.cc:
        Bug #25097 mysql_server_init fails silently if no errmsg.sys is present.
        
        Show the error message on std_error
      include/sql_common.h:
        Bug #25097 mysql_server_init fails silently if no errmsg.sys is present.
        
        cant_connect_sqlstate constant declared
      libmysql/libmysql.c:
        Bug #25097 mysql_server_init fails silently if no errmsg.sys is present.
        
        mysql_sqlstate(NULL) returns 'unknown_sqlstate'
      libmysqld/lib_sql.cc:
        Bug #25097 mysql_server_init fails silently if no errmsg.sys is present.
        
        EMBEDDED_SERVER version of the vprint_msg_to_log() implemented
      sql-common/client.c:
        Bug #25097 mysql_server_init fails silently if no errmsg.sys is present.
        
        mysql_server_last_errno and mysql_server_last_error introduced
        to store errors not related to particular connections.
        
        mysql_error(NULL) and mysql_errno(NULL) now returns these
        mysql_server_last_error and errno respectively
      sql/log.cc:
        Bug #25097 mysql_server_init fails silently if no errmsg.sys is present.
        
        EMBEDDED_LIBRARY implementation of the vprint_msg_to_log() moved
        to lib_sql.cc
      86260744
  2. 26 Feb, 2008 1 commit
  3. 25 Feb, 2008 1 commit
    • unknown's avatar
      Fix for bug #33834: FRAC_SECOND: Applicability not clear in · fe0eafa5
      unknown authored
                          documentation
      
      While the manual mentions FRAC_SECOND only for the TIMESTAMPADD()
      function, it was also possible to use FRAC_SECOND with DATE_ADD(),
      DATE_SUB() and +/- INTERVAL.
      
      Fixed the parser to match the manual, i.e. using FRAC_SECOND for 
      anything other than TIMESTAMPADD()/TIMESTAMPDIFF() now produces a 
      syntax error.
      
      Additionally, the patch allows MICROSECOND to be used in TIMESTAMPADD/
      TIMESTAMPDIFF and marks FRAC_SECOND as deprecated.
      
      
      mysql-test/r/func_time.result:
        Added a test case for bug #33834.
      mysql-test/t/func_time.test:
        Added a test case for bug #33834.
      sql/sql_yacc.yy:
        Reject FRAC_SECOND for anything other than TIMESTAMPADD() or
        TIMESTAMPDIFF().
        Allow MICROSECOND to be used with TIMESTAMPADD()/TIMESTAMPDIFF().
        Warn about FRAC_SECOND being a deprecated unit.
      fe0eafa5
  4. 22 Feb, 2008 5 commits
  5. 20 Feb, 2008 2 commits
    • unknown's avatar
      Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 5c6738db
      unknown authored
      into  moonbone.local:/work/33266-bug-5.0-opt-mysql
      
      5c6738db
    • unknown's avatar
      Bug#33266: Incorrect test case for the bug#31048 failing on some platforms. · f950ec6a
      unknown authored
      The test case for the bug#31048 checks that there is no crash on stack
      overrun. But due to different stack sizes on different platforms it failed
      on some of them.
      
      The new test case check that a query with at least 4 level subquery nesting
      works without the stack overrun nesting and other levels of nesting doesn't
      cause a crash.
      
      
      mysql-test/t/subselect.test:
        Corrected test case for the bug#31048.
      mysql-test/r/subselect.result:
        Corrected test case for the bug#31048.
      f950ec6a
  6. 19 Feb, 2008 1 commit
    • unknown's avatar
      Bug #30604: different flagging of time_zone_used in normal · e719a221
      unknown authored
        and ps-protocol
      Finding a routine should be a transparent operation as 
      far as the binary log is concerned.
      But it was influencing the binary log because of the TIMESTAMP
      column in the proc table.
      
      Fixed by preserving and restoring the time_zone usage flag when
      searching for a stored routine in the proc table.
      
      
      mysql-test/r/binlog_innodb.result:
        Bug #30604: test case
      mysql-test/r/ctype_cp932_binlog.result:
        Bug #30604: updated test results (a procedure call before that)
      mysql-test/t/binlog_innodb.test:
        Bug #30604: test case
      sql/sp.cc:
        Bug #30604: finding a routine should be a transparent operation as 
        far as the binary log is concerned.
        Fixed by preserving and restoring the time_zone usage flag.
      e719a221
  7. 18 Feb, 2008 1 commit
    • unknown's avatar
      Merge bk@192.168.21.1:mysql-5.0-opt · 3ae38b49
      unknown authored
      into  mysql.com:/home/hf/work/32942/my50-32942
      
      
      sql/sql_select.cc:
        Auto merged
      mysql-test/r/select.result:
        merging
      mysql-test/t/select.test:
        merging
      3ae38b49
  8. 17 Feb, 2008 5 commits
    • unknown's avatar
      Merge ssh://bk-internal.mysql.com//home/bk/mysql-5.0-opt · f9bf3eef
      unknown authored
      into  kaamos.(none):/data/src/opt/mysql-5.0-opt
      
      
      sql/item.cc:
        Auto merged
      f9bf3eef
    • unknown's avatar
      Bug #32942 now() - interval '7200' second NOT pre-calculated, causing "full table scan" · 274cdcdd
      unknown authored
      Problem is not about intervals and doesn't actually cause 'full table scan'.
      We have an optimization for DISTINCT when we have
      'DISTINCT field_from_first_join_table' we don't need to read all the
      rows from the JOIN-ed table if we found one conforming row.
      It stopped working in 5.0 as we return NESTED_LOOP_OK if we came upon
      that case in the evaluate_join_record() and that doesn't break the
      recordreading loop in sub_select().
      
      Fixed by returning NESTED_LOOP_NO_MORE_ROWS in this case.
      
      
      mysql-test/r/select.result:
        Bug #32942 now() - interval '7200' second is NOT pre-calculated, causing "full table scan".
        
        test result
      mysql-test/t/select.test:
        Bug #32942 now() - interval '7200' second is NOT pre-calculated, causing "full table scan"
        
        test case
      sql/sql_select.cc:
        Bug #32942 now() - interval '7200' second NOT pre-calculated, causing "full table scan"
        
        return NESTED_LOOP_NO_MORE_ROWS when we don't need to read rows from
        this table anymore
      274cdcdd
    • unknown's avatar
      Merge kaamos.(none):/data/src/opt/mysql-4.1-opt · d6060cd5
      unknown authored
      into  kaamos.(none):/data/src/opt/mysql-5.0-opt
      
      d6060cd5
    • unknown's avatar
      Merge kaamos.(none):/data/src/mysql-5.0 · c9a13e81
      unknown authored
      into  kaamos.(none):/data/src/opt/mysql-5.0-opt
      
      
      mysql-test/r/variables.result:
        Auto merged
      mysql-test/t/variables.test:
        Auto merged
      sql/item.cc:
        Auto merged
      sql/item_cmpfunc.cc:
        Auto merged
      sql/sql_acl.cc:
        Auto merged
      sql/sql_select.cc:
        Auto merged
      sql/sql_yacc.yy:
        Auto merged
      mysql-test/r/sp.result:
        Manual merge.
      mysql-test/t/sp.test:
        Manual merge.
      c9a13e81
    • unknown's avatar
      Merge kaamos.(none):/data/src/mysql-4.1 · a5d041cf
      unknown authored
      into  kaamos.(none):/data/src/opt/mysql-4.1-opt
      
      a5d041cf
  9. 15 Feb, 2008 2 commits
    • unknown's avatar
      Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 54d4452d
      unknown authored
      into  magare.gmz:/home/kgeorge/mysql/autopush/B31887-5.0-opt
      
      
      sql/item.cc:
        Auto merged
      sql/mysql_priv.h:
        Auto merged
      54d4452d
    • unknown's avatar
      Bug #31887: DML Select statement not returning same results · 72e48bf2
      unknown authored
      when executed in version 5
      
      Zero fill is a field attribute only. So we can't always 
      propagate  constants for zerofill fields : the values and 
      expression results don't have that flag.
      
      Fixed by converting the const value to a string and 
      using that in const propagation when the context allows it. 
      Disable const propagation for fields with ZEROFILL flag in
      all the other cases.
      
      
      mysql-test/r/compare.result:
        Bug #31887: test case
      mysql-test/t/compare.test:
        Bug #31887: test case
      sql/item.cc:
        Bug #31887: If the context allows conversion
        of an int constant to a zero-filled string constant
        put the string constant instead of the int constant
        when doing const propagation
      sql/mysql_priv.h:
        Bug #31887: a macro to get all the Field_num
        descendant fields.
      72e48bf2
  10. 14 Feb, 2008 1 commit
  11. 13 Feb, 2008 3 commits
    • unknown's avatar
      Merge host.loc:/home/uchum/work/5.0-opt-gca · 81b31789
      unknown authored
      into  host.loc:/home/uchum/work/5.0-opt
      
      81b31789
    • unknown's avatar
      Fixed bug#31194: Privilege ordering does not order properly · 6ffb9eaf
      unknown authored
                       for wildcard values.
      The server ignored escape character before wildcards during
      the calculation of priority values for sorting of a privilege
      list. (Actually the server counted an escape character as an
      ordinary wildcard like % or _). I.e. the table name template
      with a wildcard character like 'tbl_1' had higher priority in
      a privilege list than concrete table name without wildcards
      like 'tbl\_1', and some privileges of 'tbl\_1' was hidden
      by privileges for 'tbl_1'.
      
      The get_sort function has been modified to ignore escaped
      wildcards as usual.
      
      
      
      mysql-test/r/grant3.result:
        Added test case for bug#31194.
      mysql-test/t/grant3.test:
        Added test case for bug#31194.
      sql/sql_acl.cc:
        Fixed bug#31194.
        The server used the wild_prefix escape character (usually \-character)
        like % and _ wildcards in the get_sort function for sorting weights
        calculation.
        
        The get_sort function has been modified to ignore escaped wildcards
        and alone escapes like in the wild_case_compare function.
      6ffb9eaf
    • unknown's avatar
      Fixed bug#33764: Wrong result with IN(), CONCAT() and implicit · cb5c4940
      unknown authored
                       type conversion.
      
      Instead of copying of whole character string from a temporary
      buffer, the server copied a short-living pointer to that string
      into a long-living structure. That has been fixed.
      
      
      mysql-test/r/select.result:
        Added test case for bug#33764.
      mysql-test/t/select.test:
        Added test case for bug#33764.
      sql/item_cmpfunc.cc:
        Fixed bug#33764.
        Copying of a pointer has been replaced with an optional copying of
        a whole array to a newly allocated memory space in case of a
        functional source item.
      cb5c4940
  12. 12 Feb, 2008 3 commits
    • unknown's avatar
      Merge mbp:src/opt/bug33389/my50-bug25162 · 83af5b17
      unknown authored
      into  kaamos.(none):/data/src/opt/mysql-5.0-opt
      
      
      sql/item.cc:
        Auto merged
      83af5b17
    • unknown's avatar
      Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 8f68cac2
      unknown authored
      into  moonbone.local:/work/31590-bug-5.0-opt-mysql
      
      8f68cac2
    • unknown's avatar
      Fix for bug #33389: Selecting from a view into a table from within SP · eee4d8cc
      unknown authored
                          or trigger crashes server
      
      Under some circumstances a combination of VIEWs, subselects with outer
      references and PS/SP/triggers could lead to use of uninitialized memory
      and server crash as a result.
      
      Fixed by changing the code in Item_field::fix_fields() so that in cases
      when the field is a VIEW reference, we first check whether the field
      is also an outer reference, and mark it appropriately before returning.
      
      
      mysql-test/r/view.result:
        Added a test case for bug #33389.
      mysql-test/t/view.test:
        Added a test case for bug #33389.
      sql/item.cc:
        In cases when in Item_field::fix_fields() from_field is a view reference,
        do not return too early, i.e. before marking the reference as an outer
        one when needed.
      eee4d8cc
  13. 11 Feb, 2008 3 commits
  14. 10 Feb, 2008 4 commits
    • unknown's avatar
      Merge bk@192.168.21.1:mysql-5.0-opt · 4c995786
      unknown authored
      into  mysql.com:/home/hf/work/33796/my50-33796
      
      4c995786
    • unknown's avatar
      Merge mysql.com:/home/hf/work/33796/my41-33796 · 381bfc8a
      unknown authored
      into  mysql.com:/home/hf/work/33796/my50-33796
      
      
      libmysql/libmysql.c:
        merging
      libmysqld/lib_sql.cc:
        merging
      381bfc8a
    • unknown's avatar
      Bug #33796 Memory leak for prepared statements in embedded server. · 075e0220
      unknown authored
      Field data for a query was stored to the stmt->alloc that is emptied
      with mysql_stmt_close statement only. That means a lot of memory can
      be occupied without a reason if used doesn't call mysql_stmt_close often.
      
      
      libmysql/libmysql.c:
        Bug #33796 Memory leak for prepared statements in embedded server.
        
        Clean up result->alloc even if there's no 'data' created
      libmysqld/lib_sql.cc:
        Bug #33796 Memory leak for prepared statements in embedded server.
        
        alloc 'fields' in the 'result.alloc' as the 'mem_root' is only cleaned with
        mysql_stmt_close'
      075e0220
    • unknown's avatar
      Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 8bcb5973
      unknown authored
      into  mysql.com:/home/tnurnberg/21567/50-21567
      
      
      sql/mysqld.cc:
        Auto merged
      8bcb5973
  15. 08 Feb, 2008 5 commits
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · 955f1885
      unknown authored
      into  dipika.(none):/opt/local/work/mysql-5.0-runtime
      
      955f1885
    • unknown's avatar
      Merge gshchepa@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · a14095af
      unknown authored
      into  host.loc:/home/uchum/work/5.0-opt
      
      a14095af
    • unknown's avatar
      Fixed bug#15409: Columns with 64-element SET may not be updated with integers. · 1dbe6997
      unknown authored
      SET column storing procedure has been modified to be 64bit-clean.
      
      
      mysql-test/r/type_set.result:
        Added test case for bug#15409.
      mysql-test/t/type_set.test:
        Added test case for bug#15409.
      sql/field.cc:
        Fixed bug#15409.
        The Field_set::store(longlong nr,...) method incompletely
        calculates a bit mask for the comparison with a given number:
        if that number is greater than 0x7F00 0000 0000 0000 (LONGLONG_MAX),
        it uses zero bit mask instead of 0xFFFF FFFF FFFF FFFF (ULONGLONG_MAX).
        
        Incomplete expression has been replaced with a set_bits macro call.
      1dbe6997
    • unknown's avatar
      Bug#33798 prepared statements improperly handle large unsigned ints · cea021da
      unknown authored
      The unsignedness of large integer user variables was not being
      properly preserved when feeded to prepared statements. This was
      happening because the unsigned flags wasn't being updated when
      converting the user variable is converted to a parameter.
      
      The solution is to copy the unsigned flag when converting the
      user variable to a parameter and take the unsigned flag into
      account when converting the integer to a string.
      
      
      mysql-test/r/binlog.result:
        Add test case result for Bug#33798
      mysql-test/r/ps.result:
        Add test case result for Bug#33798
      mysql-test/t/binlog.test:
        Add test case for Bug#33798
      mysql-test/t/ps.test:
        Add test case for Bug#33798
      sql/item.cc:
        Take the unsigned flag into account when converting the
        user variable.
      cea021da
    • unknown's avatar
      Bug#31590: Wrong error message on sort buffer being too small. · 2c468127
      unknown authored
      The out of memory error was thrown when the sort buffer size were too small.
      This led to a user confusion.
      
      Now filesort throws the error message about sort buffer being too small.
      
      
      mysql-test/t/order_by.test:
        Added a test case for the bug#31590: Wrong error message on sort buffer being too small.
      mysql-test/r/order_by.result:
        Added a test case for the bug#31590: Wrong error message on sort buffer being too small.
      sql/filesort.cc:
        Bug#31590: Wrong error message on sort buffer being too small.
        Now filesort throws the error message about sort buffer being too small
        instead of out of memory error.
      2c468127
  16. 07 Feb, 2008 1 commit