18
18
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
20
20
You should have received a copy of the GNU General Public License along with
21
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
22
St, Fifth Floor, Boston, MA 02110-1301 USA
21
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
22
Place, Suite 330, Boston, MA 02111-1307 USA
24
24
*****************************************************************************/
219
218
/**********************************************************//**
220
Returns the number of milliseconds since some epoch. The
221
value may wrap around. It should only be used for heuristic
223
@return ms since epoch */
231
ut_gettimeofday(&tv, NULL);
233
return((ulint) tv.tv_sec * 1000 + tv.tv_usec / 1000);
235
#endif /* !UNIV_HOTBACKUP */
237
/**********************************************************//**
238
219
Returns the difference of two times in seconds.
239
220
@return time2 - time1 expressed in seconds */
643
624
#endif /* __WIN__ */
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 */
653
enum db_err num) /*!< in: error number */
658
case DB_SUCCESS_LOCKED_REC:
659
return("Success, record lock created");
661
return("Generic error");
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");
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");
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_FOREIGN_EXCEED_MAX_CASCADE:
715
return("Foreign key cascade delete/update exceeds max depth");
716
case DB_TOO_MANY_CONCURRENT_TRXS:
717
return("Too many concurrent transactions");
719
return("Unsupported");
720
case DB_PRIMARY_KEY_IS_NULL:
721
return("Primary key is NULL");
722
case DB_STATS_DO_NOT_EXIST:
723
return("Persistent statistics do not exist");
725
return("Failed, retry may succeed");
731
return("Failed, retry will not succeed");
732
case DB_ZIP_OVERFLOW:
733
return("Zip overflow");
734
case DB_RECORD_NOT_FOUND:
735
return("Record not found");
736
case DB_END_OF_INDEX:
737
return("End of index");
738
/* do not add default: in order to produce a warning if new code
739
is added to the enum but not added here */
742
/* we abort here because if unknown error code is given, this could
743
mean that memory corruption has happened and someone's error-code
744
variable has been overwritten with bogus data */
748
return("Unknown error");