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

Method VSec9

sql/sql_type.cc:572–618  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

570
571
572VSec9::VSec9(THD *thd, Item *item, const char *type_str, ulonglong limit)
573{
574 if (item->decimals == 0)
575 { // optimize for an important special case
576 Longlong_hybrid nr(item->val_int(), item->unsigned_flag);
577 make_from_int(nr);
578 m_is_null= item->null_value;
579 if (!m_is_null && m_sec > limit)
580 {
581 m_sec= limit;
582 m_truncated= true;
583 ErrConvInteger err(nr);
584 thd->push_warning_truncated_wrong_value(type_str, err.ptr());
585 }
586 }
587 else if (item->cmp_type() == REAL_RESULT)
588 {
589 double nr= item->val_real();
590 make_from_double(nr, &m_nsec);
591 m_is_null= item->null_value;
592 if (!m_is_null && m_sec > limit)
593 {
594 m_sec= limit;
595 m_truncated= true;
596 }
597 if (m_truncated)
598 {
599 ErrConvDouble err(nr);
600 thd->push_warning_truncated_wrong_value(type_str, err.ptr());
601 }
602 }
603 else
604 {
605 VDec tmp(item);
606 (m_is_null= tmp.is_null()) ? reset() : make_from_decimal(tmp.ptr(), &m_nsec);
607 if (!m_is_null && m_sec > limit)
608 {
609 m_sec= limit;
610 m_truncated= true;
611 }
612 if (m_truncated)
613 {
614 ErrConvDecimal err(tmp.ptr());
615 thd->push_warning_truncated_wrong_value(type_str, err.ptr());
616 }
617 }
618}
619
620
621Year::Year(longlong value, bool unsigned_flag, uint length)

Callers

nothing calls this directly

Calls 6

val_intMethod · 0.45
ptrMethod · 0.45
cmp_typeMethod · 0.45
val_realMethod · 0.45
is_nullMethod · 0.45

Tested by

no test coverage detected