summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 8f6e1427dbc..c46a825f9d7 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -5648,6 +5648,11 @@ find_field_in_table(THD *thd, TABLE *table, const char *name, size_t length,
if (field->invisible == INVISIBLE_FULL &&
DBUG_EVALUATE_IF("test_completely_invisible", 0, 1))
DBUG_RETURN((Field*)0);
+
+ if (field->invisible == INVISIBLE_SYSTEM &&
+ thd->column_usage != MARK_COLUMNS_READ &&
+ thd->column_usage != COLUMNS_READ)
+ DBUG_RETURN((Field*)0);
}
else
{