MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / TIME_from_longlong_packed

Function TIME_from_longlong_packed

sql/sql_time.cc:1510–1531  ·  view source on GitHub ↗

Convert packed numeric temporal representation to time, date or datetime, using field type. @param OUT ltime The variable to write to. @param type MySQL field type. @param packed_value Numeric datetype representation. */

Source from the content-addressed store, hash-verified

1508 @param packed_value Numeric datetype representation.
1509*/
1510void TIME_from_longlong_packed(MYSQL_TIME *ltime,
1511 enum enum_field_types type,
1512 longlong packed_value)
1513{
1514 switch (type)
1515 {
1516 case MYSQL_TYPE_TIME:
1517 TIME_from_longlong_time_packed(ltime, packed_value);
1518 break;
1519 case MYSQL_TYPE_DATE:
1520 TIME_from_longlong_date_packed(ltime, packed_value);
1521 break;
1522 case MYSQL_TYPE_DATETIME:
1523 case MYSQL_TYPE_TIMESTAMP:
1524 TIME_from_longlong_datetime_packed(ltime, packed_value);
1525 break;
1526 default:
1527 DBUG_ASSERT(0);
1528 set_zero_time(ltime, MYSQL_TIMESTAMP_ERROR);
1529 break;
1530 }
1531}
1532
1533
1534/**

Callers

nothing calls this directly

Tested by

no test coverage detected