5.5 compatible conversion from TIME to DATETIME */
| 973 | 5.5 compatible conversion from TIME to DATETIME |
| 974 | */ |
| 975 | static bool |
| 976 | time_to_datetime_old(THD *thd, const MYSQL_TIME *from, MYSQL_TIME *to) |
| 977 | { |
| 978 | DBUG_ASSERT(from->time_type == MYSQL_TIMESTAMP_TIME); |
| 979 | |
| 980 | if (from->neg) |
| 981 | return true; |
| 982 | |
| 983 | /* Set the date part */ |
| 984 | uint day= from->hour / 24; |
| 985 | to->day= day % 31; |
| 986 | to->month= day / 31; |
| 987 | to->year= 0; |
| 988 | /* Set the time part */ |
| 989 | to->hour= from->hour % 24; |
| 990 | to->minute= from->minute; |
| 991 | to->second= from->second; |
| 992 | to->second_part= from->second_part; |
| 993 | /* set sign and type */ |
| 994 | to->neg= 0; |
| 995 | to->time_type= MYSQL_TIMESTAMP_DATETIME; |
| 996 | return false; |
| 997 | } |
| 998 | |
| 999 | |
| 1000 | /** |