public override void ExplicitVisit(AlterIndexStatement index)
 {
     if (IsSupportedForCurrentType(index.GetType()))
     {
         Name = index.Name;
     }
 }
示例#2
0
        protected override void VisitAlterIndexStatement(AlterIndexStatement statement)
        {
            if (statement.Rebuild)
            {
                State.Write(Symbols.REINDEX);

                if (statement.Name == null)
                {
                    VisitToken(statement.On);
                }
                else
                {
                    VisitToken(Sql.Name(statement.On.FirstPart, statement.Name.LastPart));
                }
            }
        }
示例#3
0
 protected override void VisitAlterIndexStatement(AlterIndexStatement statement)
 {
 }
示例#4
0
 public override void Visit(AlterIndexStatement node) { this.action(node); }
 //There is no ALTER INDEX command in MySQL
 protected override void VisitAlterIndexStatement(AlterIndexStatement statement)
 {
     VisitStatement(Sql.DropIndex(statement.Name, statement.On, false));
     State.WriteStatementTerminator();
     CreateIndex(statement);
 }
 public override void ExplicitVisit(AlterIndexStatement fragment)
 {
     _fragments.Add(fragment);
 }
示例#7
0
 protected abstract void VisitAlterIndexStatement(AlterIndexStatement statement);
示例#8
0
 /// <summary>
 /// Add all options to the list of index options, overriding existing values if present
 /// </summary>
 public override void ExplicitVisit(AlterIndexStatement node)
 {
     IndexExplicitVisit(node);
 }
 public override void ExplicitVisit(AlterIndexStatement index)
 {
     if (IsSupportedForCurrentType(index.GetType()))
     {
         Name = index.Name;
     }
 }
示例#10
0
 public override void ExplicitVisit(AlterIndexStatement node)
 {
     Alters.Add(node);
     _called = true;
     base.ExplicitVisit(node);
 }
示例#11
0
 public virtual bool Action(AlterIndexStatement node)
 {
     AddTablesContext(node);
     FixIdentifier(new DbObject(node.Index), ObjectType.INDEX, node.Index);
     return(false);
 }
示例#12
0
        private IList <DbObjectTableSource> GetAvailTables(GrammarNode node)
        {
            IList <DbObjectTableSource> ret = new List <DbObjectTableSource>();

            if (node is UpdateStatement)
            {
                UpdateStatement upd = (UpdateStatement)node;
                dynamic         ts  = upd.TableSource;
                AddAvailTable(ts, ret);
                AddAvailTables(upd.FromClause, ret);
            }

            if (node is DeleteStatement)
            {
                dynamic ts = ((DeleteStatement)node).Table;
                AddAvailTable(ts, ret);
            }

            if (node is InsertStatement)
            {
                InsertStatement insert = (InsertStatement)node;
                if (insert.InsertTarget is DbObjectInsertTarget)
                {
                    AddAvailTable(((DbObjectInsertTarget)insert.InsertTarget).TableSource, ret);
                }
            }

            if (node is CreateIndexStatement)
            {
                CreateIndexStatement stmt = (CreateIndexStatement)node;
                if (stmt.IndexTarget is DbObjectIndexTarget)
                {
                    AddAvailTable(stmt.IndexTarget.TableSource, ret);
                }
            }

            if (node is DropIndexStatement)
            {
                DropIndexStatement stmt = (DropIndexStatement)node;
                foreach (DropIndexAction action in stmt.Actions)
                {
                    if (action.TableSource != null)
                    {
                        AddAvailTable(action.TableSource, ret);
                    }
                }
            }

            if (node is AlterIndexStatement)
            {
                AlterIndexStatement stmt = (AlterIndexStatement)node;
                if (stmt.TableSource != null)
                {
                    // It will be removed in Modifier, so probably useless code
                    AddAvailTable(stmt.TableSource, ret);
                }
            }

            if (node is AlterTableStatement)
            {
                AlterTableStatement stmt = (AlterTableStatement)node;
                if (stmt.TableSource != null)
                {
                    AddAvailTable(stmt.TableSource, ret);
                }
            }

            if (node is DropTableStatement)
            {
                DropTableStatement stmt = (DropTableStatement)node;
                foreach (DbObjectTableSource tableSource in stmt.TableSources)
                {
                    if (tableSource != null)
                    {
                        AddAvailTable(tableSource, ret);
                    }
                }
            }

            TrimTables(ref ret);
            return((ret.Count == 0) ? null : ret);
        }
示例#13
0
 public override void ExplicitVisit(AlterIndexStatement node)
 {
     Alters.Add(node);
     _called = true;
     base.ExplicitVisit(node);
 }
 /// <summary>
 /// Add all options to the list of index options, overriding existing values if present
 /// </summary>
 public override void ExplicitVisit(AlterIndexStatement node)
 {
     IndexExplicitVisit(node);
 }