~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/storage_engine.cc

Update to interface for getTableDefinition.

Show diffs side-by-side

added added

removed removed

Lines of Context:
487
487
class StorageEngineGetTableDefition: public unary_function<plugin::StorageEngine *,bool>
488
488
{
489
489
  const char* path;
 
490
  const char *db;
 
491
  const char *table_name;
 
492
  const bool is_tmp;
490
493
  message::Table *table_proto;
491
494
  int *err;
 
495
 
492
496
public:
493
497
  StorageEngineGetTableDefition(const char* path_arg,
494
 
                             message::Table *table_proto_arg,
495
 
                             int *err_arg)
496
 
  :path(path_arg), table_proto(table_proto_arg), err(err_arg) {}
 
498
                                const char *db_arg,
 
499
                                const char *table_name_arg,
 
500
                                const bool is_tmp_arg,
 
501
                                message::Table *table_proto_arg,
 
502
                                int *err_arg)
 
503
    :path(path_arg), 
 
504
    db(db_arg),
 
505
    table_name(table_name_arg),
 
506
    is_tmp(is_tmp_arg),
 
507
    table_proto(table_proto_arg), 
 
508
    err(err_arg) {}
497
509
 
498
510
  result_type operator() (argument_type engine)
499
511
  {
500
 
    int ret= engine->doGetTableDefinition(path, table_proto);
 
512
    int ret= engine->doGetTableDefinition(path, 
 
513
                                          db,
 
514
                                          table_name,
 
515
                                          is_tmp,
 
516
                                          table_proto);
501
517
 
502
518
    if (ret != ENOENT)
503
519
      *err= ret;
534
550
  or any dropped tables that need to be removed from disk
535
551
*/
536
552
int plugin::StorageEngine::getTableDefinition(const char* path,
537
 
                                         message::Table *table_proto)
 
553
                                              const char *,
 
554
                                              const char *,
 
555
                                              const bool,
 
556
                                              message::Table *table_proto)
538
557
{
539
558
  int err= ENOENT;
540
559
 
541
560
  vector<plugin::StorageEngine *>::iterator iter=
542
561
    find_if(vector_of_engines.begin(), vector_of_engines.end(),
543
 
            StorageEngineGetTableDefition(path, table_proto, &err));
 
562
            StorageEngineGetTableDefition(path, NULL, NULL, true, table_proto, &err));
544
563
 
545
564
  if (iter == vector_of_engines.end())
546
565
  {
612
631
  message::Table src_proto;
613
632
  plugin::StorageEngine* engine;
614
633
 
615
 
  error_proto= plugin::StorageEngine::getTableDefinition(path, &src_proto);
 
634
  error_proto= plugin::StorageEngine::getTableDefinition(path, 
 
635
                                                         db,
 
636
                                                         alias,
 
637
                                                         true,
 
638
                                                         &src_proto);
616
639
 
617
640
  engine= plugin::StorageEngine::findByName(session,
618
641
                                            src_proto.engine().name());