1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Update "get_errcode_from_name"

- add missing DBUG_RETURN
 - Change type of st_error->code to uint, that should be more than enough
   to hold the error numbers between 1000 and around 2000
This commit is contained in:
msvensson@neptunus.(none)
2006-10-04 23:34:05 +02:00
parent 56ccee0f6c
commit 2d5c7c42a3

View File

@@ -2429,7 +2429,7 @@ void do_set_charset(struct st_command *command)
typedef struct
{
const char *name;
long code;
uint code;
} st_error;
static st_error global_error_names[] =
@@ -2443,8 +2443,8 @@ static st_error global_error_names[] =
uint get_errcode_from_name(char *error_name, char *error_end)
{
#ifdef HAVE_MYSQLD_ERNAME
DBUG_ENTER("get_errcode_from_name");
#ifdef HAVE_MYSQLD_ERNAME
/* SQL error as string */
st_error *e= global_error_names;
@@ -2461,8 +2461,7 @@ uint get_errcode_from_name(char *error_name, char *error_end)
if (!strncmp(error_name, e->name, (int) (error_end - error_name)) &&
(uint) strlen(e->name) == (uint) (error_end - error_name))
{
return (uint) e->code;
break;
DBUG_RETURN(e->code);
}
}
if (!e->name)
@@ -2472,7 +2471,7 @@ uint get_errcode_from_name(char *error_name, char *error_end)
LINT_INIT(error_end);
abort_not_in_this_version();
#endif
return 0;
DBUG_RETURN(0);;
}