~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/storage_engine.cc

  • Committer: Brian Aker
  • Date: 2010-10-20 20:25:52 UTC
  • mto: (1864.2.1 merge)
  • mto: This revision was merged to the branch mainline in revision 1865.
  • Revision ID: brian@tangent.org-20101020202552-51y5sz5ledoxbp7t
Add support for --with-valgrind

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#include <google/protobuf/io/zero_copy_stream.h>
33
33
#include <google/protobuf/io/zero_copy_stream_impl.h>
34
34
 
35
 
#include "drizzled/my_hash.h"
36
35
#include "drizzled/cached_directory.h"
37
36
 
38
37
#include <drizzled/definitions.h>
53
52
#include "drizzled/db.h"
54
53
 
55
54
#include <drizzled/table_proto.h>
 
55
#include <drizzled/plugin/event_observer.h>
 
56
 
 
57
#include <drizzled/table/shell.h>
 
58
 
 
59
#include <boost/algorithm/string/compare.hpp>
56
60
 
57
61
static bool shutdown_has_begun= false; // Once we put in the container for the vector/etc for engines this will go away.
58
62
 
67
71
static EngineVector vector_of_engines;
68
72
static EngineVector vector_of_schema_engines;
69
73
 
 
74
const std::string DEFAULT_STRING("default");
70
75
const std::string UNKNOWN_STRING("UNKNOWN");
71
76
const std::string DEFAULT_DEFINITION_FILE_EXT(".dfe");
72
77
 
96
101
}
97
102
 
98
103
 
99
 
int StorageEngine::renameTable(Session &session, TableIdentifier &from, TableIdentifier &to)
 
104
int StorageEngine::renameTable(Session &session, const TableIdentifier &from, const TableIdentifier &to)
100
105
{
 
106
  int error;
101
107
  setTransactionReadWrite(session);
102
108
 
103
 
  return doRenameTable(session, from, to);
 
109
  if (unlikely(plugin::EventObserver::beforeRenameTable(session, from, to)))
 
110
  {
 
111
    error= ER_EVENT_OBSERVER_PLUGIN;
 
112
  }
 
113
  else
 
114
  {
 
115
    error =  doRenameTable(session, from, to);
 
116
    if (unlikely(plugin::EventObserver::afterRenameTable(session, from, to, error)))
 
117
    {
 
118
      error= ER_EVENT_OBSERVER_PLUGIN;
 
119
    }
 
120
  }
 
121
  
 
122
  return error;
104
123
}
105
124
 
106
125
/**
118
137
  @retval
119
138
    !0  Error
120
139
*/
121
 
int StorageEngine::doDropTable(Session&, TableIdentifier &identifier)
 
140
int StorageEngine::doDropTable(Session&, const TableIdentifier &identifier)
122
141
                               
