diff --git a/include/my_global.h b/include/my_global.h index 15495c60dd7..0bacb762421 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -263,8 +263,10 @@ C_MODE_END #endif #ifdef HAVE_ATOMIC_ADD #define __SMP__ -#define CONFIG_SMP #include +#ifndef CONFIG_SMP +#define CONFIG_SMP +#endif #endif #include /* Recommended by debian */ /* We need the following to go around a problem with openssl on solaris */ diff --git a/mysys/charset.c b/mysys/charset.c index 0a76cf86a54..6a64730571c 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -315,6 +315,7 @@ static CHARSET_INFO *add_charset(uint cs_number, const char *cs_name, myf flags) cs->to_lower=tmp_to_lower; cs->to_upper=tmp_to_upper; cs->sort_order=tmp_sort_order; + cs->strxfrm_multiply=cs->mbmaxlen=1; if (read_charset_file(cs_number, cs, flags)) return NULL; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index f01248bb682..12ea3a94464 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -2285,11 +2285,20 @@ int mysql_grant (THD *thd, const char *db, List &list, (!db ? rights : 0), revoke_grant, create_new_users))) result= -1; - else + else if (db) { - if (db && replace_db_table(tables[1].table, db, *Str, rights & DB_ACLS, - revoke_grant)) + ulong db_rights= rights & DB_ACLS; + if (db_rights == rights) + { + if (replace_db_table(tables[1].table, db, *Str, db_rights, + revoke_grant)) + result= -1; + } + else + { + net_printf(&thd->net,ER_WRONG_USAGE,"DB GRANT","GLOBAL PRIVILEGEY"); result= -1; + } } } VOID(pthread_mutex_unlock(&acl_cache->lock)); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index d9060b4b26e..7ae963dab45 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -257,10 +257,11 @@ static bool check_user(THD *thd,enum_server_command command, const char *user, db ? db : (char*) ""); thd->db_access=0; /* Don't allow user to connect if he has done too many queries */ - if ((ur.questions || ur.updates || ur.connections) && + if ((ur.questions || ur.updates || ur.connections || max_user_connections) && get_or_create_user_conn(thd,user,thd->host_or_ip,&ur)) return -1; - if (thd->user_connect && thd->user_connect->user_resources.connections && + if (thd->user_connect && ((thd->user_connect->user_resources.connections) || + max_user_connections) && check_for_max_user_connections(thd->user_connect)) return -1; if (db && db[0]) @@ -308,7 +309,7 @@ static int check_for_max_user_connections(USER_CONN *uc) DBUG_ENTER("check_for_max_user_connections"); if (max_user_connections && - (max_user_connections <= (uint) uc->connections)) + (max_user_connections < (uint) uc->connections)) { net_printf(&(current_thd->net),ER_TOO_MANY_USER_CONNECTIONS, uc->user); error=1;