MCPcopy Create free account
hub / github.com/MariaDB/server / time_to_datetime_old

Function time_to_datetime_old

sql/sql_time.cc:975–997  ·  view source on GitHub ↗

5.5 compatible conversion from TIME to DATETIME */

Source from the content-addressed store, hash-verified

973 5.5 compatible conversion from TIME to DATETIME
974*/
975static bool
976time_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/**

Callers 1

time_to_datetimeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected