42
42
#include "drizzled/sql_base.h"
43
43
#include "drizzled/pthread_globals.h"
44
44
#include "drizzled/internal/my_pthread.h"
45
#include "drizzled/plugin/event_observer.h"
47
46
#include "drizzled/table.h"
48
47
#include "drizzled/table/shell.h"
425
422
blob_ptr_size(portable_sizeof_char_ptr),
426
423
db_low_byte_first(false),
429
event_observers(NULL)
431
427
private_key_for_cache= identifier.getKey();
432
428
assert(identifier.getPath().size()); // Since we are doing a create table, this should be a positive value
1548
1541
int TableShare::open_table_def(Session& session, const identifier::Table &identifier)
1556
message::table::shared_ptr table;
1558
local_error= plugin::StorageEngine::getTableDefinition(session, identifier, table);
1561
if (local_error != EEXIST)
1563
if (local_error > 0)
1570
if (not table->IsInitialized())
1578
local_error= parse_table_proto(session, *table);
1580
setTableCategory(TABLE_CATEGORY_USER);
1583
if (local_error && !error_given)
1586
open_table_error(error, (open_errno= errno), 0);
1543
drizzled::error_t local_error= EE_OK;
1545
message::table::shared_ptr table= plugin::StorageEngine::getTableMessage(session, identifier, local_error);
1547
if (table and table->IsInitialized())
1549
if (parse_table_proto(session, *table))
1551
local_error= ER_CORRUPT_TABLE_DEFINITION_UNKNOWN;
1552
my_error(ER_CORRUPT_TABLE_DEFINITION_UNKNOWN, identifier);
1556
setTableCategory(TABLE_CATEGORY_USER);
1560
else if (table and not table->IsInitialized())
1562
local_error= ER_CORRUPT_TABLE_DEFINITION_UNKNOWN;
1563
my_error(ER_CORRUPT_TABLE_DEFINITION_UNKNOWN, identifier);
1567
local_error= ER_TABLE_UNKNOWN;
1568
my_error(ER_TABLE_UNKNOWN, identifier);
1571
return static_cast<int>(local_error);
1841
1823
if (db_errno == ENOENT)
1843
my_error(ER_NO_SUCH_TABLE, MYF(0), db.str, table_name.str);
1825
identifier::Table identifier(db.str, table_name.str);
1826
my_error(ER_TABLE_UNKNOWN, identifier);