| 100 | */ |
| 101 | |
| 102 | static bool sec_to_time(lldiv_t seconds, MYSQL_TIME *ltime) |
| 103 | { |
| 104 | int warning= 0; |
| 105 | |
| 106 | set_zero_time(ltime, MYSQL_TIMESTAMP_TIME); |
| 107 | |
| 108 | if (seconds.quot < 0 || seconds.rem < 0) |
| 109 | { |
| 110 | ltime->neg= 1; |
| 111 | seconds.quot= -seconds.quot; |
| 112 | seconds.rem= -seconds.rem; |
| 113 | } |
| 114 | |
| 115 | if (seconds.quot > TIME_MAX_VALUE_SECONDS) |
| 116 | { |
| 117 | set_max_hhmmss(ltime); |
| 118 | return true; |
| 119 | } |
| 120 | |
| 121 | ltime->hour= (uint) (seconds.quot / 3600); |
| 122 | uint sec= (uint) (seconds.quot % 3600); |
| 123 | ltime->minute= sec / 60; |
| 124 | ltime->second= sec % 60; |
| 125 | time_add_nanoseconds_with_round(ltime, seconds.rem, &warning); |
| 126 | |
| 127 | adjust_time_range(ltime, &warning); |
| 128 | |
| 129 | return warning ? true : false; |
| 130 | } |
| 131 | |
| 132 | |
| 133 | /* |
nothing calls this directly
no test coverage detected