Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Won't Do
-
1.4.3
-
None
Description
The unix_timestamp() function is not using the current time_zone variable value for calculations, when this value is non-zero. Here are steps to reproduce:
MariaDB [test]> create table i1 (a date, b date); |
Query OK, 0 rows affected (0.025 sec) |
|
MariaDB [test]> insert into i1 values ('2009-07-04', '1980-01-01'); |
Query OK, 1 row affected (0.001 sec)
|
|
MariaDB [test]> create table c1 (a date, b date)engine=columnstore; |
Query OK, 0 rows affected (1.548 sec) |
|
MariaDB [test]> insert into c1 values ('2009-07-04', '1980-01-01'); |
Query OK, 1 row affected (0.227 sec)
|
|
MariaDB [test]> set time_zone='+0:00'; |
Query OK, 0 rows affected (0.000 sec) |
|
MariaDB [test]> select a, b, unix_timestamp(a), unix_timestamp(b) from i1; |
+------------+------------+-------------------+-------------------+ |
| a | b | unix_timestamp(a) | unix_timestamp(b) |
|
+------------+------------+-------------------+-------------------+ |
| 2009-07-04 | 1980-01-01 | 1246665600 | 315532800 |
|
+------------+------------+-------------------+-------------------+ |
1 row in set (0.000 sec) |
|
MariaDB [test]> select a, b, unix_timestamp(a), unix_timestamp(b) from c1; |
+------------+------------+-------------------+-------------------+ |
| a | b | unix_timestamp(a) | unix_timestamp(b) |
|
+------------+------------+-------------------+-------------------+ |
| 2009-07-04 | 1980-01-01 | 1246665600 | 315532800 |
|
+------------+------------+-------------------+-------------------+ |
1 row in set (0.040 sec) |
|
MariaDB [test]> set time_zone='-5:00'; |
Query OK, 0 rows affected (0.000 sec) |
|
MariaDB [test]> select a, b, unix_timestamp(a), unix_timestamp(b) from i1; |
+------------+------------+-------------------+-------------------+ |
| a | b | unix_timestamp(a) | unix_timestamp(b) |
|
+------------+------------+-------------------+-------------------+ |
| 2009-07-04 | 1980-01-01 | 1246683600 | 315550800 |
|
+------------+------------+-------------------+-------------------+ |
1 row in set (0.000 sec) |
|
MariaDB [test]> select a, b, unix_timestamp(a), unix_timestamp(b) from c1; |
+------------+------------+-------------------+-------------------+ |
| a | b | unix_timestamp(a) | unix_timestamp(b) |
|
+------------+------------+-------------------+-------------------+ |
| 2009-07-04 | 1980-01-01 | 1246665600 | 315532800 |
|
+------------+------------+-------------------+-------------------+ |
1 row in set (0.008 sec) |
|