From 0847c4f90e732378b6e4b37fe819c92bda870067 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 Mar 2003 21:43:41 +0200 Subject: Print right hostname or IP in SHOW PROCESSLIST Use SESSION TABLE_HANDLER as default table handler if given table handler doesn't exists Docs/internals.texi: Updated description for how DATE, TIME and TIMESTAMP are stored mysql-test/r/create.result: New tests mysql-test/t/create.test: New tests sql/handler.cc: Use SESSION TABLE_HANDLER as default table handler if given table handler doesn't exists. sql/sql_parse.cc: Fix that we return hostname instead of IP in SHOW PROCESSLIST sql/sql_show.cc: Print right hostname or IP in SHOW PROCESSLIST --- Docs/internals.texi | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'Docs/internals.texi') diff --git a/Docs/internals.texi b/Docs/internals.texi index 1f90b8d1999..686ecd27fda 100644 --- a/Docs/internals.texi +++ b/Docs/internals.texi @@ -2213,11 +2213,11 @@ Storage: same as TINYINT. @strong{DATE} @itemize @bullet @item -Storage: fixed-length series of binary integers, always three bytes -long. +Storage: 3 byte integer, low byte first. +Packed as: 'day + month*32 + year*16*32' @item -Example: a DATE column containing '0001-01-01' looks like:@* -@code{hexadecimal 21 02 00} +Example: a DATE column containing '1962-01-02' looks like:@* +@code{hexadecimal 22 54 0F} @end itemize @strong{DATETIME} @@ -2236,16 +2236,19 @@ Example: a DATETIME column for '0001-01-01 01:01:01' looks like:@* @strong{TIME} @itemize @bullet @item -Storage: a value offset from 8385959, always three bytes long. +Storage: 3 bytes, low byte first. +This is stored as seconds: days*24*3600+hours*3600+minutes*60+seconds @item -Example: a TIME column containing '01:01:01' looks like:@* -@code{hexadecimal 75 27 00} +Example: a TIME column containing '1 02:03:04' (1 day 2 hour 3 minutes and 4 seconds) looks like:@* +@code{hexadecimal 58 6E 01} @end itemize @strong{TIMESTAMP} @itemize @bullet @item -Storage: four bytes long (NOTE TO SELF: not figured out) +Storage: 4 bytes, low byte first. +Stored as unix @code{time()}, which is seconds since the Epoch +(00:00:00 UTC, January 1, 1970). @item Example: a TIMESTAMP column containing '2003-01-01 01:01:01' looks like:@* @code{hexadecimal 4D AE 12 23} -- cgit v1.2.1