Exemple #1
0
        public static Expr CreateColumnExpr(Context ctx, SrcList src, int srcId, int colId)
        {
            Expr p = Expr.Alloc(ctx, TK.COLUMN, null, false);

            if (p != null)
            {
                SrcList.SrcListItem item = src.Ids[srcId];
                p.Table   = item.Table;
                p.TableId = item.Cursor;
                if (p.Table.PKey == colId)
                {
                    p.ColumnIdx = -1;
                }
                else
                {
                    p.ColumnIdx = (yVars)colId;
                    C.ASSERTCOVERAGE(colId == BMS);
                    C.ASSERTCOVERAGE(colId == BMS - 1);
                    item.ColUsed |= ((Bitmask)1) << (colId >= BMS ? BMS - 1 : colId);
                }
                E.ExprSetProperty(p, EP.Resolved);
            }
            return(p);
        }