List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:January 8 2000 10:51pm
Subject:Re: minor y2k bug
View as plain text  
>>>>> "Udo" == Udo Beckmann <udo_beckmann@stripped> writes:

>> > Try:
>> >         /usr/local/bin/mysqladmin flush-logs
>> > The first line of the outputfile (datadir/servername.NNN) shows:
>> >         # /usr/local/libexec/mysqld, Version: 3.22.29-log at 1000107
>> > 6:44:00
>> 
>> Time                 Id Command    Argument
>> 000107  4:16:08     154 Quit
>> 
>> I think you read a '1' into that.  Under the time
>> header, there are six digits, two for year (00 = 2000),
>> two for month (01) and two for day (07).
>> 
>> ------------------------------------------------------
>> hypnos              <mailto:hypnos@stripped>

Udo> The only problem is the errornous comment line generated by "mysqladmin
Udo> flush-logs". It should be something like "... at 00107 6:44:00" but its
Udo> written as "... at 100107 6:44:00". I assume the reason for the extra
Udo> '1' ist that MySQL handles dates similar to perl (i.e. you have to add
Udo> 1900 to the value retrieved by the localtime() system call).

Udo> The reason why I detected this fault is, that I'm testing for empty log
Udo> files, i.e. files including only a comment line. These files had a size
Udo> of 69 bytes. Since Jan 1 2000 they have a size of 70 bytes.

Hi!

Ouch :)  It looks like my patches for 3.23 never propagated to 3.22 :(

Here is the patch for 3.22 (This isn't needed in 3.23)

*** /my/monty/master/mysql-3.22.29/sql/log.cc	Sat Aug 28 15:10:44 1999
--- ./log.cc	Sun Jan  9 00:48:46 2000
***************
*** 107,113 ****
  
      fprintf(file,"# %s, Version: %s at %02d%02d%02d %2d:%02d:%02d\n",
  	    my_progname,server_version,
! 	    tm_tmp.tm_year,
  	    tm_tmp.tm_mon+1,
  	    tm_tmp.tm_mday,
  	    tm_tmp.tm_hour,
--- 107,113 ----
  
      fprintf(file,"# %s, Version: %s at %02d%02d%02d %2d:%02d:%02d\n",
  	    my_progname,server_version,
! 	    tm_tmp.tm_year % 100,
  	    tm_tmp.tm_mon+1,
  	    tm_tmp.tm_mday,
  	    tm_tmp.tm_hour,
***************
*** 242,248 ****
  	  localtime_r(&skr,&tm_tmp);
  	  start_time=&tm_tmp;
  	  if (fprintf(file,"# Time: %02d%02d%02d %2d:%02d:%02d\n",
! 		      start_time->tm_year,
  		      start_time->tm_mon+1,
  		      start_time->tm_mday,
  		      start_time->tm_hour,
--- 242,248 ----
  	  localtime_r(&skr,&tm_tmp);
  	  start_time=&tm_tmp;
  	  if (fprintf(file,"# Time: %02d%02d%02d %2d:%02d:%02d\n",
! 		      start_time->tm_year % 100,
  		      start_time->tm_mon+1,
  		      start_time->tm_mday,
  		      start_time->tm_hour,

Yours,
Monty

*************** Warning commercial signature follows **********
If you like TCX's concept of a 'mostly free' database and free
advice, you should at least CONSIDER supporting us, so that we can
afford to continue this service.   http://www.mysql.com/
Thread
minor y2k bugUdo Beckmann7 Jan
  • Re: minor y2k bughypnos7 Jan
Re: minor y2k bugUdo Beckmann7 Jan
  • Re: minor y2k bugPaul DuBois7 Jan
  • Re: minor y2k bugMichael Widenius9 Jan