public bool contains_1_2(int arg12) { PrepareInsert12(); if (Array.SortedArrayContains(insertList12, arg12)) { return(true); } if (table.contains_1_2(arg12)) { //## THIS COULD BE MADE FASTER BY CHECKING FIRST WHETHER arg12 APPEARS IN THE DELETE LIST AT ALL Prepare(); Sym12TernaryTable.Iter it = table.getIter_1_2(arg12); Debug.Assert(!it.Done()); do { int arg1 = arg12; int arg2 = it.Get1(); int arg3 = it.Get2(); if (arg1 >= arg2) { arg1 = arg2; arg2 = arg12; } if (!Ints123.Contains(deleteList, deleteCount, arg1, arg2, arg3)) { return(true); } it.Next(); } while (!it.Done()); } return(false); }
private ForeignKeyViolationException ForeignKeyViolation(int arg12Surr) { Sym12TernaryTable.Iter it = source.table.getIter_1_2(arg12Surr); Obj arg1 = source.store12.SurrToValue(arg12Surr); Obj arg2 = source.store12.SurrToValue(it.Get1()); Obj arg3 = source.store3.SurrToValue(it.Get2()); Obj[] tuple = new Obj[] { arg1, arg2, arg3 }; return(ForeignKeyViolationException.SymTernary12Unary(source.relvarName, target.relvarName, tuple, arg1)); }
////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// public static void Write(DataWriter writer, int fieldSymbId, Sym12TernaryTable[] tables, int indentation, bool indentFirstLine, bool writeSeparator) { string baseWs = new string(Array.Repeat(' ', indentation)); string entryWs = new string(Array.Repeat(' ', indentation + 2)); int count = 0; for (int i = 0; i < tables.Length; i++) { count += tables[i].Size(); } if (indentFirstLine) { writer.Write(baseWs); } writer.Write(SymbObj.IdxToStr(fieldSymbId)); writer.Write(": ["); if (count > 0) { writer.Write("\n"); int written = 0; for (int i = 0; i < tables.Length; i++) { Sym12TernaryTable table = tables[i]; SurrObjMapper mapper12 = table.mapper12; SurrObjMapper mapper3 = table.mapper3; Sym12TernaryTable.Iter it = table.GetIter(); while (!it.Done()) { writer.Write(entryWs); Obj obj1 = mapper12(it.Get1()); Obj obj2 = mapper12(it.Get2()); Obj obj3 = mapper3(it.Get3()); ObjPrinter.PrintNoFlush(obj1, writer); writer.Write(", "); ObjPrinter.PrintNoFlush(obj2, writer); writer.Write(", "); ObjPrinter.PrintNoFlush(obj3, writer); written++; writer.Write(written < count || count == 1 ? ";\n" : "\n"); it.Next(); } } Debug.Assert(written == count); writer.Write(baseWs); } writer.Write(writeSeparator ? "],\n" : "]\n"); }
public void Delete_13_23(int arg12, int arg3) { Sym12TernaryTable.Iter it = table.getIter_13_23(arg12, arg3); while (!it.Done()) { int arg1 = arg12; int arg2 = it.Get1(); if (arg1 > arg2) { arg1 = arg2; arg2 = arg12; } deleteList = Array.Append3(deleteList, deleteCount++, arg1, arg2, arg3); it.Next(); } }