summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <tnurnberg@mysql.com/white.intern.koehntopp.de>2007-10-26 09:01:29 +0200
committerunknown <tnurnberg@mysql.com/white.intern.koehntopp.de>2007-10-26 09:01:29 +0200
commit0e700e1eeb4debd107c36cd5d386592287a4a67a (patch)
tree29bc791af010809da1914527f4be1aa164dd166e /sql
parent578c23860021d7eda334e42b17c90e039474587f (diff)
downloadmariadb-git-0e700e1eeb4debd107c36cd5d386592287a4a67a.tar.gz
Bug#31662: 'null' is shown as type of fields for view with bad definer, breaks mysqldump
SHOW FIELDS FROM a view with no valid definer was possible (since fix for Bug#26817), but gave NULL as a field-type. This led to mysqldump-ing of such views being successful, but loading such a dump with the client failing. Patch allows SHOW FIELDS to give data-type of field in underlying table. mysql-test/r/information_schema_db.result: Fix test results: SHOW FIELDS FROM a view with no valid DEFINER gives us the field-type of the underlying table now rather than NULL. sql/sql_base.cc: In the case of SHOW FIELDS FROM <view>, do not require a valid DEFINER for determining underlying data-type like we usually do. This is needed for mysqldump.
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_base.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 2f8bb35683b..7679c9436e9 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -3958,7 +3958,9 @@ find_field_in_tables(THD *thd, Item_ident *item,
{
Field *cur_field= find_field_in_table_ref(thd, cur_table, name, length,
item->name, db, table_name, ref,
- check_privileges,
+ (thd->lex->sql_command ==
+ SQLCOM_SHOW_FIELDS)
+ ? false : check_privileges,
allow_rowid,
&(item->cached_field_index),
register_tree_change,