19
#include "drizzled/internal/my_bit.h"
19
#include <drizzled/internal/my_bit.h>
20
20
#include "myisampack.h"
21
21
#include "ha_myisam.h"
22
22
#include "myisam_priv.h"
23
#include "drizzled/option.h"
24
#include "drizzled/internal/my_bit.h"
25
#include "drizzled/internal/m_string.h"
26
#include "drizzled/util/test.h"
27
#include "drizzled/error.h"
28
#include "drizzled/errmsg_print.h"
29
#include "drizzled/gettext.h"
30
#include "drizzled/session.h"
31
#include "drizzled/plugin.h"
32
#include "drizzled/plugin/client.h"
33
#include "drizzled/table.h"
34
#include "drizzled/field/timestamp.h"
35
#include "drizzled/memory/multi_malloc.h"
36
#include "drizzled/plugin/daemon.h"
23
#include <drizzled/option.h>
24
#include <drizzled/internal/my_bit.h>
25
#include <drizzled/internal/m_string.h>
26
#include <drizzled/util/test.h>
27
#include <drizzled/error.h>
28
#include <drizzled/errmsg_print.h>
29
#include <drizzled/gettext.h>
30
#include <drizzled/session.h>
31
#include <drizzled/plugin.h>
32
#include <drizzled/plugin/client.h>
33
#include <drizzled/table.h>
34
#include <drizzled/memory/multi_malloc.h>
35
#include <drizzled/plugin/daemon.h>
37
#include <drizzled/plugin/storage_engine.h>
38
39
#include <boost/algorithm/string.hpp>
39
40
#include <boost/scoped_ptr.hpp>
118
119
int doCreateTable(Session&,
119
120
Table& table_arg,
120
const TableIdentifier &identifier,
121
const identifier::Table &identifier,
121
122
message::Table&);
123
int doRenameTable(Session&, const TableIdentifier &from, const TableIdentifier &to);
124
int doRenameTable(Session&, const identifier::Table &from, const identifier::Table &to);
125
int doDropTable(Session&, const TableIdentifier &identifier);
126
int doDropTable(Session&, const identifier::Table &identifier);
127
128
int doGetTableDefinition(Session& session,
128
const TableIdentifier &identifier,
129
const identifier::Table &identifier,
129
130
message::Table &table_message);
131
132
uint32_t max_supported_keys() const { return MI_MAX_KEY; }
141
142
HA_KEYREAD_ONLY);
143
bool doDoesTableExist(Session& session, const TableIdentifier &identifier);
144
bool doDoesTableExist(Session& session, const identifier::Table &identifier);
145
146
void doGetTableIdentifiers(drizzled::CachedDirectory &directory,
146
const drizzled::SchemaIdentifier &schema_identifier,
147
drizzled::TableIdentifier::vector &set_of_identifiers);
147
const drizzled::identifier::Schema &schema_identifier,
148
drizzled::identifier::Table::vector &set_of_identifiers);
148
149
bool validateCreateTableOption(const std::string &key, const std::string &state)
160
161
void MyisamEngine::doGetTableIdentifiers(drizzled::CachedDirectory&,
161
const drizzled::SchemaIdentifier&,
162
drizzled::TableIdentifier::vector&)
162
const drizzled::identifier::Schema&,
163
drizzled::identifier::Table::vector&)
166
bool MyisamEngine::doDoesTableExist(Session &session, const TableIdentifier &identifier)
167
bool MyisamEngine::doDoesTableExist(Session &session, const identifier::Table &identifier)
168
169
return session.getMessageCache().doesTableMessageExist(identifier);
171
172
int MyisamEngine::doGetTableDefinition(Session &session,
172
const TableIdentifier &identifier,
173
const identifier::Table &identifier,
173
174
message::Table &table_message)
175
176
if (session.getMessageCache().getTableMessage(identifier, table_message))
295
296
record= table_arg->getInsertRecord();
297
298
recinfo_pos= recinfo;
298
while (recpos < (uint) share->stored_rec_length)
300
while (recpos < (uint) share->sizeStoredRecord())
300
302
Field **field, *found= 0;
301
303
minpos= share->getRecordLength();
531
534
Session *cur_session;
532
535
if ((cur_session= file->in_use))
533
errmsg_printf(ERRMSG_LVL_ERROR, _("Got an error from thread_id=%"PRIu64", %s:%d"),
537
errmsg_printf(error::ERROR, _("Got an error from thread_id=%"PRIu64", %s:%d"),
534
538
cur_session->thread_id,
537
errmsg_printf(ERRMSG_LVL_ERROR, _("Got an error from unknown thread, %s:%d"), sfile, sline);
543
errmsg_printf(error::ERROR, _("Got an error from unknown thread, %s:%d"), sfile, sline);
539
errmsg_printf(ERRMSG_LVL_ERROR, "%s", message);
547
errmsg_printf(error::ERROR, "%s", message);
540
549
list<Session *>::iterator it= file->s->in_use->begin();
541
550
while (it != file->s->in_use->end())
543
errmsg_printf(ERRMSG_LVL_ERROR, "%s", _("Unknown thread accessing table"));
552
errmsg_printf(error::ERROR, "%s", _("Unknown thread accessing table"));
569
578
/* Name is here without an extension */
570
int ha_myisam::doOpen(const drizzled::TableIdentifier &identifier, int mode, uint32_t test_if_locked)
579
int ha_myisam::doOpen(const drizzled::identifier::Table &identifier, int mode, uint32_t test_if_locked)
572
581
MI_KEYDEF *keyinfo;
573
582
MI_COLUMNDEF *recinfo= 0;
692
701
if (file->dfile == -1)
694
errmsg_printf(ERRMSG_LVL_INFO, "Retrying repair of: '%s' failed. "
695
"Please try REPAIR EXTENDED or myisamchk",
696
getTable()->getShare()->getPath());
703
errmsg_printf(error::INFO, "Retrying repair of: '%s' failed. "
704
"Please try REPAIR EXTENDED or myisamchk",
705
getTable()->getShare()->getPath());
697
706
return(HA_ADMIN_FAILED);
918
927
param.stats_method= MI_STATS_METHOD_NULLS_NOT_EQUAL;
919
928
if ((error= (repair(session,param,0) != HA_ADMIN_OK)) && param.retry_repair)
921
errmsg_printf(ERRMSG_LVL_WARN, "Warning: Enabling keys got errno %d on %s.%s, retrying",
930
errmsg_printf(error::WARN, "Warning: Enabling keys got errno %d on %s.%s, retrying",
922
931
errno, param.db_name, param.table_name);
923
932
/* Repairing by sort failed. Now try standard repair method. */
924
933
param.testflag&= ~(T_REP_BY_SORT | T_QUICK);
1331
1340
int MyisamEngine::doDropTable(Session &session,
1332
const TableIdentifier &identifier)
1341
const identifier::Table &identifier)
1334
1343
session.getMessageCache().removeTableMessage(identifier);
1348
1357
int MyisamEngine::doCreateTable(Session &session,
1349
1358
Table& table_arg,
1350
const TableIdentifier &identifier,
1359
const identifier::Table &identifier,
1351
1360
message::Table& create_proto)
1396
int MyisamEngine::doRenameTable(Session &session, const TableIdentifier &from, const TableIdentifier &to)
1405
int MyisamEngine::doRenameTable(Session &session, const identifier::Table &from, const identifier::Table &to)
1398
1407
session.getMessageCache().renameTableMessage(from, to);
1505
1514
context("max-sort-file-size",
1506
1515
po::value<uint64_t>(&max_sort_file_size)->default_value(INT32_MAX),
1507
N_("Don't use the fast sort index method to created index if the temporary file would get bigger than this."));
1516
_("Don't use the fast sort index method to created index if the temporary file would get bigger than this."));
1508
1517
context("sort-buffer-size",
1509
1518
po::value<sort_buffer_constraint>(&sort_buffer_size)->default_value(8192*1024),
1510
N_("The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE."));
1519
_("The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE."));
1520
1529
"Default engine as of MySQL 3.23 with great performance",
1521
1530
PLUGIN_LICENSE_GPL,
1522
1531
myisam_init, /* Plugin Init */
1523
NULL, /* system variables */
1524
1533
init_options /* config options */
1526
1535
DRIZZLE_DECLARE_PLUGIN_END;