~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/embedded_innodb/embedded_innodb_engine.cc

  • Committer: Brian Aker
  • Date: 2010-06-15 13:37:26 UTC
  • Revision ID: brian@gaz-20100615133726-160z0ql8gxi8s3rg
This is a rollup set of patches for modifications to TableIdentifier to have
a getKey() which is now used for open_cache and table_share_def cache. This
also includes additional unittests on TableIdentifier, and makes use of some
cleanup, though not perfect, to TableShare for its contructors.

Show diffs side-by-side

added added

removed removed

Lines of Context:
632
632
  thr_lock_data_init(&share->lock, &lock, NULL);
633
633
 
634
634
 
635
 
  if (table->getShare()->primary_key != MAX_KEY)
636
 
    ref_length= table->key_info[table->getShare()->primary_key].key_length;
 
635
  if (table->getShare()->getPrimaryKey() != MAX_KEY)
 
636
    ref_length= table->key_info[table->getShare()->getPrimaryKey()].key_length;
637
637
  else if (share->has_hidden_primary_key)
638
638
    ref_length= sizeof(uint64_t);
639
639
  else
1644
1644
  {
1645
1645
    if (write_can_replace)
1646
1646
    {
1647
 
      store_key_value_from_innodb(table->key_info + table->getShare()->primary_key,
 
1647
      store_key_value_from_innodb(table->key_info + table->getShare()->getPrimaryKey(),
1648
1648
                                  ref, ref_length, record);
1649
1649
 
1650
1650
      ib_tpl_t search_tuple= ib_clust_search_tuple_create(cursor);
1812
1812
  int colnr= 0;
1813
1813
 
1814
1814
  /* We need the primary key for ::position() to work */
1815
 
  if (table->s->primary_key != MAX_KEY)
1816
 
    table->mark_columns_used_by_index_no_reset(table->s->primary_key);
 
1815
  if (table->s->getPrimaryKey() != MAX_KEY)
 
1816
    table->mark_columns_used_by_index_no_reset(table->s->getPrimaryKey());
1817
1817
 
1818
1818
  for (Field **field= table->getFields() ; *field ; field++, colnr++)
1819
1819
  {
2006
2006
 
2007
2007
void EmbeddedInnoDBCursor::position(const unsigned char *record)
2008
2008
{
2009
 
  if (table->getShare()->primary_key != MAX_KEY)
2010
 
    store_key_value_from_innodb(table->key_info + table->getShare()->primary_key,
 
2009
  if (table->getShare()->getPrimaryKey() != MAX_KEY)
 
2010
    store_key_value_from_innodb(table->key_info + table->getShare()->getPrimaryKey(),
2011
2011
                                ref, ref_length, record);
2012
2012
  else
2013
2013
    *((uint64_t*) ref)= hidden_autoinc_pkey_position;