| 641 | } |
| 642 | |
| 643 | void calc_time_from_sec(MYSQL_TIME *to, longlong seconds, long microseconds) |
| 644 | { |
| 645 | long t_seconds; |
| 646 | // to->neg is not cleared, it may already be set to a useful value |
| 647 | to->time_type= MYSQL_TIMESTAMP_TIME; |
| 648 | to->year= 0; |
| 649 | to->month= 0; |
| 650 | to->day= 0; |
| 651 | DBUG_ASSERT(seconds < (0xFFFFFFFFLL * 3600LL)); |
| 652 | to->hour= (long) (seconds / 3600L); |
| 653 | t_seconds= (long) (seconds % 3600L); |
| 654 | to->minute= t_seconds/60L; |
| 655 | to->second= t_seconds%60L; |
| 656 | to->second_part= microseconds; |
| 657 | } |
| 658 | |
| 659 | |
| 660 | /* |