~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/ha_myisam.cc

edit

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
 
17
17
 
18
 
#include <config.h>
19
 
#include <drizzled/internal/my_bit.h>
 
18
#include "config.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>
36
 
 
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"
38
36
 
39
37
#include <boost/algorithm/string.hpp>
40
38
#include <boost/scoped_ptr.hpp>
286
284
        keydef[i].seg[j].flag|= HA_BLOB_PART;
287
285
        /* save number of bytes used to pack length */
288
286
        keydef[i].seg[j].bit_start= (uint) (field->pack_length() -
289
 
                                            share->sizeBlobPtr());
 
287
                                            share->blob_ptr_size);
290
288
      }
291
289
    }
292
290
    keyseg+= pos->key_parts;
296
294
  record= table_arg->getInsertRecord();
297
295
  recpos= 0;
298
296
  recinfo_pos= recinfo;
299
 
 
300
 
  while (recpos < (uint) share->sizeStoredRecord())
 
297
  while (recpos < (uint) share->stored_rec_length)
301
298
  {
302
299
    Field **field, *found= 0;
303
300
    minpos= share->getRecordLength();
311
308
        /* skip null fields */
312
309
        if (!(temp_length= (*field)->pack_length_in_rec()))
313
310
          continue; /* Skip null-fields */
314
 
 
315
311
        if (! found || fieldpos < minpos ||
316
312
            (fieldpos == minpos && temp_length < length))
317
313
        {
533
529
{
534
530
  Session *cur_session;
535
531
  if ((cur_session= file->in_use))
536
 
  {
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,
539
534
                    sfile, sline);
540
 
  }
541
535
  else
542
 
  {
543
 
    errmsg_printf(error::ERROR, _("Got an error from unknown thread, %s:%d"), sfile, sline);
544
 
  }
545
 
 
 
536
    errmsg_printf(ERRMSG_LVL_ERROR, _("Got an error from unknown thread, %s:%d"), sfile, sline);
546
537
  if (message)
547
 
    errmsg_printf(error::ERROR, "%s", message);
548
 
 
 
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())
551
541
  {
552
 
    errmsg_printf(error::ERROR, "%s", _("Unknown thread accessing table"));
 
542
    errmsg_printf(ERRMSG_LVL_ERROR, "%s", _("Unknown thread accessing table"));
553
543
    ++it;
554
544
  }
555
545
}
700
690
  */
701
691
  if (file->dfile == -1)
702
692
  {
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);
707
697
  }
708
698
 
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)
929
919
    {
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);
937
927
        might have been set by the first repair. They can still be seen
938
928
        with SHOW WARNINGS then.
939
929
      */
940
 
      if (not error)
 
930
      if (! error)
941
931
        session->clear_error();
942
932
    }
943
933
    info(HA_STATUS_CONST);
1529
1519
  "Default engine as of MySQL 3.23 with great performance",
1530
1520
  PLUGIN_LICENSE_GPL,
1531
1521
  myisam_init, /* Plugin Init */
1532
 
  NULL,           /* depends */
 
1522
  NULL,           /* system variables */
1533
1523
  init_options                        /* config options                  */
1534
1524
}
1535
1525
DRIZZLE_DECLARE_PLUGIN_END;