summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorVarun Gupta <varun.gupta@mariadb.com>2020-04-26 15:42:57 +0530
committerVarun Gupta <varun.gupta@mariadb.com>2020-05-06 17:19:58 +0530
commit4539d3ea77fc5fde63f515a97bc679afd7b614c7 (patch)
tree4d3381ab3e1330af957b66541adccd388d8d0b73 /sql/sql_show.cc
parent8ad3c6154b90314980faf1cdd4c317c9bbf5f84c (diff)
downloadmariadb-git-bb-10.5-mdev7317.tar.gz
MDEV-7317: Make an index ignorable to the optimizerbb-10.5-mdev7317
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 2528134f4ee..5594b98db27 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -2479,6 +2479,9 @@ static void store_key_options(THD *thd, String *packet, TABLE *table,
append_unescaped(packet, key_info->comment.str,
key_info->comment.length);
}
+
+ if (key_info->is_ignored)
+ packet->append(STRING_WITH_LEN(" IGNORE"));
}
}
@@ -6667,6 +6670,12 @@ static int get_schema_stat_record(THD *thd, TABLE_LIST *tables,
if (key_info->flags & HA_USES_COMMENT)
table->field[15]->store(key_info->comment.str,
key_info->comment.length, cs);
+
+ // IGNORE column
+ const char *is_ignored= key_info->is_ignored ? "YES" : "NO";
+ table->field[16]->store(is_ignored, strlen(is_ignored), cs);
+ table->field[16]->set_notnull();
+
if (schema_table_store_record(thd, table))
DBUG_RETURN(1);
}
@@ -9033,6 +9042,7 @@ ST_FIELD_INFO stat_fields_info[]=
Column("COMMENT", Varchar(16), NULLABLE, "Comment", OPEN_FRM_ONLY),
Column("INDEX_COMMENT", Varchar(INDEX_COMMENT_MAXLEN),
NOT_NULL, "Index_comment",OPEN_FRM_ONLY),
+ Column("IGNORE", Varchar(3), NOT_NULL, "Ignore", OPEN_FRM_ONLY),
CEnd()
};