1. 06 Jul, 2006 1 commit
    • unknown's avatar
      After merge fixes for patch solving bug#18437 "Wrong values inserted with a · 0e47753f
      unknown authored
      before update trigger on NDB table".
      
      Two main changes:
      - We use TABLE::read_set/write_set bitmaps for marking fields used by
        statement instead of Field::query_id in 5.1.
      - Now when we mark columns used by statement we take into account columns 
        used by table's triggers instead of marking all columns as used if table
        has triggers.
      
      
      mysql-test/r/federated.result:
        Changed test in order to make it work with RBR.
        RBR changes the way in which we execute "DELETE FROM t1" statement - we don't
        use handler::delete_all_rows() method if RBR is enabled (see bug#19066).
        As result federated engine produces different sequences of statements for
        remote server in non-RBR and in RBR cases. And this changes order of the
        rows inserted by following INSERT statements.
      mysql-test/t/federated.test:
        Changed test in order to make it work with RBR.
        RBR changes the way in which we execute "DELETE FROM t1" statement - we don't
        use handler::delete_all_rows() method if RBR is enabled (see bug#19066).
        As result federated engine produces different sequences of statements for
        remote server in non-RBR and in RBR cases. And this changes order of the
        rows inserted by following INSERT statements.
      sql/ha_partition.cc:
        Added handling of HA_EXTRA_WRITE_CAN_REPLACE/HA_EXTRA_WRITE_CANNOT_REPLACE
        to ha_partition::extra().
      sql/item.cc:
        Adjusted comment after merge. In 5.1 we use TABLE::read_set/write_set
        bitmaps instead of Field::query_id for marking columns used.
      sql/log_event.cc:
        Write_rows_log_event::do_before_row_operations():
          Now we explicitly inform handler that we want to replace rows so it can
          promote operation done by write_row() to replace.
      sql/mysql_priv.h:
        Removed declaration of mark_fields_used_by_triggers_for_insert_stmt() which
        is no longer used (we have TABLE::mark_columns_needed_for_insert() instead).
      sql/sql_insert.cc:
        Adjusted code after merge. Get rid of mark_fields_used_by_triggers_for_insert_stmt()
        as now we use TABLE::mark_columns_needed_for_insert() for the same purprose.
        Aligned places where we call this method with places where we call
        mark_fields_used_by_triggers_for_insert() in 5.0.
        Finally we no longer need to call handler::extra(HA_EXTRA_WRITE_CAN_REPLACE)
        in case of REPLACE statement since in 5.1 write_record() marks all columns
        as used before doing actual row replacement.
      sql/sql_load.cc:
        Adjusted code after merge. In 5.1 we use TABLE::mark_columns_needed_for_insert() instead of
        mark_fields_used_by_triggers_for_insert_stmt() routine. We also no longer
        need to call handler::extra(HA_EXTRA_RETRIEVE_ALL_COLS) if we execute LOAD
        DATA REPLACE since in 5.1 write_record() will mark all columns as used before
        doing actual row replacement.
      sql/sql_trigger.cc:
        Table_triggers_list::mark_fields_used():
          We use TABLE::read_set/write_set bitmaps for marking fields used instead
          of Field::query_id in 5.1.
      sql/sql_trigger.h:
        TABLE::mark_columns_needed_for_* methods no longer need to be friends of
        Table_triggers_list class as intead of dirrectly accessing its private
        members they can use public Table_triggers_list::mark_fields_used() method.
        Also Table_triggers)list::mark_fields_used() no longer needs THD argument.
      sql/table.cc:
        TABLE::mark_columns_needed_for_*():
          Now we mark columns which are really used by table's triggers instead of
          marking all columns as used if table has triggers.
      0e47753f
  2. 01 Jul, 2006 3 commits
    • unknown's avatar
      Merge mysql.com:/home/dlenev/mysql-5.0-bg18437-3 · 44386279
      unknown authored
      into  mysql.com:/home/dlenev/mysql-5.1-bg18437
      
      
      sql/mysql_priv.h:
        Auto merged
      sql/sql_load.cc:
        Auto merged
      sql/sql_table.cc:
        Auto merged
      sql/sql_trigger.cc:
        Auto merged
      include/my_base.h:
        Manual merge.
      mysql-test/r/federated.result:
        Manual merge.
      mysql-test/r/ndb_replace.result:
        Manual merge.
      mysql-test/t/federated.test:
        Manual merge.
      sql/ha_ndbcluster.cc:
        Manual merge.
      sql/item.cc:
        Manual merge.
      sql/sql_delete.cc:
        Manual merge.
      sql/sql_insert.cc:
        Manual merge.
      sql/sql_parse.cc:
        Manual merge.
      sql/sql_trigger.h:
        Manual merge.
      sql/sql_update.cc:
        Manual merge.
      44386279
    • 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 epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.1 · 50a8fba8
      unknown authored
      into moonbone.local:/work/merge-5.1
      
      
      50a8fba8
  3. 30 Jun, 2006 8 commits
    • unknown's avatar
      Reverted wrong bug fix (Bug#11228) · b3523520
      unknown authored
      
      mysql-test/t/key.test:
        Added SHOW CREATE TABLE, which is the proper way to check for table definitions
      mysql-test/r/key.result:
        Fixed result after removing wrong bug fix
      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'
      b3523520
    • unknown's avatar
      Merge bk-internal:/home/bk/mysql-5.1 · a7857cc3
      unknown authored
      into  mysql.com:/data0/knielsen/tmp-5.1
      
      
      a7857cc3
    • unknown's avatar
      Merge mysql.com:/usr/local/mysql/mysql-5.1-bindist · f3a674df
      unknown authored
      into  mysql.com:/usr/local/mysql/tmp-5.1
      
      
      scripts/Makefile.am:
        Auto merged
      f3a674df
    • unknown's avatar
      Add a script scripts/make_win_bin_dist, used to generate a Windows · 6b0ebe20
      unknown authored
      binary disctribution for Falcon.
      
      
      scripts/Makefile.am:
        Add the make_win_bin_dist script.
      scripts/make_win_bin_dist:
        New BitKeeper file ``scripts/make_win_bin_dist''
      6b0ebe20
    • unknown's avatar
      Merge moonbone.local:/home/evgen/bk-trees/mysql-5.0-opt · 9bec4188
      unknown authored
      into moonbone.local:/work/merge-5.1
      
      
      mysql-test/r/ctype_ucs.result:
        Auto merged
      mysql-test/r/ctype_utf8.result:
        Auto merged
      mysql-test/t/ctype_ucs.test:
        Auto merged
      sql/item_cmpfunc.h:
        Auto merged
      sql/item_sum.cc:
        Auto merged
      sql/opt_range.cc:
        Auto merged
      sql/spatial.h:
        Auto merged
      sql/sql_select.cc:
        Auto merged
      sql/sql_select.h:
        Auto merged
      sql/sql_update.cc:
        Auto merged
      strings/ctype-mb.c:
        Auto merged
      9bec4188
    • unknown's avatar
      Manual merge · c6f798a1
      unknown authored
      
      mysql-test/mysql-test-run.sh:
        Auto merged
      mysql-test/r/ctype_utf8.result:
        Auto merged
      mysql-test/r/func_str.result:
        Auto merged
      mysql-test/r/func_time.result:
        Auto merged
      mysql-test/r/insert_select.result:
        Auto merged
      mysql-test/r/key.result:
        Auto merged
      mysql-test/r/myisam.result:
        Auto merged
      mysql-test/r/select.result:
        Auto merged
      mysql-test/r/sp-prelocking.result:
        Auto merged
      mysql-test/r/sp.result:
        Auto merged
      mysql-test/r/view_grant.result:
        Auto merged
      mysql-test/t/func_time.test:
        Auto merged
      mysql-test/t/key.test:
        Auto merged
      mysql-test/t/myisam.test:
        Auto merged
      mysql-test/t/select.test:
        Auto merged
      mysql-test/t/sp-prelocking.test:
        Auto merged
      mysql-test/t/sp.test:
        Auto merged
      mysql-test/t/view_grant.test:
        Auto merged
      mysql-test/valgrind.supp:
        Auto merged
      mysys/Makefile.am:
        Auto merged
      sql/field.cc:
        Auto merged
      sql/field.h:
        Auto merged
      sql/ha_ndbcluster.cc:
        Auto merged
      sql/item_cmpfunc.cc:
        Auto merged
      sql/item_strfunc.cc:
        Auto merged
      sql/item_strfunc.h:
        Auto merged
      sql/mysql_priv.h:
        Auto merged
      sql/mysqld.cc:
        Auto merged
      sql/opt_sum.cc:
        Auto merged
      sql/slave.cc:
        Auto merged
      sql/sp_head.cc:
        Auto merged
      sql/sql_base.cc:
        Auto merged
      sql/sql_class.cc:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_select.cc:
        Auto merged
      sql/table.cc:
        Auto merged
      storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
        Auto merged
      storage/ndb/src/ndbapi/ndberror.c:
        Auto merged
      strings/ctype-mb.c:
        Auto merged
      support-files/mysql.spec.sh:
        Auto merged
      c6f798a1
    • unknown's avatar
      Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.1 · 936fcddb
      unknown authored
      into  mysql.com:/home/cps/mysql/trees/5.1-team
      
      
      936fcddb
    • unknown's avatar
      cleanup · 8c89c0d2
      unknown authored
      
      mysys/my_pread.c:
        don't set errno without a real error
      8c89c0d2
  4. 29 Jun, 2006 20 commits
  5. 28 Jun, 2006 8 commits