From 62011d165379111d478ccfca6da15210dad23784 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Aug 2005 00:13:49 +0300 Subject: Review of new pushed code - Fixed some error condtion when handling dates with 'T' - Added extra test for bug #11867 (Wrong result with "... WHERE ROW( a, b ) IN ( SELECT DISTINCT a, b WHERE ...)" to show it's not yet fixed - Safety fixes and cleanups mysql-test/r/subselect.result: Added extra test case to test case for bug #11867 (Result shows that current code is not yet right and needs to be fixed) mysql-test/r/type_datetime.result: More tests for dates of type CCYYMMDDTHHMMSS mysql-test/t/subselect.test: Added extra test case to test case for bug #11867 mysql-test/t/type_datetime.test: More tests for dates of type CCYYMMDDTHHMMSS sql-common/my_time.c: Fixed handling of dates of type CCYYMMDDTHHMMSS (Old code couldn't handle 2003-0304 or 2003-0003-02) sql/slave.cc: Indentation cleanup sql/sql_parse.cc: Added test of return value of get_system_var() sql/sql_select.cc: Removed unnecessary call to field->table->maybe_null sql/sql_union.cc: Indentation fixes --- sql-common/my_time.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sql-common') diff --git a/sql-common/my_time.c b/sql-common/my_time.c index 1726a9a6e78..40d7799e274 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -137,7 +137,9 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, If length= 8 or >= 14 then year is of format YYYY. (YYYY-MM-DD, YYYYMMDD, YYYYYMMDDHHMMSS) */ - for (pos=str; pos != end && my_isdigit(&my_charset_latin1,*pos) ; pos++) + for (pos=str; + pos != end && (my_isdigit(&my_charset_latin1,*pos) || *pos == 'T'); + pos++) ; digits= (uint) (pos-str); @@ -203,7 +205,7 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, const char *start= str; ulong tmp_value= (uint) (uchar) (*str++ - '0'); while (str != end && my_isdigit(&my_charset_latin1,str[0]) && - --field_length) + (!is_internal_format || --field_length)) { tmp_value=tmp_value*10 + (ulong) (uchar) (*str - '0'); str++; -- cgit v1.2.1