diff options
author | unknown <monty@mashka.mysql.fi> | 2002-09-22 10:35:15 +0300 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2002-09-22 10:35:15 +0300 |
commit | cc71ac185d1dcef30a964b5f0b98ef4ebce263d1 (patch) | |
tree | 87e7f602b563d9a1ad9076e0470e9668a28469d5 | |
parent | f72b93abd4669e8b0369a0825327614e4a93de64 (diff) | |
download | mariadb-git-cc71ac185d1dcef30a964b5f0b98ef4ebce263d1.tar.gz |
Fixed bug in previous patch when using a libc with static nss
client/mysql.cc:
Fixed help text
mysql-test/t/rpl_rotate_logs.test:
Updated test
sql/sql_acl.cc:
comments and safety checks
-rw-r--r-- | client/mysql.cc | 6 | ||||
-rw-r--r-- | configure.in | 5 | ||||
-rw-r--r-- | mysql-test/t/rpl_rotate_logs.test | 2 | ||||
-rw-r--r-- | sql/sql_acl.cc | 20 |
4 files changed, 26 insertions, 7 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index 33cbcbd2f6b..7d9ecda12e3 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -40,7 +40,7 @@ #include <signal.h> #include <violite.h> -const char *VER= "12.13"; +const char *VER= "12.14"; /* Don't try to make a nice table if the data is too big */ #define MAX_COLUMN_LENGTH 1024 @@ -476,7 +476,8 @@ static struct my_option my_long_options[] = {"ignore-space", 'i', "Ignore space after function names.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"local-infile", OPT_LOCAL_INFILE, "Enable/disable LOAD DATA LOCAL INFILE.", - 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, + (gptr*) &opt_local_infile, + (gptr*) &opt_local_infile, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"no-beep", 'b', "Turn off beep on error.", (gptr*) &opt_nobeep, (gptr*) &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"host", 'h', "Connect to host.", (gptr*) ¤t_host, @@ -609,7 +610,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), break; case OPT_LOCAL_INFILE: using_opt_local_infile=1; - opt_local_infile= test(!argument || atoi(argument)>0); break; case OPT_TEE: if (argument == disabled_my_option) diff --git a/configure.in b/configure.in index 5e88c696302..7711cce7c08 100644 --- a/configure.in +++ b/configure.in @@ -454,6 +454,8 @@ fi NOINST_LDFLAGS= static_nss="" +STATIC_NSS_FLAGS="" +OTHER_LIBC_LIB="" AC_ARG_WITH(other-libc, [ --with-other-libc=DIR Link against libc and other standard libraries installed in the specified non-standard location @@ -479,6 +481,7 @@ AC_ARG_WITH(other-libc, # we need special flags, but we will have to add those later STATIC_NSS_FLAGS="-Wl,--start-group -lc -lnss_files -lnss_dns -lresolv \ -Wl,--end-group" + OTHER_LIBC_LIB="-L$other_libc_lib" static_nss=1 else # this is a dirty hack. We if we detect static nss glibc in the special @@ -2390,7 +2393,7 @@ fi if test "$static_nss" = "1" then - LDFLAGS="$LDFLAGS -static -L$other_libc_lib " + LDFLAGS="$LDFLAGS -static $OTHER_LIBC_LIB" LIBS="$LIBS $STATIC_NSS_FLAGS" fi diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test index f6fbb76e55e..5d8f150cdea 100644 --- a/mysql-test/t/rpl_rotate_logs.test +++ b/mysql-test/t/rpl_rotate_logs.test @@ -139,7 +139,7 @@ select count(*) from t3 where n >= 4; unlock tables; #clean up connection master; -drop table if exists t1,t2,t3; +drop table if exists t1,t2,t3,t4; save_master_pos; connection slave; sync_with_master; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index b080046e599..6ff93eecedd 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -741,11 +741,25 @@ static void acl_update_db(const char *user, const char *host, const char *db, } +/* + Insert a user/db/host combination into the global acl_cache + + SYNOPSIS + acl_insert_db() + user User name + host Host name + db Database name + privileges Bitmap of privileges + + NOTES + acl_cache->lock must be locked when calling this +*/ + static void acl_insert_db(const char *user, const char *host, const char *db, ulong privileges) { ACL_DB acl_db; - /* The acl_cache mutex is locked by mysql_grant */ + safe_mutex_assert_owner(&acl_cache->lock); acl_db.user=strdup_root(&mem,user); update_hostname(&acl_db.host,strdup_root(&mem,host)); acl_db.db=strdup_root(&mem,db); @@ -1217,6 +1231,7 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, char *password,empty_string[1]; char what= (revoke_grant) ? 'N' : 'Y'; DBUG_ENTER("replace_user_table"); + safe_mutex_assert_owner(&acl_cache->lock); password=empty_string; empty_string[0]=0; @@ -1240,7 +1255,6 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, { if (!create_user) { - THD *thd=current_thd; if (what == 'N') my_printf_error(ER_NONEXISTING_GRANT,ER(ER_NONEXISTING_GRANT), MYF(0),combo.user.str,combo.host.str); @@ -1621,6 +1635,7 @@ static GRANT_TABLE *table_hash_search(const char *host,const char* ip, char helping [NAME_LEN*2+USERNAME_LENGTH+3]; uint len; GRANT_TABLE *grant_table,*found=0; + safe_mutex_assert_owner(&LOCK_grant); len = (uint) (strmov(strmov(strmov(helping,user)+1,db)+1,tname)-helping)+ 1; for (grant_table=(GRANT_TABLE*) hash_search(&hash_tables,(byte*) helping, @@ -1828,6 +1843,7 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table, int error=0; ulong store_table_rights, store_col_rights; DBUG_ENTER("replace_table_table"); + safe_mutex_assert_owner(&LOCK_grant); strxmov(grantor, thd->user, "@", thd->host_or_ip, NullS); |