func filterGeneratedIndexes(indexes []sql.Index) []sql.Index {
	var newIndexes []sql.Index
	for _, index := range indexes {
		if !index.IsGenerated() {
			newIndexes = append(newIndexes, index)
		}
	}
	return newIndexes
}
filterGeneratedIndexes removes all generated indexes from a slice of indexes.
package analyzer
import (
	"github.com/dolthub/go-mysql-server/sql"
	"github.com/dolthub/go-mysql-server/sql/plan"
)
func assignInfoSchema(ctx *sql.Context, a *Analyzer, n sql.Node, scope *Scope) (sql.Node, error) {
	return plan.TransformUp(n, func(n sql.Node) (sql.Node, error) {
		if !n.Resolved() {
			return n, nil
		}
		switch x := n.(type) {
		case *plan.ShowIndexes:
			tableIndexes, err := getIndexesForTable(ctx, a, x.Child)
			if err != nil {
				return nil, err
			}
			x.IndexesToShow = filterGeneratedIndexes(tableIndexes)
		case *plan.ShowCreateTable:
			if !x.IsView {
				tableIndexes, err := getIndexesForTable(ctx, a, x.Child)
				if err != nil {
					return nil, err
				}
				x.Indexes = filterGeneratedIndexes(tableIndexes)
			}
		case *plan.ShowColumns:
			tableIndexes, err := getIndexesForTable(ctx, a, x.Child)
			if err != nil {
				return nil, err
			}
			x.Indexes = filterGeneratedIndexes(tableIndexes)
		case *plan.ShowCharset:
			rt, err := getInformationSchemaTable(ctx, a, "character_sets")
			if err != nil {
				return nil, err
			}
			x.CharacterSetTable = rt
		}
		return n, nil
	})
}