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
mysql-test/r/grant2.result:
new test case
mysql-test/r/variables.result:
don't fail w/o innodb
mysql-test/t/grant2.test:
new test case
mysql-test/t/multi_update.test:
don't fail w/o innodb
mysql-test/t/variables.test:
don't fail w/o innodb
sql/sql_acl.cc:
cleanup
he has SELECT and INSERT privileges for table with primary key"
Now we set lex->duplicates= DUP_UPDATE right in parser if INSERT has
ON DUPLICATE KEY UPDATE clause, this simplifies insert_precheck()
function (this also fixes a bug) and some other code.
mysql-test/r/grant2.result:
Added test for bug #6173 "One can circumvent missing UPDATE privilege if
he has SELECT and INSERT privileges for table with primary key"
mysql-test/t/grant2.test:
Added test for bug #6173 "One can circumvent missing UPDATE privilege if
he has SELECT and INSERT privileges for table with primary key"
sql/mysql_priv.h:
insert_precheck() don't need "update" parameter any longer since
now we set lex->duplicates to DUP_UPDATE if INSERT has ON DUPLICATE
KEY UPDATE clause.
sql/sql_parse.cc:
insert_precheck() don't need "update" parameter any longer since
now we set lex->duplicates to DUP_UPDATE if INSERT has ON DUPLICATE
KEY UPDATE clause, so it can determine whenever it is needed to
require UPDATE_ACL by itself. Also calling of mysql_insert() is
simplified.
sql/sql_prepare.cc:
insert_precheck() don't need "update" parameter any longer since
now we set lex->duplicates to DUP_UPDATE if INSERT has ON DUPLICATE
KEY UPDATE clause, so it can determine whenever it is needed to
require UPDATE_ACL by itself. Also calling of mysql_insert() is
simplified.
sql/sql_yacc.yy:
It is better to set Lex->duplicates= DUP_UPDATE right in parser if we
have INSERT with ON DUPLICATE KEY UPDATE clause, rather doing this later.
'SHOW GRANTS' syntax is added
'SHOW GRANTS FOR CURRENT_USER' syntax is added
'SHOW GRANTS FOR CURRENT_USER()' syntax is added
CURRENT_USER without parens in expressions(SELECT CURRENT_USER;)
mysql-test/r/grant2.result:
WL1368: SHOW GRANTS FOR CURRENT USER
mysql-test/r/grant_cache.result:
WL1368: SHOW GRANTS FOR CURRENT USER
mysql-test/t/grant2.test:
WL1368: SHOW GRANTS FOR CURRENT USER
mysql-test/t/grant_cache.test:
WL1368: SHOW GRANTS FOR CURRENT USER
sql/lex.h:
WL1368: SHOW GRANTS FOR CURRENT USER
sql/sql_yacc.yy:
WL1368: SHOW GRANTS FOR CURRENT USER