~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/csv/ha_tina.cc

  • Committer: Brian Aker
  • Date: 2010-10-15 00:59:36 UTC
  • mfrom: (1849 staging)
  • mto: This revision was merged to the branch mainline in revision 1853.
  • Revision ID: brian@tangent.org-20101015005936-znhvkz8khs4fhlyv
Merge with trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
    pthread_mutex_destroy(&tina_mutex);
113
113
  }
114
114
 
115
 
  virtual Cursor *create(Table &table)
 
115
  virtual Cursor *create(TableShare &table)
116
116
  {
117
117
    return new ha_tina(*this, table);
118
118
  }
144
144
 
145
145
  void doGetTableIdentifiers(drizzled::CachedDirectory &directory,
146
146
                             const drizzled::SchemaIdentifier &schema_identifier,
147
 
                             drizzled::TableIdentifier::vector &set_of_identifiers);
 
147
                             drizzled::TableIdentifiers &set_of_identifiers);
148
148
};
149
149
 
150
150
void Tina::doGetTableIdentifiers(drizzled::CachedDirectory&,
151
151
                                 const drizzled::SchemaIdentifier&,
152
 
                                 drizzled::TableIdentifier::vector&)
 
152
                                 drizzled::TableIdentifiers&)
153
153
{
154
154
}
155
155
 
167
167
    }
168
168
  }
169
169
 
170
 
  session.getMessageCache().renameTableMessage(from, to);
 
170
  session.renameTableMessage(from, to);
171
171
 
172
172
  return error;
173
173
}
174
174
 
175
175
bool Tina::doDoesTableExist(Session &session, const drizzled::TableIdentifier &identifier)
176
176
{
177
 
  return session.getMessageCache().doesTableMessageExist(identifier);
 
177
  return session.doesTableMessageExist(identifier);
178
178
}
179
179
 
180
180
 
201
201
    error= enoent_or_zero;
202
202
  }
203
203
 
204
 
  session.getMessageCache().removeTableMessage(identifier);
 
204
  session.removeTableMessage(identifier);
205
205
 
206
206
  return error;
207
207
}
232
232
                               const drizzled::TableIdentifier &identifier,
233
233
                               drizzled::message::Table &table_message)
234
234
{
235
 
  if (session.getMessageCache().getTableMessage(identifier, table_message))
 
235
  if (session.getTableMessage(identifier, table_message))
236
236
    return EEXIST;
237
237
 
238
238
  return ENOENT;
279
279
{
280
280
  pthread_mutex_lock(&tina_mutex);
281
281
 
282
 
  Tina *a_tina= static_cast<Tina *>(getEngine());
 
282
  Tina *a_tina= static_cast<Tina *>(engine);
283
283
  share= a_tina->findOpenTable(table_name);
284
284
 
285
285
  std::string meta_file_name;
481
481
      share->tina_write_opened= false;
482
482
    }
483
483
 
484
 
    Tina *a_tina= static_cast<Tina *>(getEngine());
 
484
    Tina *a_tina= static_cast<Tina *>(engine);
485
485
    a_tina->deleteOpenTable(share->table_name);
486
486
    delete share;
487
487
  }
530
530
 
531
531
 
532
532
 
533
 
ha_tina::ha_tina(drizzled::plugin::StorageEngine &engine_arg, Table &table_arg)
 
533
ha_tina::ha_tina(drizzled::plugin::StorageEngine &engine_arg, TableShare &table_arg)
534
534
  :Cursor(engine_arg, table_arg),
535
535
  /*
536
536
    These definitions are found in Cursor.h
557
557
 
558
558
  buffer.length(0);
559
559
 
560
 
  for (Field **field= getTable()->getFields() ; *field ; field++)
 
560
  for (Field **field= table->getFields() ; *field ; field++)
561
561
  {
562
562
    const char *ptr;
563
563
    const char *end_ptr;
675
675
 
676
676
  error= HA_ERR_CRASHED_ON_USAGE;
677
677
 
678
 
  memset(buf, 0, getTable()->getShare()->null_bytes);
 
678
  memset(buf, 0, table->getShare()->null_bytes);
679
679
 
680
 
  for (Field **field= getTable()->getFields() ; *field ; field++)
 
680
  for (Field **field=table->getFields() ; *field ; field++)
681
681
  {
682
682
    char curr_char;
683
683
 
746
746
    {
747
747
      /* This masks a bug in the logic for a SELECT * */
748
748
      (*field)->setWriteSet();
749
 
      if ((*field)->store_and_check(CHECK_FIELD_WARN, buffer.c_ptr(), buffer.length(), buffer.charset()))
750
 
      {
 
749
      if ((*field)->store(buffer.ptr(), buffer.length(), buffer.charset(),
 
750
                          CHECK_FIELD_WARN))
751
751
        goto err;
752
 
      }
753
752
 
754
753
      if ((*field)->flags & BLOB_FLAG)
755
754
      {
1309
1308
 
1310
1309
  internal::my_close(create_file, MYF(0));
1311
1310
 
1312
 
  session.getMessageCache().storeTableMessage(identifier, create_proto);
 
1311
  session.storeTableMessage(identifier, create_proto);
1313
1312
 
1314
1313
  return 0;
1315
1314
}