~jobinau/drizzle/bug_654164

« back to all changes in this revision

Viewing changes to plugin/innobase/ut/ut0ut.c

  • Committer: Monty Taylor
  • Date: 2010-11-26 22:50:54 UTC
  • mfrom: (1953.1.6 build)
  • Revision ID: mordred@inaugust.com-20101126225054-sg90svw8579t5p3i
Stewart - InnoDB 1.1.1
Monty - Fixed some autoconf tests which were returning false positives.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (c) 1994, 2009, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1994, 2010, Innobase Oy. All Rights Reserved.
4
4
Copyright (c) 2009, Sun Microsystems, Inc.
5
5
 
6
6
Portions of this file contain modifications contributed and copyrighted by
641
641
        return(res);
642
642
}
643
643
#endif /* __WIN__ */
 
644
 
 
645
/*************************************************************//**
 
646
Convert an error number to a human readable text message. The
 
647
returned string is static and should not be freed or modified.
 
648
@return string, describing the error */
 
649
UNIV_INTERN
 
650
const char*
 
651
ut_strerr(
 
652
/*======*/
 
653
        enum db_err     num)    /*!< in: error number */
 
654
{
 
655
        switch (num) {
 
656
        case DB_SUCCESS:
 
657
                return("Success");
 
658
        case DB_SUCCESS_LOCKED_REC:
 
659
                return("Success, record lock created");
 
660
        case DB_ERROR:
 
661
                return("Generic error");
 
662
        case DB_INTERRUPTED:
 
663
                return("Operation interrupted");
 
664
        case DB_OUT_OF_MEMORY:
 
665
                return("Cannot allocate memory");
 
666
        case DB_OUT_OF_FILE_SPACE:
 
667
                return("Out of disk space");
 
668
        case DB_LOCK_WAIT:
 
669
                return("Lock wait");
 
670
        case DB_DEADLOCK:
 
671
                return("Deadlock");
 
672
        case DB_ROLLBACK:
 
673
                return("Rollback");
 
674
        case DB_DUPLICATE_KEY:
 
675
                return("Duplicate key");
 
676
        case DB_QUE_THR_SUSPENDED:
 
677
                return("The queue thread has been suspended");
 
678
        case DB_MISSING_HISTORY:
 
679
                return("Required history data has been deleted");
 
680
        case DB_CLUSTER_NOT_FOUND:
 
681
                return("Cluster not found");
 
682
        case DB_TABLE_NOT_FOUND:
 
683
                return("Table not found");
 
684
        case DB_MUST_GET_MORE_FILE_SPACE:
 
685
                return("More file space needed");
 
686
        case DB_TABLE_IS_BEING_USED:
 
687
                return("Table is being used");
 
688
        case DB_TOO_BIG_RECORD:
 
689
                return("Record too big");
 
690
        case DB_LOCK_WAIT_TIMEOUT:
 
691
                return("Lock wait timeout");
 
692
        case DB_NO_REFERENCED_ROW:
 
693
                return("Referenced key value not found");
 
694
        case DB_ROW_IS_REFERENCED:
 
695
                return("Row is referenced");
 
696
        case DB_CANNOT_ADD_CONSTRAINT:
 
697
                return("Cannot add constraint");
 
698
        case DB_CORRUPTION:
 
699
                return("Data structure corruption");
 
700
        case DB_COL_APPEARS_TWICE_IN_INDEX:
 
701
                return("Column appears twice in index");
 
702
        case DB_CANNOT_DROP_CONSTRAINT:
 
703
                return("Cannot drop constraint");
 
704
        case DB_NO_SAVEPOINT:
 
705
                return("No such savepoint");
 
706
        case DB_TABLESPACE_ALREADY_EXISTS:
 
707
                return("Tablespace already exists");
 
708
        case DB_TABLESPACE_DELETED:
 
709
                return("No such tablespace");
 
710
        case DB_LOCK_TABLE_FULL:
 
711
                return("Lock structs have exhausted the buffer pool");
 
712
        case DB_FOREIGN_DUPLICATE_KEY:
 
713
                return("Foreign key activated with duplicate keys");
 
714
        case DB_TOO_MANY_CONCURRENT_TRXS:
 
715
                return("Too many concurrent transactions");
 
716
        case DB_UNSUPPORTED:
 
717
                return("Unsupported");
 
718
        case DB_PRIMARY_KEY_IS_NULL:
 
719
                return("Primary key is NULL");
 
720
        case DB_STATS_DO_NOT_EXIST:
 
721
                return("Persistent statistics do not exist");
 
722
        case DB_FAIL:
 
723
                return("Failed, retry may succeed");
 
724
        case DB_OVERFLOW:
 
725
                return("Overflow");
 
726
        case DB_UNDERFLOW:
 
727
                return("Underflow");
 
728
        case DB_STRONG_FAIL:
 
729
                return("Failed, retry will not succeed");
 
730
        case DB_ZIP_OVERFLOW:
 
731
                return("Zip overflow");
 
732
        case DB_RECORD_NOT_FOUND:
 
733
                return("Record not found");
 
734
        case DB_END_OF_INDEX:
 
735
                return("End of index");
 
736
        /* do not add default: in order to produce a warning if new code
 
737
        is added to the enum but not added here */
 
738
        }
 
739
 
 
740
        /* we abort here because if unknown error code is given, this could
 
741
        mean that memory corruption has happened and someone's error-code
 
742
        variable has been overwritten with bogus data */
 
743
        ut_error;
 
744
 
 
745
        /* NOT REACHED */
 
746
        return("Unknown error");
 
747
}