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