From 705283f7e3e2a3bf962381b77c2f47b393f25d2e Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 2 Feb 2018 15:38:15 +0400 Subject: [PATCH] Setting Field::field_index for Virtual_tmp_table fields Virtial_tmp_table did not set the "field_index" member for its Fields. Fixing Virtual_tmp_table::add() to set "field_index" to the Field's ordinal position inside the table, like a normal TABLE does, for consistency. Although, this flaw did not seem to cause any bugs, having field_index properly set is helpful for debugging purposes. --- sql/sql_select.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_select.h b/sql/sql_select.h index 7cfc35a3b7d..3f1fdac96cb 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -2104,7 +2104,7 @@ public: DBUG_ASSERT(s->blob_fields <= m_alloced_field_count); s->blob_field[s->blob_fields - 1]= s->fields; } - s->fields++; + new_field->field_index= s->fields++; return false; }