#include <my_global.h>#include <mysqld_error.h>#include <sql_state.h>Include dependency graph for sql_state.c:

Go to the source code of this file.
Classes | |
| struct | st_map_errno_to_sqlstate |
Functions | |
| const char * | mysql_errno_to_sqlstate (uint mysql_errno) |
Variables | |
| st_map_errno_to_sqlstate | sqlstate_map [] |
| const char* mysql_errno_to_sqlstate | ( | uint | mysql_errno | ) |
Definition at line 34 of file sql_state.c.
References array_elements, map, and sqlstate_map.
Referenced by errno_to_sqlstate(), sp_rcontext::find_handler(), net_printf_error(), and net_send_error_packet().
00035 { 00036 uint first=0, end= array_elements(sqlstate_map)-1; 00037 struct st_map_errno_to_sqlstate *map; 00038 00039 /* Do binary search in the sorted array */ 00040 while (first != end) 00041 { 00042 uint mid= (first+end)/2; 00043 map= sqlstate_map+mid; 00044 if (map->mysql_errno < mysql_errno) 00045 first= mid+1; 00046 else 00047 end= mid; 00048 } 00049 map= sqlstate_map+first; 00050 if (map->mysql_errno == mysql_errno) 00051 return map->odbc_state; 00052 return "HY000"; /* General error */ 00053 }
Here is the caller graph for this function:

| struct st_map_errno_to_sqlstate sqlstate_map[] |
Initial value:
{
}
Definition at line 29 of file sql_state.c.
Referenced by mysql_errno_to_sqlstate().
1.4.7

