public ColumnConditions this[Schema.TableVarColumn column] { get { int index = IndexOf(column); if (index < 0) { ColumnConditions conditions = new ColumnConditions(column); Add(conditions); return(conditions); } else { return(this[index]); } } }
protected bool IsValidScanOrder(Plan plan, Schema.Order order, Conditions closedConditions, Conditions openConditions, ColumnConditions scanCondition) { int columnIndex; for (int index = 0; index < closedConditions.Count; index++) { columnIndex = order.Columns.IndexOf(closedConditions[index].Column.Name, Compiler.GetUniqueSort(plan, closedConditions[index].Column.DataType)); if ((columnIndex < 0) || (columnIndex >= closedConditions.Count)) { return(false); } } for (int index = 0; index < openConditions.Count; index++) { columnIndex = order.Columns.IndexOf(openConditions[index].Column.Name, Compiler.GetUniqueSort(plan, openConditions[index].Column.DataType)); if ((columnIndex < closedConditions.Count) || (columnIndex >= closedConditions.Count + openConditions.Count)) { return(false); } } if (scanCondition != null) { columnIndex = order.Columns.IndexOf(scanCondition.Column.Name, Compiler.GetUniqueSort(plan, scanCondition.Column.DataType)); if (columnIndex != (closedConditions.Count + openConditions.Count - 1)) { return(false); } } return(true); }