~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/ha_myisam.cc

  • Committer: Monty Taylor
  • Date: 2009-12-23 08:01:21 UTC
  • mto: This revision was merged to the branch mainline in revision 1253.
  • Revision ID: mordred@inaugust.com-20091223080121-iveugdrewkp7iqyi
Oy. Bigger change than I normally like - but this stuff is all intertwined.
Moved a bunch of things to public drizzled/ area. Split some files. Made some
convenience libs. EVENTUALLY, some of this will be able to be re-factored, but
for now I'm ok with erring on the side of too many files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
565
565
    MyISAM share exists already).
566
566
  */
567
567
  if (!(file=mi_open(name, mode, test_if_locked)))
568
 
    return (my_errno ? my_errno : -1);
 
568
    return (errno ? errno : -1);
569
569
 
570
570
  if (!table->s->tmp_table) /* No need to perform a check for tmp table */
571
571
  {
572
 
    if ((my_errno= table2myisam(table, &keyinfo, &recinfo, &recs)))
 
572
    if ((errno= table2myisam(table, &keyinfo, &recinfo, &recs)))
573
573
    {
574
574
      goto err;
575
575
    }
577
577
                         file->s->keyinfo, file->s->rec,
578
578
                         file->s->base.keys, file->s->base.fields, true))
579
579
    {
580
 
      my_errno= HA_ERR_CRASHED;
 
580
      errno= HA_ERR_CRASHED;
581
581
      goto err;
582
582
    }
583
583
  }
608
608
      }
609
609
    }
610
610
  }
611
 
  my_errno= 0;
 
611
  errno= 0;
612
612
  goto end;
613
613
 err:
614
614
  this->close();
619
619
  */
620
620
  if (recinfo)
621
621
    free((unsigned char*) recinfo);
622
 
  return my_errno;
 
622
  return errno;
623
623
}
624
624
 
625
625
int ha_myisam::close(void)
685
685
  // Don't lock tables if we have used LOCK Table
686
686
  if (mi_lock_database(file, table->s->tmp_table ? F_EXTRA_LCK : F_WRLCK))
687
687
  {
688
 
    mi_check_print_error(&param,ER(ER_CANT_LOCK),my_errno);
 
688
    mi_check_print_error(&param,ER(ER_CANT_LOCK),errno);
689
689
    return(HA_ADMIN_FAILED);
690
690
  }
691
691
 
906
906
    if ((error= (repair(session,param,0) != HA_ADMIN_OK)) && param.retry_repair)
907
907
    {
908
908
      errmsg_printf(ERRMSG_LVL_WARN, "Warning: Enabling keys got errno %d on %s.%s, retrying",
909
 
                        my_errno, param.db_name, param.table_name);
 
909
                        errno, param.db_name, param.table_name);
910
910
      /* Repairing by sort failed. Now try standard repair method. */
911
911
      param.testflag&= ~(T_REP_BY_SORT | T_QUICK);
912
912
      error= (repair(session,param,0) != HA_ADMIN_OK);