public override void Bind(BindContext context) { base.Bind(context); type_ = new IntType(); // Try adding all tableRefs to fix count(*) being orphaned and // getting pushed to random side when join transformations happen. // tableRefs_ = context.AllTableRefs(); }
public override void Bind(BindContext context) { base.Bind(context); type_ = new IntType(); // Add the first table in the scope as tableref of count(*) // because adding all of them would make the containg expression // to appear to require more than one table when that is really // not the case and may lead to attempts create a join or push // count(*) to both sides of an existing join. // This will let count(*) to be pushed to the correct node and side. List <TableRef> trefs = context.AllTableRefs(); if (trefs.Count > 0) { tableRefs_.Add(trefs[0]); } }