@@ -596,64 +596,6 @@ int Arg_comparator::set_compare_func(Item_func_or_sum *item, Item_result type)
596
596
return 0 ;
597
597
}
598
598
599
- /* *
600
- Parse date provided in a string to a MYSQL_TIME.
601
-
602
- @param[in] thd Thread handle
603
- @param[in] str A string to convert
604
- @param[in] warn_type Type of the timestamp for issuing the warning
605
- @param[in] warn_name Field name for issuing the warning
606
- @param[out] l_time The MYSQL_TIME objects is initialized.
607
-
608
- Parses a date provided in the string str into a MYSQL_TIME object.
609
- The date is used for comparison, that is fuzzy dates are allowed
610
- independently of sql_mode.
611
- If the string contains an incorrect date or doesn't correspond to a date at
612
- all then a warning is issued. The warn_type and the warn_name arguments are
613
- used as the name and the type of the field when issuing the warning. If any
614
- input was discarded (trailing or non-timestamp-y characters), return value
615
- will be TRUE.
616
-
617
- @return Status flag
618
- @retval FALSE Success.
619
- @retval True Indicates failure.
620
- */
621
-
622
- bool get_mysql_time_from_str (THD *thd, String *str, timestamp_type warn_type,
623
- const char *warn_name, MYSQL_TIME *l_time)
624
- {
625
- bool value;
626
- MYSQL_TIME_STATUS status;
627
- int flags= TIME_FUZZY_DATES | MODE_INVALID_DATES;
628
- ErrConvString err (str);
629
-
630
- DBUG_ASSERT (warn_type != MYSQL_TIMESTAMP_TIME);
631
-
632
- if (!str_to_datetime (str->charset (), str->ptr (), str->length (),
633
- l_time, flags, &status))
634
- {
635
- DBUG_ASSERT (l_time->time_type == MYSQL_TIMESTAMP_DATETIME ||
636
- l_time->time_type == MYSQL_TIMESTAMP_DATE);
637
- /*
638
- Do not return yet, we may still want to throw a "trailing garbage"
639
- warning.
640
- */
641
- value= FALSE ;
642
- }
643
- else
644
- {
645
- DBUG_ASSERT (l_time->time_type != MYSQL_TIMESTAMP_TIME);
646
- DBUG_ASSERT (status.warnings != 0 ); // Must be set by set_to_datetime()
647
- value= TRUE ;
648
- }
649
-
650
- if (status.warnings > 0 )
651
- make_truncated_value_warning (thd, Sql_condition::WARN_LEVEL_WARN,
652
- &err, warn_type, warn_name);
653
-
654
- return value;
655
- }
656
-
657
599
658
600
/* *
659
601
Prepare the comparator (set the comparison function) for comparing
0 commit comments