1. 06 Jul, 2006 1 commit
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime · 685ccf85
      unknown authored
      into  mysql.com:/home/dlenev/mysql-5.0-bg18437-3
      
      
      mysql-test/t/federated.test:
        Auto merged
      sql/ha_ndbcluster.cc:
        Auto merged
      sql/item.cc:
        Auto merged
      sql/mysql_priv.h:
        Auto merged
      sql/sql_delete.cc:
        Auto merged
      sql/sql_insert.cc:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_table.cc:
        Auto merged
      sql/sql_trigger.cc:
        Auto merged
      sql/sql_update.cc:
        Auto merged
      mysql-test/r/federated.result:
        Manual merge.
      685ccf85
  2. 05 Jul, 2006 1 commit
  3. 04 Jul, 2006 2 commits
    • unknown's avatar
      Merge mysql.com:/home/tomash/src/mysql_ab/mysql-5.0 · 2a5fa3cf
      unknown authored
      into  mysql.com:/home/tomash/src/mysql_ab/mysql-5.0-bug20570
      
      
      sql/item_strfunc.cc:
        Auto merged
      sql/item_strfunc.h:
        Auto merged
      sql/sql_yacc.yy:
        Auto merged
      mysql-test/r/view_grant.result:
        Manual merge.
      mysql-test/t/view_grant.test:
        Manual merge.
      2a5fa3cf
    • unknown's avatar
      A fix and a test case for Bug#17843 "Certain stored procedures fail to · c12cc90d
      unknown authored
      run at startup"
      
      The server returned an error when trying to execute init-file with a 
      stored procedure that could return multiple result sets to the client. 
      A stored procedure can return multiple result sets if it contains 
      PREPARE, SELECT, SHOW and similar statements.
         
      The fix is to set client_capabilites|=CLIENT_MULTI_RESULTS in
      sql_parse.cc:handle_bootstrap(). There is no "client" really, so 
      nothing is ever sent. This makes init-file feature behave consistently: 
      the prepared statements that can be called directly in the init-file 
      can be used in a stored procedure too.
      
      Re-committed the patch originally submitted by Per-Erik after review.
      
      
      mysql-test/Makefile.am:
        Fix re-make without make clean.
      mysql-test/r/init_connect.result:
        Updated results (a test case for Bug#17843)
      mysql-test/r/init_file.result:
        Updated results (a test case for Bug#17843)
      mysql-test/std_data/init_file.dat:
        Add test coverage for new features added in 5.0. Note, that what can 
        be done in init_file is very limited as it does not support any other
        delimiter except ';' -- only "one liners" and no multiple statement 
        procedures. Also, this is executed with a dummy user "boot@", which 
        calls for the use of DEFINER clause.
      mysql-test/t/init_connect.test:
        Add test coverage for new features added in 5.0.
      mysql-test/t/init_file.test:
        Add test coverage for new features added in 5.0 --
        stored routines, views, triggers. The actual tests are in 
        std_data/init_file.dat, here we just check the results and clean up.
      sql/sql_class.cc:
        Initialize Security_context::priv_host to an empty string:
        when executing an init-file, sql_parse.cc:get_default_definer()
        will use this for the value of the definer if it's not set in the query.
      sql/sql_parse.cc:
        Set CLIENT_MULTI_RESULTS in handle_bootstrap(), to make prepared
        statements work in stored procedures called from init-file.
      c12cc90d
  4. 03 Jul, 2006 2 commits
  5. 02 Jul, 2006 1 commit
    • unknown's avatar
      Bug#20570: CURRENT_USER() in a VIEW with SQL SECURITY DEFINER returns · a2fc4843
      unknown authored
                 invoker name
      
      The bug was fixed similar to how context switch is handled in
      Item_func_sp::execute_impl(): we store pointer to current
      Name_resolution_context in Item_func_current_user class, and use
      its Security_context in Item_func_current_user::fix_fields().
      
      
      mysql-test/r/view_grant.result:
        Add result for bug#20570.
      mysql-test/t/view_grant.test:
        Add test case for bug#20570.
      sql/item_create.cc:
        Remove create_func_current_user(), as it is not used for automatic
        function creation.
      sql/item_create.h:
        Remove prototype for create_func_current_user().
      sql/item_strfunc.cc:
        Add implementations for Item_func_user::init(),
        Item_func_user::fix_fields() and
        Item_func_current_user::fix_fields() methods.  The latter uses
        Security_context from current Name_resolution_context, if one is
        defined.
      sql/item_strfunc.h:
        Move implementation of CURRENT_USER() out of Item_func_user to
        to new Item_func_current_user class.  For both classes calculate
        user name in fix_fields() method.
        For Item_func_current_user add context field to store
        Name_resolution_context in effect.
      sql/sql_yacc.yy:
        Pass current Name_resolution_context to Item_func_current_user.
      a2fc4843
  6. 01 Jul, 2006 4 commits
    • unknown's avatar
      Fix for bug#18437 "Wrong values inserted with a before update trigger on · ae9724cc
      unknown authored
      NDB table".
      
      SQL-layer was not marking fields which were used in triggers as such. As
      result these fields were not always properly retrieved/stored by handler
      layer. So one might got wrong values or lost changes in triggers for NDB,
      Federated and possibly InnoDB tables.
      This fix solves the problem by marking fields used in triggers
      appropriately.
      
      Also this patch contains the following cleanup of ha_ndbcluster code:
      
      We no longer rely on reading LEX::sql_command value in handler in order
      to determine if we can enable optimization which allows us to handle REPLACE
      statement in more efficient way by doing replaces directly in write_row()
      method without reporting error to SQL-layer.
      Instead we rely on SQL-layer informing us whether this optimization
      applicable by calling handler::extra() method with
      HA_EXTRA_WRITE_CAN_REPLACE flag.
      As result we no longer apply this optimzation in cases when it should not
      be used (e.g. if we have on delete triggers on table) and use in some
      additional cases when it is applicable (e.g. for LOAD DATA REPLACE).
      
      Finally this patch includes fix for bug#20728 "REPLACE does not work
      correctly for NDB table with PK and unique index".
        
      This was yet another problem which was caused by improper field mark-up.
      During row replacement fields which weren't explicity used in REPLACE
      statement were not marked as fields to be saved (updated) so they have
      retained values from old row version. The fix is to mark all table
      fields as set for REPLACE statement. Note that in 5.1 we already solve
      this problem by notifying handler that it should save values from all
      fields only in case when real replacement happens.
      
      
      include/my_base.h:
        Added HA_EXTRA_WRITE_CAN_REPLACE, HA_EXTRA_WRITE_CANNOT_REPLACE - new
        parameters for ha_extra() method. We use them to inform handler that
        write_row() which tries to insert new row into the table and encounters
        some already existing row with same primary/unique key can replace old
        row with new row instead of reporting error.
      mysql-test/r/federated.result:
        Additional test for bug#18437 "Wrong values inserted with a before update
        trigger on NDB table".
      mysql-test/r/ndb_replace.result:
        Added test for bug #20728 "REPLACE does not work correctly for NDB table
        with PK and unique index". Updated wrong results from older test.
      mysql-test/t/federated.test:
        Additional test for bug#18437 "Wrong values inserted with a before update
        trigger on NDB table".
      mysql-test/t/ndb_replace.test:
        Added test for bug #20728 "REPLACE does not work correctly for NDB table
        with PK and unique index".
      sql/ha_ndbcluster.cc:
        We no longer rely on reading LEX::sql_command value in handler in order
        to determine if we can enable optimization which allows us to handle REPLACE
        statement in more efficient way by doing replaces directly in write_row()
        method without reporting error to SQL-layer.
        Instead we rely on SQL-layer informing us whether this optimization
        applicable by calling handler::extra() method with
        HA_EXTRA_WRITE_CAN_REPLACE flag.
        As result we no longer apply this optimization in cases when it should not
        be used (e.g. if we have on delete triggers on table) and use in some
        additional cases when it is applicable (e.g. for LOAD DATA REPLACE).
      sql/item.cc:
        Item_trigger_field::setup_field():
          Added comment explaining why we don't set Field::query_id in this method.
      sql/mysql_priv.h:
        mysql_alter_table() function no longer takes handle_duplicates argument.
        Added declaration of mark_fields_used_by_triggers_for_insert_stmt() function.
      sql/sql_delete.cc:
        Mark fields which are used by ON DELETE triggers so handler will retrieve
        values for these fields.
      sql/sql_insert.cc:
        Explicitly inform handler that we are doing REPLACE (using ha_extra() method)
        in cases when it can promote insert operation done by write_row() to replace.
        Also when we do REPLACE we want to store values for all columns so we should
        inform handler about it.
        Finally we should mark fields used by ON UPDATE/ON DELETE triggers as such
        so handler can properly retrieve/restore values in these fields during
        execution of REPLACE and INSERT ... ON DUPLICATE KEY UPDATE statements.
      sql/sql_load.cc:
        Explicitly inform handler that we are doing LOAD DATA REPLACE (using
        ha_extra() method) in cases when it can promote insert operation done by
        write_row() to replace.
        Also when we do replace we want to save (replace) values for all columns
        so we should inform handler about it.
        Finally to properly execute LOAD DATA for table with triggers we should
        mark fields used by ON INSERT triggers as such so handler can properly
        store values for these fields.
      sql/sql_parse.cc:
        mysql_alter_table() function no longer takes handle_duplicates argument.
      sql/sql_table.cc:
        Got rid of handle_duplicates argument in mysql_alter_table() and
        copy_data_between_tables() functions. These functions were always
        called with handle_duplicates == DUP_ERROR and thus contained dead
        (and probably incorrect) code.
      sql/sql_trigger.cc:
        Added Table_triggers_list::mark_fields_used() method which is used to mark
        fields read/set by triggers as such so handlers will be able properly
        retrieve/store values in these fields.
      sql/sql_trigger.h:
        Table_triggers_list:
          Added mark_fields_used() method which is used to mark fields read/set by
          triggers as such so handlers will be able properly retrieve/store values
          in these fields. To implement this method added 'trigger_fields' member
          which is array of lists linking items for all fields used in triggers
          grouped by event and action time.
      sql/sql_update.cc:
        Mark fields which are used by ON UPDATE triggers so handler will retrieve
        and save values for these fields.
      mysql-test/r/ndb_trigger.result:
        Added test for bug#18437 "Wrong values inserted with a before update trigger
        on NDB table".
      mysql-test/t/ndb_trigger.test:
        Added test for bug#18437 "Wrong values inserted with a before update trigger
        on NDB table".
      ae9724cc
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · 4c2db1be
      unknown authored
      into  mysql.com:/opt/local/work/mysql-5.0-runtime
      
      
      mysql-test/r/func_sapdb.result:
        Auto merged
      mysql-test/r/func_time.result:
        Auto merged
      mysql-test/t/func_sapdb.test:
        Auto merged
      mysql-test/t/func_time.test:
        Auto merged
      sql/item.h:
        Auto merged
      sql/item_timefunc.cc:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      4c2db1be
    • unknown's avatar
      Post-merge fix · 047e2be2
      unknown authored
      047e2be2
    • unknown's avatar
      Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0 · 87d04015
      unknown authored
      into  mysql.com:/home/psergey/mysql-5.0-bug16168-merge
      
      
      87d04015
  7. 30 Jun, 2006 25 commits
    • unknown's avatar
      Merge mysql.com:/home/psergey/mysql-4.1-bug16168-push · c1fa66c3
      unknown authored
      into  mysql.com:/home/psergey/mysql-5.0-bug16168-merge
      
      
      mysql-test/t/range.test:
        Auto merged
      mysql-test/r/range.result:
        SCCS merged
      sql/opt_range.cc:
        SCCS merged
      c1fa66c3
    • unknown's avatar
      Remove an unused variable. · 697e8d71
      unknown authored
      697e8d71
    • unknown's avatar
      Remove a couple of unused/barely used names. · 0c7bc6e9
      unknown authored
      
      sql/sql_lex.cc:
        Remove an unused thread key.
      sql/sql_lex.h:
        Remove an unused thread key, current_lex.
      sql/sql_parse.cc:
        Remove an unused thread key, current_lex macro.
      0c7bc6e9
    • unknown's avatar
      After merge fixes · 0bbc6fbe
      unknown authored
      
      BitKeeper/etc/ignore:
        added scripts/mysql_upgrade_shell
      include/my_handler.h:
        my_handler.h should not include my_global.h
      mysql-test/r/key.result:
        Update results after merge
      0bbc6fbe
    • unknown's avatar
      Merge mysql.com:/home/my/mysql-4.1 · 9606675b
      unknown authored
      into  mysql.com:/home/my/mysql-5.0
      
      
      libmysql/libmysql.c:
        Auto merged
      mysql-test/mysql-test-run.sh:
        Auto merged
      mysql-test/t/key.test:
        Auto merged
      sql/table.cc:
        Auto merged
      mysql-test/r/key.result:
        Manual merge
      mysql-test/t/mysqldump.test:
        Manual merge
        (Now we have same code as in 4.1 and 5.1)
      sql/ha_ndbcluster.cc:
        Manual merge
        Change %ll -> llstr()
      tests/mysql_client_test.c:
        manual merge
      9606675b
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-4.1 · e0171231
      unknown authored
      into  mysql.com:/home/my/mysql-4.1
      
      
      e0171231
    • unknown's avatar
      Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1 · a6d2cafd
      unknown authored
      into  poseidon.ndb.mysql.com:/home/tomas/mysql-4.1-main
      
      
      a6d2cafd
    • unknown's avatar
      Reverted wrong bug fix (Bug#11228) · 66a59b10
      unknown authored
      
      mysql-test/r/key.result:
        Fixed result after removing wrong bug fix
      mysql-test/t/key.test:
        Added SHOW CREATE TABLE, which is the proper way to check for table definitions
      sql/table.cc:
        Reverted wrong bug fix.
        The intention with the original code was to show that MySQL treats the first
        given unique key as a primary key. Clients can use the marked primary key as a
        real primary key to validate row changes in case of conflicting updates.  The
        ODBC driver (and other drivers) may also use this fact to optimize/check
        updates and handle conflicts.  The marked key also shows what some engines, like InnoDB or NDB,
        will use as it's internal primary key.
        
        For checking if someone has declared a true PRIMARY KEY, one should use 'SHOW CREATE TABLE'
      66a59b10
    • unknown's avatar
      Merge poseidon.ndb.mysql.com:/home/tomas/mysql-4.1 · e410532a
      unknown authored
      into  poseidon.ndb.mysql.com:/home/tomas/mysql-4.1-main
      
      
      sql/ha_ndbcluster.cc:
        Auto merged
      e410532a
    • unknown's avatar
      adopted ndb handler code for tables without primary key and with unique index · 437afbfd
      unknown authored
      - added missing retrieval of hidden primary key
      
      
      437afbfd
    • unknown's avatar
      Bug#17226: Variable set in cursor on first iteration is assigned · fc085d77
      unknown authored
                 second iterations value
      
      During assignment to the BLOB variable in routine body the value
      wasn't copied.
      
      
      mysql-test/r/sp-vars.result:
        Add result for bug#17226.
      mysql-test/t/sp-vars.test:
        Add test case for bug#17226.
      sql/field_conv.cc:
        Honor copy_blobs flag.
      fc085d77
    • unknown's avatar
      Merge mysqldev@production:my/mysql-5.0-release · b138b55d
      unknown authored
      into  mysql.com:/usr/local/mysql/tmp-5.0
      
      
      include/my_global.h:
        Auto merged
      sql/item_sum.cc:
        Auto merged
      b138b55d
    • unknown's avatar
      Fix Windows build problem following previous push. · 949ad5b4
      unknown authored
      
      strings/strtod.c:
        Fix Windows build problem, EOVERFLOW is defined in my_base.h on Windows.
      949ad5b4
    • unknown's avatar
      Merge mysql.com:/home/tomash/src/mysql_ab/mysql-4.1 · 618bd69d
      unknown authored
      into  mysql.com:/home/tomash/src/mysql_ab/mysql-4.1-bug20152
      
      
      618bd69d
    • unknown's avatar
      bug #20152: mysql_stmt_execute() overwrites parameter buffers · 86155590
      unknown authored
      When using a parameter bind MYSQL_TYPE_DATE in a prepared statement,
      the time part of the MYSQL_TIME buffer was written to zero in
      mysql_stmt_execute(). The param_store_date() function in libmysql.c
      worked directly on the provided buffer.
      Changed to use a copy of the buffer.
      
      
      libmysql/libmysql.c:
        fix for bug #20152
      tests/mysql_client_test.c:
        added test for bug#20152
      86155590
    • unknown's avatar
      Merge mysqldev@production.mysql.com:my/mysql-5.0-release · 4a6a237f
      unknown authored
      into  mysql.com:/usr/local/mysql/mysql-5.0-release
      
      
      4a6a237f
    • unknown's avatar
      BUG#20769: Dangling pointer in ctype_recoding test case. · d9cb536a
      unknown authored
      In some functions dealing with strings and character sets, the wrong
      pointers were saved for restoration in THD::rollback_item_tree_changes().
      This could potentially cause random corruption or crashes.
      
      Fixed by passing the original Item ** locations, not local stack copies.
      
      Also remove unnecessary use of default arguments.
      
      
      sql/item.cc:
        Function agg_item_charsets() now handles non-consequtive Item *'s.
      sql/item.h:
        Remove use of default argument.
      sql/item_cmpfunc.cc:
        Remove use of default argument.
      sql/item_func.cc:
        Remove use of default argument.
      sql/item_func.h:
        Function agg_item_charsets() now handles non-consequtive Item *'s.
      sql/item_strfunc.cc:
        Pass original Item **'s to agg_arg_charsets(), not local copies, to ensure
        proper restoration in THD::rollback_item_tree_changes().
      sql/item_sum.cc:
        Remove use of default argument.
      d9cb536a
    • unknown's avatar
      BUG#16168: Wrong results from range optimizer, "Use_count: Wrong count for key ..." warnings: · 633cbfb5
      unknown authored
       - Added comments.
       - Make SEL_ARG::clone() set SEL_ARG::elements in the created copy.
      
      
      mysql-test/r/range.result:
        BUG#16168: Testcase
      mysql-test/t/range.test:
        BUG#16168: Testcase
      633cbfb5
    • unknown's avatar
      Merge mysql.com:/home/emurphy/src/bk-clean/mysql-4.1 · 29423c2d
      unknown authored
      into  mysql.com:/home/emurphy/src/bk-clean/mysql-5.0
      
      
      configure.in:
        Auto merged
      29423c2d
    • unknown's avatar
      Fixing windows build. · a14c9ddf
      unknown authored
      
      strings/strtod.c:
        Reverting previous change to include files (angle brackets instead of
        quotes) that broke windows build
      a14c9ddf
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · de1499ea
      unknown authored
      into  mysql.com:/home/my/mysql-5.0
      
      
      mysql-test/r/func_sapdb.result:
        Auto merged
      mysql-test/r/func_time.result:
        Auto merged
      mysql-test/r/symlink.result:
        Auto merged
      mysql-test/t/func_sapdb.test:
        Auto merged
      mysql-test/t/func_time.test:
        Auto merged
      sql/item_timefunc.cc:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      de1499ea
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-4.1 · 0343a80b
      unknown authored
      into  mysql.com:/home/my/mysql-4.1
      
      
      0343a80b
    • unknown's avatar
      Merge monty@192.168.0.9:/home/my/mysql-4.1 · c8a5b35d
      unknown authored
      into  mysql.com:/home/my/mysql-4.1
      
      
      c8a5b35d
    • unknown's avatar
      Don't read ~/.my.cnf in mysqldump.test · c5ed64a4
      unknown authored
      
      heap/hp_test1.c:
        Changed type from last commit
      mysql-test/mysql-test-run.sh:
        Fixed problem with running with --gdb and two masters
        Don't disable ndb becasue we run gdb
      mysql-test/t/mysqldump.test:
        Don't read ~/.my.cnf
      sql/ha_ndbcluster.cc:
        Portability fix
      c5ed64a4
    • unknown's avatar
      mysql.spec.sh: · b76a6873
      unknown authored
        Disable old RPM strip
      my_global.h:
        Fixed wrong cast, which caused problems with gcc 4.0 and
        floats in prepared statements (Bug #19694)
      mysqlmanager.vcproj:
        Place output files in common release/debug directory
      
      
      server-tools/instance-manager/mysqlmanager.vcproj:
        Place output files in common release/debug directory
      include/my_global.h:
        Fixed wrong cast, which caused problems with gcc 4.0 and
        floats in prepared statements (Bug #19694)
      support-files/mysql.spec.sh:
        Disable old RPM strip
      b76a6873
  8. 29 Jun, 2006 4 commits
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-4.1 · 6946f03e
      unknown authored
      into  mysql.com:/home/my/mysql-4.1
      
      
      6946f03e
    • unknown's avatar
      Merge mysql.com:/home/my/mysql-4.1 · 2226065b
      unknown authored
      into  mysql.com:/home/my/mysql-5.0
      
      
      include/my_global.h:
        Auto merged
      mysql-test/r/func_sapdb.result:
        Auto merged
      mysql-test/r/symlink.result:
        Auto merged
      mysql-test/t/func_sapdb.test:
        Auto merged
      mysys/my_handler.c:
        Auto merged
      sql/item_timefunc.cc:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      strings/strtod.c:
        Auto merged
      mysql-test/r/func_time.result:
        Manual merge
      mysql-test/t/func_time.test:
        Manual merge
      2226065b
    • unknown's avatar
      Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1 · 2a100c1c
      unknown authored
      into sunlight.local:/local_work/autopush/merge-4.1
      
      
      2a100c1c
    • unknown's avatar
      Fixed include file usage · 77deeb7e
      unknown authored
      hp_test2 now works again
      Fixed wrong cast, which caused problems with gcc 4.0 and floats in prepared statements (Bug #19694)
      
      
      heap/hp_test1.c:
        Portability fix
      heap/hp_test2.c:
        Added max_table_size (fixes that hp_test2 works again)
      include/my_global.h:
        Fixed wrong cast, which caused problems with gcc 4.0 (Bug #19694)
      mysys/my_handler.c:
        Added missing include file
      strings/strtod.c:
        Fixed include files
      77deeb7e