summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <gluh@gluh.mysql.r18.ru>2004-11-16 00:29:49 +0300
committerunknown <gluh@gluh.mysql.r18.ru>2004-11-16 00:29:49 +0300
commitac9e3a9633bf93be4d97a2a1888fc5ac8c6947db (patch)
treedcb3578c43aa32d33388acdb9b1fa6ac454f77b3 /sql
parenta59b0fbfd6b7627a4fdf2233482e732480dbe437 (diff)
downloadmariadb-git-ac9e3a9633bf93be4d97a2a1888fc5ac8c6947db.tar.gz
valgrind error fix
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_base.cc2
-rw-r--r--sql/sql_show.cc39
2 files changed, 21 insertions, 20 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 629216249cd..f2209fe3d90 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1938,7 +1938,7 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count)
return -1;
for (table= tables; table; table= table->next_global)
{
- if (!table->placeholder())
+ if (!table->placeholder() && !table->schema_table)
*(ptr++)= table->table;
}
if (!(thd->lock=mysql_lock_tables(thd,start, (uint) (ptr - start))))
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 17e6866f565..fb1cfdef6d4 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -2315,30 +2315,28 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables,
if (field->unireg_check == Field::NEXT_NUMBER)
end=strmov(tmp,"auto_increment");
table->field[16]->store(tmp, (uint) (end-tmp), cs);
- if (thd->lex->verbose)
- {
- end=tmp;
+
+ end=tmp;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- uint col_access;
- check_access(thd,SELECT_ACL | EXTRA_ACL, base_name,
- &tables->grant.privilege, 0, 0);
- col_access= get_column_grant(thd, &tables->grant, tables->db,
- tables->real_name,
- field->field_name) & COL_ACLS;
- for (uint bitnr=0; col_access ; col_access>>=1,bitnr++)
+ uint col_access;
+ check_access(thd,SELECT_ACL | EXTRA_ACL, base_name,
+ &tables->grant.privilege, 0, 0);
+ col_access= get_column_grant(thd, &tables->grant, tables->db,
+ tables->real_name,
+ field->field_name) & COL_ACLS;
+ for (uint bitnr=0; col_access ; col_access>>=1,bitnr++)
+ {
+ if (col_access & 1)
{
- if (col_access & 1)
- {
- *end++=',';
- end=strmov(end,grant_types.type_names[bitnr]);
- }
+ *end++=',';
+ end=strmov(end,grant_types.type_names[bitnr]);
}
+ }
#else
- end=strmov(end,"");
+ end=strmov(end,"");
#endif
- table->field[17]->store(tmp+1,end == tmp ? 0 : (uint) (end-tmp-1), cs);
- table->field[18]->store(field->comment.str, field->comment.length, cs);
- }
+ table->field[17]->store(tmp+1,end == tmp ? 0 : (uint) (end-tmp-1), cs);
+ table->field[18]->store(field->comment.str, field->comment.length, cs);
table->file->write_row(table->record[0]);
}
}
@@ -3111,6 +3109,7 @@ bool get_schema_tables_result(JOIN *join)
break;
TABLE_LIST *table_list= tab->table->pos_in_table_list;
TABLE_LIST *save_next_global= table_list->next_global;
+ TABLE_LIST **query_tables_last= thd->lex->query_tables_last;
if (table_list->schema_table && thd->fill_derived_tables())
{
@@ -3126,12 +3125,14 @@ bool get_schema_tables_result(JOIN *join)
thd->derived_tables= old_derived_tables;
thd->lock= sql_lock;
table_list->next_global= save_next_global;
+ thd->lex->query_tables_last= query_tables_last;
DBUG_RETURN(TRUE);
}
thd->lock= sql_lock;
thd->lex->sql_command= SQLCOM_SELECT;
thd->derived_tables= old_derived_tables;
table_list->next_global= save_next_global;
+ thd->lex->query_tables_last= query_tables_last;
}
}
DBUG_RETURN(FALSE);