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

Function get_ER_error_msg

extra/perror.c:170–188  ·  view source on GitHub ↗

Lookup an error by code in the global_error_names array. @param code the code to lookup @param [out] name_ptr the error name, when found @param [out] msg_ptr the error text, when found @return 1 when found, otherwise 0 */

Source from the content-addressed store, hash-verified

168 @return 1 when found, otherwise 0
169*/
170int get_ER_error_msg(uint code, const char **name_ptr, const char **msg_ptr)
171{
172 st_error *tmp_error;
173
174 tmp_error= & global_error_names[0];
175
176 while (tmp_error->name != NULL)
177 {
178 if (tmp_error->code == code)
179 {
180 *name_ptr= tmp_error->name;
181 *msg_ptr= tmp_error->text;
182 return 1;
183 }
184 tmp_error++;
185 }
186
187 return 0;
188}
189
190#if defined(__WIN__)
191static my_bool print_win_error_msg(DWORD error, my_bool verbose)

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected