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

Function mysql_errno_to_sqlstate

sql/sql_state.c:36–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34};
35
36const char *mysql_errno_to_sqlstate(uint mysql_errno)
37{
38 uint first=0, end= array_elements(sqlstate_map)-1;
39 struct st_map_errno_to_sqlstate *map;
40
41 /* Do binary search in the sorted array */
42 while (first != end)
43 {
44 uint mid= (first+end)/2;
45 map= sqlstate_map+mid;
46 if (map->mysql_errno < mysql_errno)
47 first= mid+1;
48 else
49 end= mid;
50 }
51 map= sqlstate_map+first;
52 if (map->mysql_errno == mysql_errno)
53 return map->odbc_state;
54 return "HY000"; /* General error */
55}

Callers 4

set_error_statusMethod · 0.85
net_send_errorMethod · 0.85
raise_conditionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected