summaryrefslogtreecommitdiff
path: root/mysql-test/t/grant2.test
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-03-02 16:30:24 -0800
committerunknown <jimw@mysql.com>2005-03-02 16:30:24 -0800
commitc9b4f8c3d7b462ecc8cee1e434de244aa0cc3c2a (patch)
tree2b761960f88dceee348a5f5fc94c1a20eccc4e40 /mysql-test/t/grant2.test
parent90eed6566b306eb048efeb9612500e4f6658b44c (diff)
downloadmariadb-git-c9b4f8c3d7b462ecc8cee1e434de244aa0cc3c2a.tar.gz
Fix bug in checking of table-specific grats that caused IP/NETMASK
hostnames to not be matched correctly. (Bug #3309) sql/sql_acl.cc: Use an acl_host_or_ip in the GRANT_TABLE struct instead of storing the host itself, and use compare_hostname() in testing it. This adds support for IP addresses with netmasks to table-specific grants, and results in simplified code by making use of compare_hostname() in more places. mysql-test/r/grant2.result: Add new results mysql-test/t/grant2.test: Add new regression test
Diffstat (limited to 'mysql-test/t/grant2.test')
-rw-r--r--mysql-test/t/grant2.test14
1 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test
index 7060d35e9a4..8e1314aeace 100644
--- a/mysql-test/t/grant2.test
+++ b/mysql-test/t/grant2.test
@@ -89,3 +89,17 @@ flush privileges;
drop database mysqltest;
use test;
+# Bug #3309: Test IP addresses with netmask
+create database mysqltest_1;
+create table mysqltest_1.t1 (i int);
+insert into mysqltest_1.t1 values (1),(2),(3);
+GRANT ALL ON mysqltest_1.t1 TO mysqltest_1@'127.0.0.0/255.0.0.0';
+connect (n1,127.0.0.1,mysqltest_1,,mysqltest_1,$MASTER_MYPORT,$MASTER_MYSOCK);
+connection n1;
+show grants for current_user();
+select * from t1;
+disconnect n1;
+connection default;
+REVOKE ALL ON mysqltest_1.t1 FROM mysqltest_1@'127.0.0.0/255.0.0.0';
+drop table mysqltest_1.t1;
+drop database mysqltest_1;