summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-03-15 16:07:28 +0200
committerunknown <monty@mysql.com>2005-03-15 16:07:28 +0200
commitef7ebed4135a7ddc85c194d632ac7d6308995769 (patch)
treeaed7f185cf908cbc9dc83d45ef1c53191c23011d /sql/sql_show.cc
parent722ffa879f27e9914ce557f7dc1f80a5acdf6134 (diff)
downloadmariadb-git-ef7ebed4135a7ddc85c194d632ac7d6308995769.tar.gz
Code cleanups during review of pushed code
sql/mysql_priv.h: Added 'const' to some arguments sql/sp_head.cc: Added comments code cleanup acceess -> access sql/sql_acl.cc: Simply code by making check_routine_level_acl() available also in embedded server sql/sql_acl.h: Added 'const' to some arguments sql/sql_parse.cc: Added 'const' to some arguments Fixed the check_rounte_level_acl() is always called (old code didn't properly check access privilges if grant_option was not set) sql/sql_show.cc: Simplify usage of get_field() Now we can always call check_some_routine_access() sql/sql_udf.cc: Don't give warnings for suspicios UDF's if --log-warnings isn't given sql/table.cc: Simplify usage of get_field()
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc17
1 files changed, 2 insertions, 15 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 4ffe7110cfa..79526808aec 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -2481,13 +2481,8 @@ void store_schema_proc(THD *thd, TABLE *table, TABLE *proc_table,
definer= get_field(thd->mem_root, proc_table->field[11]);
if (!full_access)
full_access= !strcmp(sp_user, definer);
- if (!full_access)
- {
-#ifndef NO_EMBEDDED_ACCESS_CHECKS
- if (check_some_routine_access(thd, (char * )sp_db, (char * )sp_name))
- return;
-#endif
- }
+ if (!full_access && check_some_routine_access(thd, sp_db, sp_name))
+ return;
if (lex->orig_sql_command == SQLCOM_SHOW_STATUS_PROC &&
proc_table->field[2]->val_int() == TYPE_ENUM_PROCEDURE ||
@@ -2499,36 +2494,30 @@ void store_schema_proc(THD *thd, TABLE *table, TABLE *proc_table,
if (!wild || !wild[0] || !wild_compare(sp_name, wild, 0))
{
table->field[3]->store(sp_name, strlen(sp_name), cs);
- tmp_string.length(0);
get_field(thd->mem_root, proc_table->field[3], &tmp_string);
table->field[0]->store(tmp_string.ptr(), tmp_string.length(), cs);
table->field[2]->store(sp_db, strlen(sp_db), cs);
- tmp_string.length(0);
get_field(thd->mem_root, proc_table->field[2], &tmp_string);
table->field[4]->store(tmp_string.ptr(), tmp_string.length(), cs);
if (proc_table->field[2]->val_int() == TYPE_ENUM_FUNCTION)
{
- tmp_string.length(0);
get_field(thd->mem_root, proc_table->field[9], &tmp_string);
table->field[5]->store(tmp_string.ptr(), tmp_string.length(), cs);
table->field[5]->set_notnull();
}
if (full_access)
{
- tmp_string.length(0);
get_field(thd->mem_root, proc_table->field[10], &tmp_string);
table->field[7]->store(tmp_string.ptr(), tmp_string.length(), cs);
}
table->field[6]->store("SQL", 3, cs);
table->field[10]->store("SQL", 3, cs);
- tmp_string.length(0);
get_field(thd->mem_root, proc_table->field[6], &tmp_string);
table->field[11]->store(tmp_string.ptr(), tmp_string.length(), cs);
if (proc_table->field[5]->val_int() == SP_CONTAINS_SQL)
{
table->field[12]->store("CONTAINS SQL", 12 , cs);
}
- tmp_string.length(0);
get_field(thd->mem_root, proc_table->field[7], &tmp_string);
table->field[14]->store(tmp_string.ptr(), tmp_string.length(), cs);
bzero((char *)&time, sizeof(time));
@@ -2537,10 +2526,8 @@ void store_schema_proc(THD *thd, TABLE *table, TABLE *proc_table,
bzero((char *)&time, sizeof(time));
((Field_timestamp *) proc_table->field[13])->get_time(&time);
table->field[16]->store_time(&time, MYSQL_TIMESTAMP_DATETIME);
- tmp_string.length(0);
get_field(thd->mem_root, proc_table->field[14], &tmp_string);
table->field[17]->store(tmp_string.ptr(), tmp_string.length(), cs);
- tmp_string.length(0);
get_field(thd->mem_root, proc_table->field[15], &tmp_string);
table->field[18]->store(tmp_string.ptr(), tmp_string.length(), cs);
table->field[19]->store(definer, strlen(definer), cs);