On Wednesday 04 April 2001 04:03, Max Hammond wrote:
> I'll just add that if anyone wants a dump of the data causing this, drop
> me a note at [EMAIL PROTECTED] and I'll mail it to you, it's about 2500
> rows, and only that one field necessary to crash it.
> 
> Cheers,
> 
> Max

Fix:

--- 1.11/sql/time.cc    Wed Nov 15 13:59:54 2000
+++ edited/time.cc      Thu Apr  5 17:48:04 2001
@@ -428,11 +428,15 @@
   uint field_length,year_length,digits,i,number_of_fields,date[7];
   bool date_used=0;
   const char *pos;
-  const char *end=str+length;
   DBUG_ENTER("str_to_TIME");
   DBUG_PRINT("enter",("str: %.*s",length,str));
 
-  for (; !isdigit(*str) && str != end ; str++) ; // Skipp garbage
+  if(!str)
+    DBUG_RETURN(TIMESTAMP_NONE);
+
+  const char *end=str+length;
+
+  for (; !isdigit(*str) && str != end ; str++) ; // Skip garbage
   if (str == end)
     DBUG_RETURN(TIMESTAMP_NONE);
   /*

The problem was actually not in deally with invalid wannabe-fuzzy dates, but 
rather in converting an empty string text/blob field to a date.

Monty - I have considered several ways to fix it, and decided that checking 
for the NULL pointer in str_to_TIME() was the safest - it would take care of 
other potential buggy calls, if there happen to be any.

-- 
MySQL Development Team
   __  ___     ___ ____  __ 
  /  |/  /_ __/ __/ __ \/ /   Sasha Pachev <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__  MySQL AB, http://www.mysql.com/
/_/  /_/\_, /___/\___\_\___/  Provo, Utah, USA
       <___/                  

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to