From: Jim Starkey Date: October 17 2008 4:35pm Subject: MYSQL_TYPE_YEAR List-Archive: http://lists.mysql.com/falcon/43 Message-Id: <48F8BEBA.1060307@nimbusdb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Here is the server code that handles the type: longlong Field_year::val_int(void) { ASSERT_COLUMN_MARKED_FOR_READ; int tmp= (int) ptr[0]; if (field_length != 4) tmp%=100; // Return last 2 char else if (tmp) tmp+=1900; return (longlong) tmp; } This is easily the stupidest type I've had the displeasure to run into. One type, two inconsistent sets of semantics. Given the actual year of 2008, one will return 08, the other 2008. In either case, hower, an indexed search will give 2008 as a key. What a mess! I suggest that StorageInterface::encodeRecord and ::decodeRecord do their own handling using the field->ptr and do a translation into/from normal years. -- Jim Starkey President, NimbusDB, Inc. 978 526-1376