123
142
{
124
143
  int error= 0;
175
194
class FindEngineByName
176
195
  : public unary_function<StorageEngine *, bool>
177
196
{
178
 
  const string &target;
 
197
  const string &predicate;
179
198
 
180
199
public:
181
200
  explicit FindEngineByName(const string &target_arg) :
182
 
    target(target_arg)
 
201
    predicate(target_arg)
183
202
  {
184
203
  }
 
204
 
185
205
  result_type operator() (argument_type engine)
186
206
  {
187
 
    string engine_name(engine->getName());
188
 
 
189
 
    transform(engine_name.begin(), engine_name.end(),
190
 
              engine_name.begin(), ::tolower);
191
 
    return engine_name == target;
 
207
    return boost::iequals(engine->getName(), predicate);
192
208
  }
193
209
};
194
210
 
195
 
StorageEngine *StorageEngine::findByName(const string &find_str)
 
211
StorageEngine *StorageEngine::findByName(const string &predicate)
196
212
{
197
 
  string search_string(find_str);
198
 
  transform(search_string.begin(), search_string.end(),
199
 
            search_string.begin(), ::tolower);
200
 
 
201
 
  
202
213
  EngineVector::iterator iter= find_if(vector_of_engines.begin(),
203
214
                                       vector_of_engines.end(),
204
 
                                       FindEngineByName(search_string));
 
215
                                       FindEngineByName(predicate));
205
216
  if (iter != vector_of_engines.end())
206
217
  {
207
218
    StorageEngine *engine= *iter;
212
223
  return NULL;
213
224
}
214
225
 
215
 
StorageEngine *StorageEngine::findByName(Session& session, const string &find_str)
 
226
StorageEngine *StorageEngine::findByName(Session& session, const string &predicate)
216
227
{
217
 
  string search_string(find_str);
218
 
  transform(search_string.begin(), search_string.end(),
219
 
            search_string.begin(), ::tolower);
220
 
 
221
 
  if (search_string.compare("default") == 0)
 
228
  if (boost::iequals(predicate, DEFAULT_STRING))
222
229
    return session.getDefaultStorageEngine();
223
230
 
224
231
  EngineVector::iterator iter= find_if(vector_of_engines.begin(),
225
232
                                       vector_of_engines.end(),
226
 
                                       FindEngineByName(search_string));
 
233
                                       FindEngineByName(predicate));
227
234
  if (iter != vector_of_engines.end())
228
235
  {
229
236
    StorageEngine *engine= *iter;
280
287
class StorageEngineGetTableDefinition: public unary_function<StorageEngine *,bool>
281
288
{
282
289
  Session& session;
283
 
  TableIdentifier &identifier;
 
290
  const TableIdentifier &identifier;
284
291
  message::Table &table_message;
285
292
  int &err;
286
293
 
287
294
public:
288
295
  StorageEngineGetTableDefinition(Session& session_arg,
289
 
                                  TableIdentifier &identifier_arg,
 
296
                                  const TableIdentifier &identifier_arg,
290
297
                                  message::Table &table_message_arg,
291
298
                                  int &err_arg) :
292
299
    session(session_arg), 
308
315
class StorageEngineDoesTableExist: public unary_function<StorageEngine *, bool>
309
316
{
310
317
  Session& session;
311
 
  TableIdentifier &identifier;
 
318
  const TableIdentifier &identifier;
312
319
 
313
320
public:
314
 
  StorageEngineDoesTableExist(Session& session_arg, TableIdentifier &identifier_arg) :
 
321
  StorageEngineDoesTableExist(Session& session_arg, const TableIdentifier &identifier_arg) :
315
322
    session(session_arg), 
316
323
    identifier(identifier_arg) 
317
324
  { }
326
333
  Utility method which hides some of the details of getTableDefinition()
327
334
*/
328
335
bool plugin::StorageEngine::doesTableExist(Session &session,
329
 
                                           TableIdentifier &identifier,
 
336
                                           const TableIdentifier &identifier,
330
337
                                           bool include_temporary_tables)
331
338
{
332
339
  if (include_temporary_tables)
347
354
  return true;
348
355
}
349
356
 
350
 
bool plugin::StorageEngine::doDoesTableExist(Session&, TableIdentifier&)
 
357
bool plugin::StorageEngine::doDoesTableExist(Session&, const drizzled::TableIdentifier&)
351
358
{
352
359
  cerr << " Engine was called for doDoesTableExist() and does not implement it: " << this->getName() << "\n";
353
360
  assert(0);
360
367
  or any dropped tables that need to be removed from disk
361
368
*/
362
369
int StorageEngine::getTableDefinition(Session& session,
363
 
                                      TableIdentifier &identifier,
 
370
                                      const TableIdentifier &identifier,
364
371
                                      message::Table &table_message,
365
372
                                      bool include_temporary_tables)
366
373
{
418
425
   returns ENOENT if the file doesn't exists.
419
426
*/
420
427
int StorageEngine::dropTable(Session& session,
421
 
                             TableIdentifier &identifier)
 
428
                             const TableIdentifier &identifier)
422
429
{
423
430
  int error= 0;
424
431
  int error_proto;
431
438
  {
432
439
    string error_message;
433
440
 
434
 
    error_message.append(identifier.getSQLPath());
 
441
    error_message.append(const_cast<TableIdentifier &>(identifier).getSQLPath());
435
442
    error_message.append(" : ");
436
443
    error_message.append(src_proto.InitializationErrorString());
437
444
 
444
451
 
445
452
  if (not engine)
446
453
  {
447
 
    my_error(ER_CORRUPT_TABLE_DEFINITION, MYF(0), identifier.getSQLPath().c_str());
 
454
    my_error(ER_CORRUPT_TABLE_DEFINITION, MYF(0), const_cast<TableIdentifier &>(identifier).getSQLPath().c_str());
448
455
 
449
456
    return ER_CORRUPT_TABLE_DEFINITION;
450
457
  }
459
466
 
460
467
int StorageEngine::dropTable(Session& session,
461
468
                             StorageEngine &engine,
462
 
                             TableIdentifier &identifier)
 
469
                             const TableIdentifier &identifier)
463
470
{
464
471
  int error;
465
472
 
466
473
  engine.setTransactionReadWrite(session);
467
 
  error= engine.doDropTable(session, identifier);
 
474
  
 
475
  if (unlikely(plugin::EventObserver::beforeDropTable(session, identifier)))
 
476
  {
 
477
    error= ER_EVENT_OBSERVER_PLUGIN;
 
478
  }
 
479
  else
 
480
  {
 
481
    error= engine.doDropTable(session, identifier);
 
482
    if (unlikely(plugin::EventObserver::afterDropTable(session, identifier, error)))
 
483
    {
 
484
      error= ER_EVENT_OBSERVER_PLUGIN;
 
485
    }
 
486
  }
 
487
 
468
488
 
469
489
  return error;
470
490
}
479
499
   1  error
480
500
*/
481
501
int StorageEngine::createTable(Session &session,
482
 
                               TableIdentifier &identifier,
483
 
                               bool update_create_info,
 
502
                               const TableIdentifier &identifier,
484
503
                               message::Table& table_message)
485
504
{
486
505
  int error= 1;
487
 
  Table table;
488
 
  TableShare share(identifier.getSchemaName().c_str(), 0, identifier.getTableName().c_str(), identifier.getPath().c_str());
 
506
  TableShare share(identifier);
 
507
  table::Shell table(share);
489
508
  message::Table tmp_proto;
490
509
 
491
 
  if (parse_table_proto(session, table_message, &share) || open_table_from_share(&session, &share, "", 0, 0, &table))
 
510
  if (share.parse_table_proto(session, table_message) || share.open_table_from_share(&session, identifier, "", 0, 0, table))
492
511
  { 
493
512
    // @note Error occured, we should probably do a little more here.
494
513
  }
495
514
  else
496
515
  {
497
 
    if (update_create_info)
498
 
      table.updateCreateInfo(&table_message);
499
 
 
500
516
    /* Check for legal operations against the Engine using the proto (if used) */
501
517
    if (table_message.type() == message::Table::TEMPORARY &&
502
518
        share.storage_engine->check_flag(HTON_BIT_TEMPORARY_NOT_SUPPORTED) == true)
520
536
 
521
537
    if (error)
522
538
    {
523
 
      my_error(ER_CANT_CREATE_TABLE, MYF(ME_BELL+ME_WAITTANG), identifier.getSQLPath().c_str(), error);
 
539
      my_error(ER_CANT_CREATE_TABLE, MYF(ME_BELL+ME_WAITTANG), const_cast<TableIdentifier &>(identifier).getSQLPath().c_str(), error);
524
540
    }
525
541
 
526
 
    table.closefrm(false);
 
542
    table.delete_table();
527
543
  }
528
544
 
529
 
  share.free_table_share();
530
545
  return(error != 0);
531
546
}
532
547
 
533
 
Cursor *StorageEngine::getCursor(TableShare &share, memory::Root *alloc)
 
548
Cursor *StorageEngine::getCursor(TableShare &share)
534
549
{
535
 
  return create(share, alloc);
 
550
  return create(share);
536
551
}
537
552
 
538
 
class AddTableName : 
539
 
  public unary_function<StorageEngine *, void>
540
 
{
541
 
  CachedDirectory &directory;
542
 
  SchemaIdentifier &identifier;
543
 
  TableNameList &set_of_names;
544
 
 
545
 
public:
546
 
 
547
 
  AddTableName(CachedDirectory &directory_arg, SchemaIdentifier &identifier_arg, set<string>& of_names) :
548
 
    directory(directory_arg),
549
 
    identifier(identifier_arg),
550
 
    set_of_names(of_names)
551
 
  {
552
 
  }
553
 
 
554
 
  result_type operator() (argument_type engine)
555
 
  {
556
 
    engine->doGetTableNames(directory, identifier, set_of_names);
557
 
  }
558
 
};
559
 
 
560
553
class AddTableIdentifier : 
561
554
  public unary_function<StorageEngine *, void>
562
555
{
563
556
  CachedDirectory &directory;
564
 
  SchemaIdentifier &identifier;
 
557
  const SchemaIdentifier &identifier;
565
558
  TableIdentifiers &set_of_identifiers;
566
559
 
567
560
public:
568
561
 
569
 
  AddTableIdentifier(CachedDirectory &directory_arg, SchemaIdentifier &identifier_arg, TableIdentifiers &of_names) :
 
562
  AddTableIdentifier(CachedDirectory &directory_arg, const SchemaIdentifier &identifier_arg, TableIdentifiers &of_names) :
570
563
    directory(directory_arg),
571
564
    identifier(identifier_arg),
572
565
    set_of_identifiers(of_names)
580
573
};
581
574
 
582
575
 
583
 
static SchemaIdentifier INFORMATION_SCHEMA_IDENTIFIER("information_schema");
584
 
static SchemaIdentifier DATA_DICTIONARY_IDENTIFIER("data_dictionary");
585
 
 
586
 
void StorageEngine::getTableNames(Session &session, SchemaIdentifier &schema_identifier, TableNameList &set_of_names)
587
 
{
588
 
  CachedDirectory directory(schema_identifier.getPath(), set_of_table_definition_ext);
589
 
 
590
 
  if (schema_identifier == INFORMATION_SCHEMA_IDENTIFIER)
591
 
  { }
592
 
  else if (schema_identifier == DATA_DICTIONARY_IDENTIFIER)
593
 
  { }
594
 
  else
595
 
  {
596
 
    if (directory.fail())
597
 
    {
598
 
      errno= directory.getError();
599
 
      if (errno == ENOENT)
600
 
        my_error(ER_BAD_DB_ERROR, MYF(ME_BELL+ME_WAITTANG), schema_identifier.getSQLPath().c_str());
601
 
      else
602
 
        my_error(ER_CANT_READ_DIR, MYF(ME_BELL+ME_WAITTANG), directory.getPath(), errno);
603
 
      return;
604
 
    }
605
 
  }
606
 
 
607
 
  for_each(vector_of_engines.begin(), vector_of_engines.end(),
608
 
           AddTableName(directory, schema_identifier, set_of_names));
609
 
 
610
 
  session.doGetTableNames(directory, schema_identifier, set_of_names);
611
 
}
612
 
 
613
 
void StorageEngine::getTableIdentifiers(Session &session, SchemaIdentifier &schema_identifier, TableIdentifiers &set_of_identifiers)
614
 
{
615
 
  CachedDirectory directory(schema_identifier.getPath(), set_of_table_definition_ext);
616
 
 
617
 
  if (schema_identifier == INFORMATION_SCHEMA_IDENTIFIER)
618
 
  { }
619
 
  else if (schema_identifier == DATA_DICTIONARY_IDENTIFIER)
620
 
  { }
621
 
  else
622
 
  {
623
 
    if (directory.fail())
624
 
    {
625
 
      errno= directory.getError();
626
 
      if (errno == ENOENT)
627
 
        my_error(ER_BAD_DB_ERROR, MYF(ME_BELL+ME_WAITTANG), schema_identifier.getSQLPath().c_str());
 
576
void StorageEngine::getIdentifiers(Session &session, const SchemaIdentifier &schema_identifier, TableIdentifiers &set_of_identifiers)
 
577
{
 
578
  static SchemaIdentifier INFORMATION_SCHEMA_IDENTIFIER("information_schema");
 
579
  static SchemaIdentifier DATA_DICTIONARY_IDENTIFIER("data_dictionary");
 
580
 
 
581
  CachedDirectory directory(schema_identifier.getPath(), set_of_table_definition_ext);
 
582
 
 
583
  if (schema_identifier == INFORMATION_SCHEMA_IDENTIFIER)
 
584
  { }
 
585
  else if (schema_identifier == DATA_DICTIONARY_IDENTIFIER)
 
586
  { }
 
587
  else
 
588
  {
 
589
    if (directory.fail())
 
590
    {
 
591
      errno= directory.getError();
 
592
      if (errno == ENOENT)
 
593
        my_error(ER_BAD_DB_ERROR, MYF(ME_BELL+ME_WAITTANG), const_cast<SchemaIdentifier &>(schema_identifier).getSQLPath().c_str());
628
594
      else
629
595
        my_error(ER_CANT_READ_DIR, MYF(ME_BELL+ME_WAITTANG), directory.getPath(), errno);
630
596
      return;
637
603
  session.doGetTableIdentifiers(directory, schema_identifier, set_of_identifiers);
638
604
}
639
605
 
 
606
class DropTable: public unary_function<TableIdentifier&, bool>
 
607
{
 
608
  Session &session;
 
609
  StorageEngine *engine;
 
610
 
 
611
public:
 
612
 
 
613
  DropTable(Session &session_arg, StorageEngine *engine_arg) :
 
614
    session(session_arg),
 
615
    engine(engine_arg)
 
616
  { }
 
617
 
 
618
  result_type operator() (argument_type identifier)
 
619
  {
 
620
    return engine->doDropTable(session, identifier) == 0;
 
621
  } 
 
622
};
 
623
 
640
624
/* This will later be converted to TableIdentifiers */
641
625
class DropTables: public unary_function<StorageEngine *, void>
642
626
{
643
627
  Session &session;
644
 
  TableIdentifierList &table_identifiers;
 
628
  TableIdentifiers &table_identifiers;
645
629
 
646
630
public:
647
631
 
648
 
  DropTables(Session &session_arg, TableIdentifierList &table_identifiers_arg) :
 
632
  DropTables(Session &session_arg, TableIdentifiers &table_identifiers_arg) :
649
633
    session(session_arg),
650
634
    table_identifiers(table_identifiers_arg)
651
635
  { }
652
636
 
653
637
  result_type operator() (argument_type engine)
654
638
  {
655
 
    for (TableIdentifierList::iterator iter= table_identifiers.begin();
656
 
         iter != table_identifiers.end();
657
 
         iter++)
658
 
    {
659
 
      int error= engine->doDropTable(session, const_cast<TableIdentifier&>(*iter));
660
 
 
661
 
      // On a return of zero we know we found and deleted the table. So we
662
 
      // remove it from our search.
663
 
      if (not error)
664
 
        table_identifiers.erase(iter);
665
 
    }
 
639
    // True returning from DropTable means the table has been successfully
 
640
    // deleted, so it should be removed from the list of tables to drop
 
641
    table_identifiers.erase(remove_if(table_identifiers.begin(),
 
642
                                      table_identifiers.end(),
 
643
                                      DropTable(session, engine)),
 
644
                            table_identifiers.end());
666
645
  }
667
646
};
668
647
 
674
653
void StorageEngine::removeLostTemporaryTables(Session &session, const char *directory)
675
654
{
676
655
  CachedDirectory dir(directory, set_of_table_definition_ext);
677
 
  TableIdentifierList table_identifiers;
 
656
  TableIdentifiers table_identifiers;
678
657
 
679
658
  if (dir.fail())
680
659
  {
750
729
  @note
751
730
    In case of delete table it's only safe to use the following parts of
752
731
    the 'table' structure:
753
 
    - table->s->path
 
732
    - table->getShare()->path
754
733
    - table->alias
755
734
*/
756
735
void StorageEngine::print_error(int error, myf errflag, Table &table)
787
766
    {
788
767
      const char *err_msg= ER(ER_DUP_ENTRY_WITH_KEY_NAME);
789
768
 
790
 
      if (key_nr == 0 &&
791
 
          (table->key_info[0].key_part[0].field->flags &
792
 
           AUTO_INCREMENT_FLAG)
793
 
          && (current_session)->lex->sql_command == SQLCOM_ALTER_TABLE)
794
 
      {
795
 
        err_msg= ER(ER_DUP_ENTRY_AUTOINCREMENT_CASE);
796
 
      }
797
 
 
798
769
      print_keydup_error(key_nr, err_msg, *table);
 
770
 
799
771
      return;
800
772
    }
801
773
    textno=ER_DUP_KEY;
822
794
        str.length(max_length-4);
823
795
        str.append(STRING_WITH_LEN("..."));
824
796
      }
825
 
      my_error(ER_FOREIGN_DUPLICATE_KEY, MYF(0), table->s->table_name.str,
 
797
      my_error(ER_FOREIGN_DUPLICATE_KEY, MYF(0), table->getShare()->getTableName(),
826
798
        str.c_ptr(), key_nr+1);
827
799
      return;
828
800
    }
900
872
    break;
901
873
  case HA_ERR_NO_SUCH_TABLE:
902
874
    assert(table);
903
 
    my_error(ER_NO_SUCH_TABLE, MYF(0), table->s->getSchemaName(),
904
 
             table->s->table_name.str);
 
875
    my_error(ER_NO_SUCH_TABLE, MYF(0), table->getShare()->getSchemaName(),
 
876
             table->getShare()->getTableName());
905
877
    return;
906
878
  case HA_ERR_RBR_LOGGING_FAILED:
907
879
    textno= ER_BINLOG_ROW_LOGGING_FAILED;
957
929
      return;
958
930
    }
959
931
  }
960
 
  my_error(textno, errflag, table->s->table_name.str, error);
 
932
  my_error(textno, errflag, table->getShare()->getTableName(), error);
961
933
}
962
934
 
963
935
 
1004
976
}
1005
977
 
1006
978
 
1007
 
int StorageEngine::deleteDefinitionFromPath(TableIdentifier &identifier)
 
979
int StorageEngine::deleteDefinitionFromPath(const TableIdentifier &identifier)
1008
980
{
1009
981
  string path(identifier.getPath());
1010
982
 
1013
985
  return internal::my_delete(path.c_str(), MYF(0));
1014
986
}
1015
987
 
1016
 
int StorageEngine::renameDefinitionFromPath(TableIdentifier &dest, TableIdentifier &src)
 
988
int StorageEngine::renameDefinitionFromPath(const TableIdentifier &dest, const TableIdentifier &src)
1017
989
{
1018
990
  message::Table table_message;
1019
991
  string src_path(src.getPath());
1042
1014
  return error;
1043
1015
}
1044
1016
 
1045
 
int StorageEngine::writeDefinitionFromPath(TableIdentifier &identifier, message::Table &table_message)
 
1017
int StorageEngine::writeDefinitionFromPath(const TableIdentifier &identifier, message::Table &table_message)
1046
1018
{
1047
1019
  char definition_file_tmp[FN_REFLEN];
1048
1020
  string file_name(identifier.getPath());
1062
1034
  google::protobuf::io::ZeroCopyOutputStream* output=
1063
1035
    new google::protobuf::io::FileOutputStream(fd);
1064
1036
 
1065
 
  if (not table_message.SerializeToZeroCopyStream(output))
 
1037
  bool success;
 
1038
 
 
1039
  try {
 
1040
    success= table_message.SerializeToZeroCopyStream(output);
 
1041
  }
 
1042
  catch (...)
 
1043
  {
 
1044
    success= false;
 
1045
  }
 
1046
 
 
1047
  if (not success)
1066
1048
  {
1067
1049
    my_error(ER_CORRUPT_TABLE_DEFINITION, MYF(0),
1068
1050
             table_message.InitializationErrorString().c_str());
1106
1088
 
1107
1089
class CanCreateTable: public unary_function<StorageEngine *, bool>
1108
1090
{
1109
 
  TableIdentifier &identifier;
 
1091
  const TableIdentifier &identifier;
1110
1092
 
1111
1093
public:
1112
 
  CanCreateTable(TableIdentifier &identifier_arg) :
 
1094
  CanCreateTable(const TableIdentifier &identifier_arg) :
1113
1095
    identifier(identifier_arg)
1114
1096
  { }
1115
1097
 
1123
1105
/**
1124
1106
  @note on success table can be created.
1125
1107
*/
1126
 
bool StorageEngine::canCreateTable(drizzled::TableIdentifier &identifier)
 
1108
bool StorageEngine::canCreateTable(const TableIdentifier &identifier)
1127
1109
{
1128
1110
  EngineVector::iterator iter=
1129
1111
    find_if(vector_of_engines.begin(), vector_of_engines.end(),
1143
1125
 
1144
1126
  if (input.good())
1145
1127
  {
1146
 
    if (table_message.ParseFromIstream(&input))
 
1128
    try {
 
1129
      if (table_message.ParseFromIstream(&input))
 
1130
      {
 
1131
        return true;
 
1132
      }
 
1133
    }
 
1134
    catch (...)
1147
1135
    {
1148
 
      return true;
 
1136
      my_error(ER_CORRUPT_TABLE_DEFINITION, MYF(0),
 
1137
               table_message.InitializationErrorString().empty() ? "": table_message.InitializationErrorString().c_str());
1149
1138
    }
1150
 
 
1151
 
    my_error(ER_CORRUPT_TABLE_DEFINITION, MYF(0),
1152
 
             table_message.InitializationErrorString().c_str());
1153
1139
  }
1154
1140
  else
1155
1141
  {