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

Function parse_error_offset

extra/comp_err.c:593–627  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

591
592
593static uint parse_error_offset(char *str)
594{
595 char *soffset, *end;
596 int error;
597 uint ioffset;
598
599 DBUG_ENTER("parse_error_offset");
600 /* skipping the "start-error-number" keyword and spaces after it */
601 str= find_end_of_word(str);
602 str= skip_delimiters(str);
603
604 if (!*str)
605 DBUG_RETURN(0); /* Unexpected EOL: No error number after the keyword */
606
607 /* reading the error offset */
608 if (!(soffset= get_word(&str)))
609 DBUG_RETURN(0); /* OOM: Fatal error */
610 DBUG_PRINT("info", ("default_error_offset: %s", soffset));
611
612 /* skipping space(s) and/or tabs after the error offset */
613 str= skip_delimiters(str);
614 DBUG_PRINT("info", ("str: %s", str));
615 if (*str)
616 {
617 /* The line does not end with the error offset -> error! */
618 fprintf(stderr, "The error offset line does not end with an error offset");
619 DBUG_RETURN(0);
620 }
621 DBUG_PRINT("info", ("str: %s", str));
622
623 end= 0;
624 ioffset= (uint) my_strtoll10(soffset, &end, &error);
625 my_free(soffset);
626 DBUG_RETURN(ioffset);
627}
628
629
630/* Parsing of the default language line. e.g. "default-language eng" */

Callers 2

parse_input_fileFunction · 0.85
parse_padd_stringFunction · 0.85

Calls 5

find_end_of_wordFunction · 0.85
skip_delimitersFunction · 0.85
get_wordFunction · 0.85
my_strtoll10Function · 0.85
my_freeFunction · 0.85

Tested by

no test coverage detected