~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

Merge initial InnoDB+ import.

This was applied by generating a patch between MySQL 5.1.50 InnoDB plugin and
the just-merged innodb+ from mysql-trunk revision-id: vasil.dimov@oracle.com-20100422110752-1zowoqxel5xx3z2e

Then, some manual merge resolving and it worked. This should make it much
easier to merge the rest of InnoDB 1.1 and 1.2 from the mysql tree using
my bzr-reapply script.

This takes us to InnoDB 1.1.1(ish).

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_ERROR:
 
659
                return("Generic error");
 
660
        case DB_INTERRUPTED:
 
661
                return("Operation interrupted");
 
662
        case DB_OUT_OF_MEMORY:
 
663
                return("Cannot allocate memory");
 
664
        case DB_OUT_OF_FILE_SPACE:
 
665
                return("Out of disk space");
 
666
        case DB_LOCK_WAIT:
 
667
                return("Lock wait");
 
668
        case DB_DEADLOCK:
 
669
                return("Deadlock");
 
670
        case DB_ROLLBACK:
 
671
                return("Rollback");
 
672
        case DB_DUPLICATE_KEY:
 
673
                return("Duplicate key");
 
674
        case DB_QUE_THR_SUSPENDED:
 
675
                return("The queue thread has been suspended");
 
676
        case DB_MISSING_HISTORY:
 
677
                return("Required history data has been deleted");
 
678
        case DB_CLUSTER_NOT_FOUND:
 
679
                return("Cluster not found");
 
680
        case DB_TABLE_NOT_FOUND:
 
681
                return("Table not found");
 
682
        case DB_MUST_GET_MORE_FILE_SPACE:
 
683
                return("More file space needed");
 
684
        case DB_TABLE_IS_BEING_USED:
 
685
                return("Table is being used");
 
686
        case DB_TOO_BIG_RECORD:
 
687
                return("Record too big");
 
688
        case DB_LOCK_WAIT_TIMEOUT:
 
689
                return("Lock wait timeout");
 
690
        case DB_NO_REFERENCED_ROW:
 
691
                return("Referenced key value not found");
 
692
        case DB_ROW_IS_REFERENCED:
 
693
                return("Row is referenced");
 
694
        case DB_CANNOT_ADD_CONSTRAINT:
 
695
                return("Cannot add constraint");
 
696
        case DB_CORRUPTION:
 
697
                return("Data structure corruption");
 
698
        case DB_COL_APPEARS_TWICE_IN_INDEX:
 
699
                return("Column appears twice in index");
 
700
        case DB_CANNOT_DROP_CONSTRAINT:
 
701
                return("Cannot drop constraint");
 
702
        case DB_NO_SAVEPOINT:
 
703
                return("No such savepoint");
 
704
        case DB_TABLESPACE_ALREADY_EXISTS:
 
705
                return("Tablespace already exists");
 
706
        case DB_TABLESPACE_DELETED:
 
707
                return("No such tablespace");
 
708
        case DB_LOCK_TABLE_FULL:
 
709
                return("Lock structs have exhausted the buffer pool");
 
710
        case DB_FOREIGN_DUPLICATE_KEY:
 
711
                return("Foreign key activated with duplicate keys");
 
712
        case DB_TOO_MANY_CONCURRENT_TRXS:
 
713
                return("Too many concurrent transactions");
 
714
        case DB_UNSUPPORTED:
 
715
                return("Unsupported");
 
716
        case DB_PRIMARY_KEY_IS_NULL:
 
717
                return("Primary key is NULL");
 
718
        case DB_STATS_DO_NOT_EXIST:
 
719
                return("Persistent statistics do not exist");
 
720
        case DB_FAIL:
 
721
                return("Failed, retry may succeed");
 
722
        case DB_OVERFLOW:
 
723
                return("Overflow");
 
724
        case DB_UNDERFLOW:
 
725
                return("Underflow");
 
726
        case DB_STRONG_FAIL:
 
727
                return("Failed, retry will not succeed");
 
728
        case DB_ZIP_OVERFLOW:
 
729
                return("Zip overflow");
 
730
        case DB_RECORD_NOT_FOUND:
 
731
                return("Record not found");
 
732
        case DB_END_OF_INDEX:
 
733
                return("End of index");
 
734
        /* do not add default: in order to produce a warning if new code
 
735
        is added to the enum but not added here */
 
736
        }
 
737
 
 
738
        /* we abort here because if unknown error code is given, this could
 
739
        mean that memory corruption has happened and someone's error-code
 
740
        variable has been overwritten with bogus data */
 
741
        ut_error;
 
742
 
 
743
        /* NOT REACHED */
 
744
        return("Unknown error");
 
745
}