diff options
author | unknown <msvensson@neptunus.(none)> | 2006-10-04 23:34:05 +0200 |
---|---|---|
committer | unknown <msvensson@neptunus.(none)> | 2006-10-04 23:34:05 +0200 |
commit | 93c0cddbd4bb2767b9c93f2d90a419d61b37a81e (patch) | |
tree | 416df15ad887dd297cd61f00a0e996b018ccfaa9 /client | |
parent | 395a16482d16e7b54d7b2f55fe8dc286186a51c0 (diff) | |
download | mariadb-git-93c0cddbd4bb2767b9c93f2d90a419d61b37a81e.tar.gz |
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
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqltest.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c index d49693fa324..f4fa95afeb1 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -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);; } |