예제 #1
0
        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]);
            }
        }
예제 #2
0
        static ColumnType externalType2ColumnType(Type type)
        {
            ColumnType ctype;

            if (type == typeof(double))
            {
                ctype = new DoubleType();
            }
            else if (type == typeof(int))
            {
                ctype = new IntType();
            }
            else if (type == typeof(string))
            {
                ctype = new VarCharType(64 * 1024);
            }
            else
            {
                throw new NotImplementedException();
            }

            return(ctype);
        }
예제 #3
0
파일: ExprFunc.cs 프로젝트: caterby/qpmodel
 public override void Bind(BindContext context)
 {
     base.Bind(context);
     type_ = new IntType();
 }
예제 #4
0
파일: ExprFunc.cs 프로젝트: caterby/qpmodel
 public HashFunc(List <Expr> args) : base("hash", args)
 {
     argcnt_ = 1;
     type_   = new IntType();
 }