• unknown's avatar
    WL 1682: Use bitvector instead of query_id to tell handler which fields · 5d3af2b0
    unknown authored
    to read and write
    Changed Server code, added new interface to handler and changed the
    NDB handler, InnoDB handler and Federated handler that previously used
    query_id
    Bug#10202 fix (one-liner fix for memory leak)
    
    
    mysys/my_bitmap.c:
      Debug code
    sql/field.cc:
      Initialise fieldnr to 0 if not set anywhere else
    sql/field.h:
      Introduce a fieldnr (first field = 1 and last = table->s->fields
      in field object to be able to quickly set appropriate bit in
      read/write set
    sql/ha_federated.cc:
      Changed federated handler to use write set instead of query_id
    sql/ha_innodb.cc:
      Changed InnoDB handler to use write set instead of query_id
    sql/ha_ndbcluster.cc:
      Changed NDB handler to use write set instead of query_id
    sql/ha_ndbcluster.h:
      Changed NDB handler to use write set instead of query_id
    sql/handler.cc:
      Allocate read_set and write_set either in get_new_handler or in
      special routine
      Routines used at destruction of handler object
      plus routine to set all primary key fields in read_set
    sql/handler.h:
      bool to keep track if read/write set allocated or not in handler
      Deallocate read/write set at delete of handler object
      New bitmap's for read/write set
    sql/item.cc:
      Set bits in read or write set (set_query_id = 2 => write_set
      set_query_id = 1 => read_set
    sql/lock.cc:
      Clear bit set when starting a new statement in external lock
    sql/mysql_priv.h:
      changed set_query_id from bool to ulong
    sql/opt_range.cc:
      Set primary key read set in all places where HA_EXTRA_RETRIEVE_PRIMARY_KEY
      is used
    sql/sql_acl.cc:
      set all bits in read set all places where HA_EXTRA_RETRIEVE_ALL_COLS
      are used
    sql/sql_base.cc:
      Clear all bits before start new statement when table locked already
      Set bit in read/write set dependent on set_query_id and fieldnr
      bool -> ulong for set_query_id
      set all bits in read set for SELECT * queries where table is not view
    sql/sql_class.h:
      Added comments + changed type of set_query_id
    sql/sql_insert.cc:
      Use 2 when setup_fields called for fields to updated in UPDATE
      and INSERT statements
      set primary key fields when EXTRA param used
    sql/sql_load.cc:
      Set all bits in write set if no fields specified in LOAD DATA FROM
      INFILE
      Otherwise use 2 to set specific fields to be updated by LOAD DATA...
    sql/sql_select.cc:
      Set primary key read set when EXTRA param specified
      Set fieldnr for temporary tables
      Set number of fields before calling get_new_handler
      and only set all bits if there at least one field in table
    sql/sql_table.cc:
      Set all bits in read set for old table and all bits in write set for
      new table for ALTER TABLE copy method
      Set all bits in read set when EXTRA param used
    sql/sql_udf.cc:
      Set all bits in read set when EXTRA param used
    sql/sql_update.cc:
      Set fields to UPDATE to use 2 for set_query_id
      Set all bits in read set when EXTRA param used
    sql/table.cc:
      Set fieldnr in openfrm
      Reallocate read/write set in openfrm since table->s->fields==0
      at call to get_new_handler
    sql/unireg.cc:
      Fix Bug #10202
    5d3af2b0
lock.cc 27 KB