Hi!
No idea what is wrong. Below is the code which
prints the timestamp in InnoDB:
.................
struct tm cal_tm;
struct tm* cal_tm_ptr;
time_t tm;
time(&tm);
#ifdef HAVE_LOCALTIME_R
localtime_r(&tm, &cal_tm);
cal_tm_ptr = &cal_tm;
#else
cal_tm_ptr = localtime(&tm);
#endif
fprintf(file,"%02d%02d%02d %2d:%02d:%02d",
cal_tm_ptr->tm_year % 100,
cal_tm_ptr->tm_mon+1,
cal_tm_ptr->tm_mday,
cal_tm_ptr->tm_hour,
cal_tm_ptr->tm_min,
cal_tm_ptr->tm_sec);
...................
I tested 3.23.40b on our Linux computer and got the following:
heikki@donna:~/mysql-3.23.40/sql > mysqld
010807 18:01:01 Warning: setrlimit couldn't increase number of open files
to mo
re than 1024
010807 18:01:01 Warning: Changed limits: max_connections: 250 table_cache:
382
010807 18:01:02 InnoDB: Started
010807 18:01:02 mysqld: Table 'mysql.func' doesn't exist
010807 18:01:02 Can't open mysql/func table
mysqld: ready for connections
........
mysql> select now();
+---------------------+
| now() |
+---------------------+
| 2001-08-07 18:03:24 |
+---------------------+
1 row in set (0.00 sec)
mysql>
......................
Any ideas anybody?
Regards,
Heikki
-----Original Message-----
From: Peter Zaitsev <[EMAIL PROTECTED]>
To: Michael Widenius <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED] <[EMAIL PROTECTED]>; [EMAIL PROTECTED]
<[EMAIL PROTECTED]>; [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Tuesday, August 07, 2001 5:41 PM
Subject: Re: Timezone problem.
>Hello Michael,
>
>Tuesday, August 07, 2001, 10:20:18 PM, you wrote:
>
>OK guys I think I've found the problem.
>It seems like new innodb version (40b) does something bad with time.
>
>I've tested 3 binaries
>
>1) Plain .40 with normal GLIBC -> OK
>2) Plain .40 with patched GLIBC -> OK
>3) Plain .40 with new INNODB with doublewrite -> This binary shiftes
>the time.
>
>Could you Heikke please check if you have something similar ?
>
>
>
>
>MW> Hi!
>
>>>>>>> "Peter" == Peter Zaitsev <[EMAIL PROTECTED]> writes:
>
>Peter>> Hello mysql,
>Peter>> It seems like you made an incomportable changes in 3.23.40
without
>Peter>> taking a time to write a release note :(
>
>Peter>> The mysql 3.23.39 used the system timezone by default:
>
>Peter>> maindb:/spylog/mysql/logs # date
>Peter>> Tue Aug 7 13:31:56 MSD 2001
>
>Peter>> | transaction_isolation | READ-COMMITTED
|
>Peter>> | timezone | MSD
|
>Peter>> | tmp_table_size | 4194304
>
>
>Peter>> Therefore MYSQL 3.23.40 does not determinate the timezone
correctly:
>
>Peter>> |
>Peter>> | transaction_isolation | READ-COMMITTED
|
>Peter>> | timezone | Local time zone must be
set--see´Ÿ manual page
|
>Peter>> | tmp_table_size | 4194304
|
>MW> Are you sure you are not starting mysqld differently ?
>
>MW> According to my knowing, we have not changed anything in timezone
>MW> usage in MySQL.
>
>MW> The name if the timezone mysqld displays is what we get from the
>MW> following call:
>
>MW> {
>MW> struct tm tm_tmp;
>MW> localtime_r(&start_time,&tm_tmp);
>MW> strmov(time_zone,tzname[tm_tmp.tm_isdst == 1 ? 1 : 0]);
>MW> }
>
>MW> I don't know why localtime_r() doesn't work in your case, but I would
guess
>MW> something in your setup that has changed.
>
>MW> The only way to affect the timezone is to set the TZ variable before
>MW> starting mysqld/safe_mysqld or by starting safe_mysqld with the
>MW> --timezone= option.
>
>Peter>> It uses GMT in this case which could dammage the data (as went in
my
>Peter>> case)
>
>Peter>> The other thing is the manual does not contains much info about
>Peter>> setting timezone - only option to safe_mysqld which exports TZ
>Peter>> variable, which does not work:
>
>Peter>> root 19380 1 0 13:43 pts/8 00:00:00 sh
/usr/local/mysql/bin/safe_mysqld --mysqld=mysqld --user=mysql --pid-file=/sp
ylog/db/mysqld.pid --timezone=MSD --datadir=/spylog/db
>
>Peter>> It set's the timezone according to required value but date still
bad:
>
>Peter>> | transaction_isolation | READ-COMMITTED
|
>Peter>> | timezone | MSD
|
>Peter>> | tmp_table_size | 4194304
>
>
>mysql>> select now();
>Peter>> +---------------------+
>Peter>> | now() |
>Peter>> +---------------------+
>Peter>> | 2001-08-07 09:44:44 |
>Peter>> +---------------------+
>Peter>> 1 row in set (0.00 sec)
>
>Peter>> Therefore date returns correct value.
>
>Peter>> rat:/spylog/layers # date
>Peter>> Tue Aug 7 13:47:05 MSD 2001
>Peter>> rat:/spylog/layers #
>
>Peter>> Do you have any ideas about this ? How I can fix the problem ?
>
>MW> Sorry, no ideas; It looks like there is some problem with your glibc
>MW> library.
>
>MW> Did you try the MySQL 3.23.39 and 3.23.40 binaries on the same
>MW> machine?
>MW> If not, then I think this is a glibc problem!
>
>MW> Regards,
>MW> Monty
>
>
>
>--
>Best regards,
> Peter mailto:[EMAIL PROTECTED]
---------------------------------------------------------------------
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