diff options
author | Michael Widenius <monty@askmonty.org> | 2010-03-31 21:37:45 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2010-03-31 21:37:45 +0300 |
commit | fee40e27738122d5c7d7916a1cfa8cd2b5a20186 (patch) | |
tree | 2decdda4d5883490a6dbd427afb8c2f7eeb93212 | |
parent | 515c2db0304fcf3b88cf6017ec36579ba5447108 (diff) | |
download | mariadb-git-fee40e27738122d5c7d7916a1cfa8cd2b5a20186.tar.gz |
Fixed some compiler warnings
include/m_ctype.h:
MY_UNICASE_INFO already includes 'const'
plugin/auth/dialog.c:
Fixed parameters to have correct signed/unsigned type
sql/sql_acl.cc:
old_password_plugin is not used for EMBEDDED_LIBRARY
storage/pbxt/src/ha_pbxt.cc:
Remove not used variable
-rw-r--r-- | include/m_ctype.h | 2 | ||||
-rw-r--r-- | plugin/auth/dialog.c | 22 | ||||
-rw-r--r-- | sql/sql_acl.cc | 5 | ||||
-rw-r--r-- | storage/pbxt/src/ha_pbxt.cc | 2 |
4 files changed, 19 insertions, 12 deletions
diff --git a/include/m_ctype.h b/include/m_ctype.h index e06c2767c41..a5df71fa583 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -291,7 +291,7 @@ struct charset_info_st const uint16 *const *sort_order_big; const uint16 *tab_to_uni; MY_UNI_IDX *tab_from_uni; - const MY_UNICASE_INFO *const *caseinfo; + MY_UNICASE_INFO *const *caseinfo; const uchar *state_map; const uchar *ident_map; uint strxfrm_multiply; diff --git a/plugin/auth/dialog.c b/plugin/auth/dialog.c index 71dc2239fd0..c80cbebd046 100644 --- a/plugin/auth/dialog.c +++ b/plugin/auth/dialog.c @@ -51,6 +51,8 @@ #define PASSWORD_QUESTION "\4" #define LAST_PASSWORD "\5" +typedef unsigned char uchar; + /********************* SERVER SIDE ****************************************/ /** @@ -63,7 +65,9 @@ static int two_questions(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info) int pkt_len; /* send a password question */ - if (vio->write_packet(vio, PASSWORD_QUESTION "Password, please:", 18)) + if (vio->write_packet(vio, + (const uchar*) (PASSWORD_QUESTION "Password, please:"), + 18)) return CR_ERROR; /* read the answer */ @@ -73,11 +77,12 @@ static int two_questions(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info) info->password_used = 1; /* fail if the password is wrong */ - if (strcmp(pkt, info->auth_string)) + if (strcmp((char*) pkt, info->auth_string)) return CR_ERROR; /* send the last, ordinary, question */ - if (vio->write_packet(vio, LAST_QUESTION "Are you sure ?", 15)) + if (vio->write_packet(vio, + (const uchar*) (LAST_QUESTION "Are you sure ?"), 15)) return CR_ERROR; /* read the answer */ @@ -85,7 +90,7 @@ static int two_questions(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info) return CR_ERROR; /* check the reply */ - return strcmp(pkt, "yes, of course") ? CR_ERROR : CR_OK; + return strcmp((char*) pkt, "yes, of course") ? CR_ERROR : CR_OK; } static struct st_mysql_auth two_handler= @@ -108,7 +113,8 @@ static int three_attempts(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info) for (i= 0; i < 3; i++) { /* send the prompt */ - if (vio->write_packet(vio, PASSWORD_QUESTION "Password, please:", 18)) + if (vio->write_packet(vio, + (const uchar*) (PASSWORD_QUESTION "Password, please:"), 18)) return CR_ERROR; /* read the password */ @@ -121,7 +127,7 @@ static int three_attempts(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info) finish, if the password is correct. note, that we did not mark the prompt packet as "last" */ - if (strcmp(pkt, info->auth_string) == 0) + if (strcmp((char*) pkt, info->auth_string) == 0) return CR_OK; } @@ -255,12 +261,12 @@ static int perform_dialog(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql) if ((cmd >> 1) == 2 && *pkt == 0) reply= mysql->passwd; else - reply= ask(mysql, cmd >> 1, pkt, reply_buf, sizeof(reply_buf)); + reply= ask(mysql, cmd >> 1, (char*) pkt, reply_buf, sizeof(reply_buf)); if (!reply) return CR_ERROR; } /* send the reply to the server */ - res= vio->write_packet(vio, reply, strlen(reply)+1); + res= vio->write_packet(vio, (uchar*) reply, strlen(reply)+1); if (reply != mysql->passwd && reply != reply_buf) free(reply); diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 453af413cb0..ad6583b92f6 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -161,7 +161,10 @@ static LEX_STRING old_password_plugin_name= { /// @todo make it configurable LEX_STRING *default_auth_plugin_name= &native_password_plugin_name; -static plugin_ref native_password_plugin, old_password_plugin; +static plugin_ref native_password_plugin; +#ifndef EMBEDDED_LIBRARY +static plugin_ref old_password_plugin; +#endif /* Classes */ diff --git a/storage/pbxt/src/ha_pbxt.cc b/storage/pbxt/src/ha_pbxt.cc index 1bbd21e4331..6aa4c7df79f 100644 --- a/storage/pbxt/src/ha_pbxt.cc +++ b/storage/pbxt/src/ha_pbxt.cc @@ -1215,8 +1215,6 @@ static int pbxt_init(void *p) THD *thd = NULL; #ifndef DRIZZLED - extern myxt_mutex_t LOCK_plugin; - /* {MYSQL QUIRK} * I have to release this lock for PBXT recovery to * work, because it needs to open .frm files. |