Convert TIME to DATETIME. @param ltime The value to convert. @return false on success, true of error (negative time). */
| 885 | @return false on success, true of error (negative time). |
| 886 | */ |
| 887 | bool time_to_datetime(MYSQL_TIME *ltime) |
| 888 | { |
| 889 | DBUG_ASSERT(ltime->time_type == MYSQL_TIMESTAMP_TIME); |
| 890 | DBUG_ASSERT(ltime->year == 0); |
| 891 | DBUG_ASSERT(ltime->month == 0); |
| 892 | DBUG_ASSERT(ltime->day == 0); |
| 893 | if (ltime->neg) |
| 894 | return true; |
| 895 | uint day= ltime->hour / 24; |
| 896 | ltime->hour%= 24; |
| 897 | ltime->month= day / 31; |
| 898 | ltime->day= day % 31; |
| 899 | return false; |
| 900 | } |
| 901 | |
| 902 | |
| 903 | /*** Conversion from TIME to DATETIME ***/ |
no test coverage detected