1. 20 Oct, 2006 1 commit
    • unknown's avatar
      Fix for bug#15228 "'invalid access to non-static data member' · de8c5dd9
      unknown authored
      warnings in sql_trigger.cc and sql_view.cc".
      
      According to the current version of C++ standard offsetof() macro
      can't be used for non-POD types. So warnings were emitted when we
      tried to use this macro for TABLE_LIST and Table_triggers_list
      classes. Note that despite of these warnings it was probably safe
      thing to do.
      
      This fix tries to circumvent this limitation by implementing
      custom version of offsetof() macro to be used with these
      classes. This hack should go away once we will refactor
      File_parser class.
      
      Alternative approaches such as disabling this warning for
      sql_trigger.cc/sql_view.cc or for the whole server were
      considered less explicit. Also I was unable to find a way
      to disable particular warning for particular _part_ of
      file in GCC.
      
      
      sql/parse_file.h:
        Introduced auxillary macro which can be used instead of offsetof()
        to get offsets of members in class for non-POD types without getting
        warnings (assuming that all instances of the class has same offsets
        for same members).
      sql/sql_trigger.cc:
        Use my_offsetof() macro instead of standard offsetof() macro with
        Table_triggers_list class in order to avoid warnings (offsetof()
        cannot be used for non-POD types according to the standard).
      sql/sql_view.cc:
        Use my_offsetof() macro instead of standard offsetof() macro with
        TABLE_LIST class in order to avoid warnings (offsetof() cannot
        be used for non-POD types according to the standard).
      de8c5dd9
  2. 17 Oct, 2006 1 commit
    • unknown's avatar
      Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-4.1-bug21726 · 8278ebe6
      unknown authored
      into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug21726
      
      
      mysql-test/r/rpl_insert_id.result:
        Use local.
      mysql-test/t/rpl_insert_id.test:
        Use local.
      sql/item_func.cc:
        Use local.
      sql/item_func.h:
        Use local.
      sql/log_event.cc:
        Use local.
      sql/set_var.cc:
        Use local.
      sql/sql_class.h:
        Use local.
      sql/sql_insert.cc:
        Use local.
      sql/sql_load.cc:
        Use local.
      sql/sql_parse.cc:
        Use local.
      sql/sql_select.cc:
        Use local.
      sql/sql_update.cc:
        Use local.
      tests/mysql_client_test.c:
        Use local.
      8278ebe6
  3. 06 Oct, 2006 1 commit
    • unknown's avatar
      BUG#21726: Incorrect result with multiple invocations of LAST_INSERT_ID. · 7820e189
      unknown authored
      Note: bug#21726 does not directly apply to 4.1, as it doesn't have stored
      procedures.  However, 4.1 had some bugs that were fixed in 5.0 by the
      patch for bug#21726, and this patch is a backport of those fixes.
      Namely, in 4.1 it fixes:
      
        - LAST_INSERT_ID(expr) didn't return value of expr (4.1 specific).
      
        - LAST_INSERT_ID() could return the value generated by current
          statement if the call happens after the generation, like in
      
            CREATE TABLE t1 (i INT AUTO_INCREMENT PRIMARY KEY, j INT);
            INSERT INTO t1 VALUES (NULL, 0), (NULL, LAST_INSERT_ID());
      
        - Redundant binary log LAST_INSERT_ID_EVENTs could be generated.
      
      
      mysql-test/r/rpl_insert_id.result:
        Add result for bug#21726: Incorrect result with multiple invocations
        of LAST_INSERT_ID.
      mysql-test/t/rpl_insert_id.test:
        Add test case for bug#21726: Incorrect result with multiple invocations
        of LAST_INSERT_ID.
      sql/item_func.cc:
        Add implementation of Item_func_last_insert_id::fix_fields(), where we
        set THD::last_insert_id_used when statement calls LAST_INSERT_ID().
        In Item_func_last_insert_id::val_int(), return THD::current_insert_id
        if called like LAST_INSERT_ID(), otherwise return value of argument if
        called like LAST_INSERT_ID(expr).
      sql/item_func.h:
        Add declaration of Item_func_last_insert_id::fix_fields().
      sql/log_event.cc:
        Do not set THD::last_insert_id_used on LAST_INSERT_ID_EVENT.  Though we
        know the statement will call LAST_INSERT_ID(), it wasn't called yet.
      sql/set_var.cc:
        In sys_var_last_insert_id::value_ptr(), set THD::last_insert_id_used,
        and return THD::current_insert_id for @@LAST_INSERT_ID.
      sql/sql_class.h:
        Update comments.
        Remove THD::insert_id(), as it has lost its purpose now.
      sql/sql_insert.cc:
        Now it is OK to read THD::last_insert_id directly.
      sql/sql_load.cc:
        Now it is OK to read THD::last_insert_id directly.
      sql/sql_parse.cc:
        In mysql_execute_command(), remember THD::last_insert_id (first
        generated value of the previous statement) in THD::current_insert_id,
        which then will be returned for LAST_INSERT_ID() and @@LAST_INSERT_ID.
      sql/sql_select.cc:
        If "IS NULL" is replaced with "= <LAST_INSERT_ID>", use right value,
        which is THD::current_insert_id, and also set THD::last_insert_id_used
        to issue binary log LAST_INSERT_ID_EVENT.
      sql/sql_update.cc:
        Now it is OK to read THD::last_insert_id directly.
      tests/mysql_client_test.c:
        Add test case for bug#21726: Incorrect result with multiple invocations
        of LAST_INSERT_ID.
      7820e189
  4. 29 Sep, 2006 3 commits
  5. 28 Sep, 2006 2 commits
    • unknown's avatar
      Fix for bug#22338 "Valgrind warning: uninitialized variable in · 3385bda9
      unknown authored
      create_tmp_table()".
      
      The fix for bug 21787 "COUNT(*) + ORDER BY + LIMIT returns wrong
      result" introduced valgrind warnings which occured during execution
      of information_schema.test and sp-prelocking.test in version 5.0.
      There were no user visible effects.
      
      The latter fix made create_tmp_table() dependant on
      THD::lex::current_select value. Valgrind warnings occured when this
      function was executed and THD::lex::current_select member pointed
      to uninitialized SELECT_LEX instance.
      
      This fix tries to remove this dependancy by moving some logic
      outside of create_tmp_table() function.
      
      
      sql/sql_select.cc:
        create_tmp_table():
          Moved code which is responsible for determining if optimization
          which pushes down LIMIT clause to temporary table creation is
          applicable out of this function.
          Such move made this function independant of THD::lex::current_select
          value and removed valgrind warnings which occured in cases when this
          member pointed to uninitialized SELECT_LEX object (particularly these
          warnings occured in sp-prelocking.test and information_schema.test
          in 5.0). This seems like a better solution than trying to force this
          pointer always to point to relevant select because:
          - In some cases when we use create_tmp_table() there are no relevant
            SELECT_LEX object (we use it just to create temporary table/object).
          - There is only one place in code where we call this funciton and
            where this optimization can be enabled. And in this place we
            already have some logic which tries to determine if it is applicable.
      3385bda9
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-4.1 · 5d7a582f
      unknown authored
      into  mockturtle.local:/home/dlenev/src/mysql-4.1-runtime
      
      5d7a582f
  6. 27 Sep, 2006 7 commits
    • unknown's avatar
      Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.0-runtime · 86c31d02
      unknown authored
      into  example.com:/work/mysql-5.0-runtime
      
      
      mysql-test/t/sp.test:
        Auto merged
      sql/sp.cc:
        Auto merged
      mysql-test/r/sp.result:
        manual merge
      86c31d02
    • unknown's avatar
      Fix for bug#21311: Possible stack overrun if SP has non-latin1 name · 3e3c040d
      unknown authored
        
      There was possible stack overrun in an edge case which handles invalid body of
      a SP in mysql.proc . That should be case when mysql.proc has been changed
      manually. Though, due to bug 21513, it can be exploited without having access
      to mysql.proc only being able to create a stored routine.
      
      
      mysql-test/r/sp.result:
        update result
      mysql-test/t/sp.test:
        add a test case for the bug
      sql/sp.cc:
        Fix stack overrun. This happen mostly when mysql.proc is damaged, though
        it's possible due to another bug which creates invalid SP body in mysql.proc
        (leading quote from a label being cut) to create stack overrun even without
        having direct access to mysql.proc
      3e3c040d
    • unknown's avatar
      additional 'after merge' fix · 96c11368
      unknown authored
      96c11368
    • unknown's avatar
      after merge fix · 15947254
      unknown authored
      15947254
    • unknown's avatar
      Merge mysql.com:/home/gluh/MySQL/Merge/4.1 · a1d2505e
      unknown authored
      into  mysql.com:/home/gluh/MySQL/Merge/5.0
      
      
      sql/sql_parse.cc:
        Auto merged
      sql-common/client.c:
        Auto merged
      sql/table.cc:
        Auto merged
      include/mysql_com.h:
        manual merge
      mysql-test/r/ctype_utf8.result:
        manual merge
      mysql-test/t/ctype_utf8.test:
        manual merge
      sql/sql_acl.cc:
        manual merge
      a1d2505e
    • unknown's avatar
      Patch for bug#21432 is reverted · 6c977010
      unknown authored
      6c977010
    • unknown's avatar
      Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0 · c0713cfc
      unknown authored
      into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug21414
      
      
      mysql-test/r/sp.result:
        Auto merged
      mysql-test/t/sp.test:
        Auto merged
      sql/mysql_priv.h:
        Auto merged
      sql/sp.cc:
        Auto merged
      sql/sql_acl.cc:
        Auto merged
      c0713cfc
  7. 26 Sep, 2006 2 commits
    • unknown's avatar
      Merge neptunus.(none):/home/msvensson/mysql/bug22379_runtime/my50-bug22379_runtime · ae06e705
      unknown authored
      into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-runtime
      
      
      server-tools/instance-manager/instance.cc:
        Auto merged
      ae06e705
    • unknown's avatar
      Merge trift2.:/MySQL/M50/clone-5.0 · 67fc6bc8
      unknown authored
      into  trift2.:/MySQL/M50/push-5.0
      
      
      mysql-test/r/func_time.result:
        Null-merge, the change in the 5.0 general tree supersedes the 5.0.25 patch.
      mysql-test/r/query_cache.result:
        Auto merged
      mysql-test/r/type_date.result:
        Auto merged
      mysql-test/r/view.result:
        Null-merge, the change in the 5.0 general tree supersedes the 5.0.25 patch.
      mysql-test/t/func_time.test:
        Null-merge, the change in the 5.0 general tree supersedes the 5.0.25 patch.
      mysql-test/t/type_date.test:
        Auto merged
      mysql-test/t/view.test:
        Null-merge, the change in the 5.0 general tree supersedes the 5.0.25 patch.
      sql/item_cmpfunc.cc:
        Null-merge, the change in the 5.0 general tree supersedes the 5.0.25 patch.
      67fc6bc8
  8. 25 Sep, 2006 1 commit
    • unknown's avatar
      Bug #22379 im_daemon_life_cycle.test fails on merge of 5.1 -> 5.1-engines · 64d34e57
      unknown authored
      Remove race situations that occur when removing pidfiles. Primarily each process should remove its own
      pidfile, secondly it should be removed by the process that created it and _only_ if it's
      certain the process is dead. Third, mysql-test-run.pl will remove the pidfile when process has been killed.
      - Set state of an instance to STARTING _before_ calling instance->start()
      - Check that pidfile of instance has been created before changing STARTING => STARTED
      - Only remove the pidfile if IM kills an instance with SIGKILL, otherwise the instance will remove it itself
      
      
      server-tools/instance-manager/guardian.cc:
        If state of an instance is STARTING, chech that the instance pidfile has been created
        before changing state to STARTED
        Set state to STARTING before calling instance->start(), it can take some time
        before it is fully started and during that time it should be in state STARTING
      server-tools/instance-manager/instance.cc:
        Only remove the pid file of instance manager when a SIGKILL has 
        been performed sucessfully
      server-tools/instance-manager/instance_options.cc:
        Check that fscanf returns 1 which is the number of args that should be scanned from
        the pid file
      64d34e57
  9. 24 Sep, 2006 2 commits
    • unknown's avatar
      Merge mysql.com:/Users/kent/mysql/bk/mysql-4.1 · df168380
      unknown authored
      into  mysql.com:/Users/kent/mysql/bk/mysql-5.0
      
      df168380
    • unknown's avatar
      mysql_config.sh: · 30109dc0
      unknown authored
        Filter out plain -O and Sun C/C++ style optimization flags, -xO<level>
        Filter out icc specific options from cflags/libs(_r)
      
      
      scripts/mysql_config.sh:
        Filter out plain -O and Sun C/C++ style optimization flags, -xO<level>
      30109dc0
  10. 23 Sep, 2006 5 commits
  11. 22 Sep, 2006 2 commits
    • unknown's avatar
      Fix for bug #19121: Windows incompatible udf_example · 3e85b24c
      unknown authored
      
      mysql-test/mysql-test-run.pl:
        fixed path for udf_example.so when running testsuite on Windows
      sql/CMakeLists.txt:
        Added missing udf_example
      sql/Makefile.am:
        Added udf_example files for make dist
      sql/udf_example.c:
        fix for Windows: Windows doesn't have socket.h and friends
        
        Added replacements for strmov,bzero and memcpy_fixed when compiling standalone.
      sql/udf_example.def:
        BitKeeper file /home/georg/work/mysql/prod/mysql-5.0-win/sql/udf_example.def
      3e85b24c
    • unknown's avatar
      Added build rule for mysql_upgrade.exe · fa16278b
      unknown authored
      fa16278b
  12. 21 Sep, 2006 9 commits
  13. 20 Sep, 2006 4 commits
    • unknown's avatar
      Merge mysql.com:/users/lthalmann/bk/MERGE/mysql-4.1-merge · 46235a29
      unknown authored
      into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.0-merge
      
      
      sql/sql_yacc.yy:
        Auto merged
      46235a29
    • unknown's avatar
      Fix of result files from merge · 866d046d
      unknown authored
      
      mysql-test/r/mysqldump.result:
        Fix of result file (adding the echo's)
      mysql-test/r/rpl_view.result:
        Added end of 5.0 echo
      mysql-test/t/rpl_view.test:
        Added end of 5.0 echo
      866d046d
    • unknown's avatar
      Merge mysql.com:/users/lthalmann/bkroot/mysql-5.0-rpl · e2000e2c
      unknown authored
      into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.0-merge
      
      
      ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
        Auto merged
      sql/ha_ndbcluster.cc:
        Auto merged
      sql/sql_class.h:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_yacc.yy:
        Auto merged
      client/mysqldump.c:
        Merge main->rpl
      mysql-test/r/mysqldump.result:
        Restore of main mysqldump test files in rpl tree (only added echo and one test case for bug 13926)
        Printouts not yet added to result file
      mysql-test/t/mysqldump.test:
        Restore of main mysqldump test files in rpl tree (only added echo and one test case for bug 13926)
      e2000e2c
    • unknown's avatar
      Merge mysql.com:/users/lthalmann/bkroot/mysql-4.1-rpl · 5323cee7
      unknown authored
      into  mysql.com:/users/lthalmann/bk/MERGE/mysql-4.1-merge
      
      
      sql/sql_yacc.yy:
        Auto merged
      5323cee7