summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorAlexander Nozdrin <alik@sun.com>2010-02-03 20:22:58 +0300
committerAlexander Nozdrin <alik@sun.com>2010-02-03 20:22:58 +0300
commit4c8fd3cf57f17b3506bad12245ba435f7a4498af (patch)
tree3be2d65dceed74b20b35b0dd5706d1b3daeddbb6 /sql
parentf62f1a528b7154e9ffdc61cc17fb629fa6dd5583 (diff)
parent21a6569952dfa8afb65e163197f9aec2f53eace8 (diff)
downloadmariadb-git-4c8fd3cf57f17b3506bad12245ba435f7a4498af.tar.gz
Manual merge from mysql-5.1-bugteam.
Conflicts: - configure.in - mysql-test/include/setup_fake_relay_log.inc - sql/sql_select.cc
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_select.cc18
-rw-r--r--sql/sql_show.cc8
2 files changed, 13 insertions, 13 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 5598cc29a01..7119650a7a6 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -3677,20 +3677,20 @@ add_ft_keys(DYNAMIC_ARRAY *keyuse_array,
cond_func=(Item_func_match *)cond;
else if (func->arg_count == 2)
{
- Item_func *arg0=(Item_func *)(func->arguments()[0]),
- *arg1=(Item_func *)(func->arguments()[1]);
- if (arg1->const_item() &&
- arg0->type() == Item::FUNC_ITEM &&
- arg0->functype() == Item_func::FT_FUNC &&
+ Item *arg0=(Item *)(func->arguments()[0]),
+ *arg1=(Item *)(func->arguments()[1]);
+ if (arg1->const_item() && arg1->cols() == 1 &&
+ arg0->type() == Item::FUNC_ITEM &&
+ ((Item_func *) arg0)->functype() == Item_func::FT_FUNC &&
((functype == Item_func::GE_FUNC && arg1->val_real() > 0) ||
(functype == Item_func::GT_FUNC && arg1->val_real() >=0)))
- cond_func=(Item_func_match *) arg0;
+ cond_func= (Item_func_match *) arg0;
else if (arg0->const_item() &&
- arg1->type() == Item::FUNC_ITEM &&
- arg1->functype() == Item_func::FT_FUNC &&
+ arg1->type() == Item::FUNC_ITEM &&
+ ((Item_func *) arg1)->functype() == Item_func::FT_FUNC &&
((functype == Item_func::LE_FUNC && arg0->val_real() > 0) ||
(functype == Item_func::LT_FUNC && arg0->val_real() >=0)))
- cond_func=(Item_func_match *) arg1;
+ cond_func= (Item_func_match *) arg1;
}
}
else if (cond->type() == Item::COND_ITEM)
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index aa55b7728e4..389aae87977 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -3309,11 +3309,11 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
while ((db_name= it++))
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- if (!check_access(thd,SELECT_ACL, db_name->str,
- &thd->col_access, 0, 1, with_i_schema) ||
+ if (!(check_access(thd,SELECT_ACL, db_name->str,
+ &thd->col_access, 0, 1, with_i_schema) ||
+ (!thd->col_access && check_grant_db(thd, db_name->str))) ||
sctx->master_access & (DB_ACLS | SHOW_DB_ACL) ||
- acl_get(sctx->host, sctx->ip, sctx->priv_user, db_name->str, 0) ||
- !check_grant_db(thd, db_name->str))
+ acl_get(sctx->host, sctx->ip, sctx->priv_user, db_name->str, 0))
#endif
{
thd->no_warnings_for_error= 1;