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

Function parse_padd_string

extra/comp_err.c:940–969  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

938*/
939
940static struct errors *parse_padd_string(char* str, int er_count)
941{
942 char *er_name;
943 uint d_code;
944 char *start;
945 DBUG_ENTER("parse_error_string");
946 DBUG_PRINT("enter", ("str: %s", str));
947
948 start= str;
949 str= skip_delimiters(str);
950
951 /* getting the error name */
952
953 if (!(er_name= get_word(&str)))
954 DBUG_RETURN(0); /* OOM: Fatal error */
955
956 str= skip_delimiters(str);
957
958 if (!(d_code= parse_error_offset(start)))
959 {
960 fprintf(stderr, "Failed to parse the error pad string '%s' '%s' (d_code doesn't parse)!\n",er_name,str);
961 DBUG_RETURN(0);
962 }
963 if (d_code < (uint)(er_offset + er_count))
964 {
965 fprintf(stderr, "Error to padding less current error number!\n");
966 DBUG_RETURN(0);
967 }
968 DBUG_RETURN(create_new_error(TRUE,er_name,d_code,empty_string,empty_string));
969}
970
971/*
972 Parsing the string with error name and codes; returns the pointer to

Callers 1

parse_input_fileFunction · 0.85

Calls 4

skip_delimitersFunction · 0.85
get_wordFunction · 0.85
parse_error_offsetFunction · 0.85
create_new_errorFunction · 0.85

Tested by

no test coverage detected