Inheritance: PrimaryExpression
示例#1
0
 public ShowTables(bool full, Identifier schema, IExpression where)
 {
     IsFull = full;
     Schema = schema;
     Pattern = null;
     Where = where;
 }
示例#2
0
        public DataType(DataTypeName typeName,
                        bool unsigned,
                        bool zerofill,
                        bool binary,
                        IExpression length,
                        IExpression decimals,
                        Identifier charSet,
                        Identifier collation,
                        IList<IExpression> collectionVals)
        {
            // BIT[(length)]
            // | TINYINT[(length)] [UNSIGNED] [ZEROFILL]
            // | SMALLINT[(length)] [UNSIGNED] [ZEROFILL]
            // | MEDIUMINT[(length)] [UNSIGNED] [ZEROFILL]
            // | INT[(length)] [UNSIGNED] [ZEROFILL]
            // | INTEGER[(length)] [UNSIGNED] [ZEROFILL]
            // | BIGINT[(length)] [UNSIGNED] [ZEROFILL]
            // | DOUBLE[(length,decimals)] [UNSIGNED] [ZEROFILL]
            // | REAL[(length,decimals)] [UNSIGNED] [ZEROFILL]
            // | FLOAT[(length,decimals)] [UNSIGNED] [ZEROFILL]
            // | DECIMAL[(length[,decimals])] [UNSIGNED] [ZEROFILL]
            // | NUMERIC[(length[,decimals])] [UNSIGNED] [ZEROFILL] 同上
            // | DATE
            // | TIME
            // | TIMESTAMP
            // | DATETIME
            // | YEAR
            // | CHAR[(length)][CHARACTER SET charset_name] [COLLATE collation_name]
            // | VARCHAR(length)[CHARACTER SET charset_name] [COLLATE collation_name]
            // | BINARY[(length)]
            // | VARBINARY(length)
            // | TINYBLOB
            // | BLOB
            // | MEDIUMBLOB
            // | LONGBLOB
            // | TINYTEXT [BINARY][CHARACTER SET charset_name] [COLLATE collation_name]
            // | TEXT [BINARY][CHARACTER SET charset_name] [COLLATE collation_name]
            // | MEDIUMTEXT [BINARY][CHARACTER SET charset_name] [COLLATE
            // collation_name]
            // | LONGTEXT [BINARY][CHARACTER SET charset_name] [COLLATE collation_name]
            // | ENUM(value1,value2,value3,...)[CHARACTER SET charset_name] [COLLATE
            // collation_name]
            // | SET(value1,value2,value3,...)[CHARACTER SET charset_name] [COLLATE
            // collation_name]
            // | spatial_type 不支�?
            if (typeName == DataTypeName.None)
            {
                throw new ArgumentException("typeName is null");
            }

            TypeName = typeName;
            IsUnsigned = unsigned;
            IsZerofill = zerofill;
            IsBinary = binary;
            Length = length;
            Decimals = decimals;
            CharSet = charSet;
            Collation = collation;
            CollectionVals = collectionVals;
        }
 public DdlAlterTableStatement(bool ignore, Identifier table)
 {
     // | DISABLE KEYS
     // | ENABLE KEYS
     // | RENAME [TO] new_tbl_name
     // | ORDER BY col_name [, col_name] ...
     // | CONVERT TO CHARACTER SET charset_name [COLLATE collation_name]
     // | DISCARD TABLESPACE
     // | IMPORT TABLESPACE
     // /// | ADD [CONSTRAINT [symbol]] FOREIGN KEY [index_name]
     // (index_col_name,...) reference_definition
     // /// | DROP FOREIGN KEY fk_symbol
     // /// | ADD PARTITION (partition_definition)
     // /// | DROP PARTITION partition_names
     // /// | TRUNCATE PARTITION {partition_names | ALL }
     // /// | COALESCE PARTITION number
     // /// | REORGANIZE PARTITION partition_names INTO (partition_definitions)
     // /// | ANALYZE PARTITION {partition_names | ALL }
     // /// | CHECK PARTITION {partition_names | ALL }
     // /// | OPTIMIZE PARTITION {partition_names | ALL }
     // /// | REBUILD PARTITION {partition_names | ALL }
     // /// | REPAIR PARTITION {partition_names | ALL }
     // /// | REMOVE PARTITIONING
     // ADD, ALTER, DROP, and CHANGE can be multiple
     IsIgnore = ignore;
     Table = table;
     Alters = new List<AlterSpecification>(1);
 }
 /// <exception cref="System.SqlSyntaxErrorException" />
 public DmlDeleteStatement(bool lowPriority,
                           bool quick,
                           bool ignore,
                           Identifier tableName)
     : this(lowPriority, quick, ignore, tableName, null, null, null)
 {
 }
示例#5
0
 public ShowTableStatus(Identifier database,
                        IExpression where)
 {
     Database = database;
     Pattern = null;
     Where = where;
 }
示例#6
0
 public IndexOption(Identifier parserName)
 {
     KeyBlockSize = null;
     IndexType = IndexType.Btree;
     ParserName = parserName;
     Comment = null;
 }
示例#7
0
 public ShowTables(bool full, Identifier schema, string pattern)
 {
     IsFull = full;
     Schema = schema;
     Pattern = pattern;
     Where = null;
 }
示例#8
0
 public ShowTables(bool full, Identifier schema)
 {
     IsFull = full;
     Schema = schema;
     Pattern = null;
     Where = null;
 }
 public DmlReplaceStatement(ReplaceMode mode,
                            Identifier table,
                            IList<Identifier> columnNameList,
                            IQueryExpression select)
     : base(table, columnNameList, select)
 {
     Mode = mode;
 }
 public DmlReplaceStatement(ReplaceMode mode,
                            Identifier table,
                            IList<Identifier> columnNameList,
                            IList<RowExpression> rowList)
     : base(table, columnNameList, rowList)
 {
     Mode = mode;
 }
 public MTSSavepointStatement(Identifier savepoint)
 {
     if (savepoint == null)
     {
         throw new ArgumentException("savepoint is null");
     }
     Savepoint = savepoint;
 }
示例#12
0
 public DescTableStatement(Identifier table)
 {
     if (table == null)
     {
         throw new ArgumentException("table is null for desc table");
     }
     Table = table;
 }
示例#13
0
        /// <returns>
        ///     type of
        ///     <see cref="Tup.Cobar4Net.Parser.Ast.Expression.Primary.Wildcard" />
        ///     is possible. never null
        /// </returns>
        /// <exception cref="System.SqlSyntaxErrorException">
        ///     if identifier dose not matched
        /// </exception>
        protected internal virtual Identifier Identifier()
        {
            if (lexer.Token() == MySqlToken.None)
            {
                lexer.NextToken();
            }
            Identifier id;
            switch (lexer.Token())
            {
                case MySqlToken.OpAsterisk:
                {
                    lexer.NextToken();
                    var wc = new Wildcard(null);
                    wc.SetCacheEvalRst(cacheEvalRst);
                    return wc;
                }

                case MySqlToken.Identifier:
                {
                    id = new Identifier(null, lexer.GetStringValue(), lexer.GetStringValueUppercase());
                    id.SetCacheEvalRst(cacheEvalRst);
                    lexer.NextToken();
                    break;
                }

                default:
                {
                    throw Err("expect id or * after '.'");
                }
            }
            for (; lexer.Token() == MySqlToken.PuncDot;)
            {
                switch (lexer.NextToken())
                {
                    case MySqlToken.OpAsterisk:
                    {
                        lexer.NextToken();
                        var wc_1 = new Wildcard(id);
                        wc_1.SetCacheEvalRst(cacheEvalRst);
                        return wc_1;
                    }

                    case MySqlToken.Identifier:
                    {
                        id = new Identifier(id, lexer.GetStringValue(), lexer.GetStringValueUppercase());
                        id.SetCacheEvalRst(cacheEvalRst);
                        lexer.NextToken();
                        break;
                    }

                    default:
                    {
                        throw Err("expect id or * after '.'");
                    }
                }
            }
            return id;
        }
 protected DmlInsertReplaceStatement(Identifier table,
                                     IList<Identifier> columnNameList,
                                     IList<RowExpression> rowList)
 {
     this.table = table;
     this.columnNameList = EnsureListType(columnNameList);
     this.rowList = EnsureListType(rowList);
     select = null;
 }
        public MTSRollbackStatement(Identifier savepoint)
        {
            CompleteType = CompleteType.None;

            if (savepoint == null)
            {
                throw new ArgumentException("savepoint is null!");
            }
            Savepoint = savepoint;
        }
示例#16
0
 public ShowColumns(bool full, Identifier table, Identifier database)
 {
     IsFull = full;
     Table = table;
     if (database != null)
     {
         Table.Parent = database;
     }
     Pattern = null;
     Where = null;
 }
示例#17
0
 /// <summary>
 /// </summary>
 /// <param name="mode"></param>
 /// <param name="ignore"></param>
 /// <param name="table"></param>
 /// <param name="columnNameList"></param>
 /// <param name="select"></param>
 /// <param name="duplicateUpdate"></param>
 public DmlInsertStatement(InsertMode mode,
                           bool ignore,
                           Identifier table,
                           IList<Identifier> columnNameList,
                           IQueryExpression select,
                           IList<Pair<Identifier, IExpression>> duplicateUpdate)
     : base(table, columnNameList, select)
 {
     Mode = mode;
     IsIgnore = ignore;
     DuplicateUpdate = EnsureListType(duplicateUpdate);
 }
 protected DmlInsertReplaceStatement(Identifier table,
                                     IList<Identifier> columnNameList,
                                     IQueryExpression select)
 {
     if (select == null)
     {
         throw new ArgumentException("argument 'select' is empty");
     }
     this.select = select;
     this.table = table;
     this.columnNameList = EnsureListType(columnNameList);
     rowList = null;
 }
 public DdlCreateTableStatement(bool temporary,
                                bool ifNotExists,
                                Identifier table)
 {
     Table = table;
     IsTemporary = temporary;
     IsIfNotExists = ifNotExists;
     ColDefs = new List<Pair<Identifier, ColumnDefinition>>(4);
     UniqueKeys = new List<Pair<Identifier, IndexDefinition>>(1);
     Keys = new List<Pair<Identifier, IndexDefinition>>(2);
     FullTextKeys = new List<Pair<Identifier, IndexDefinition>>(1);
     SpatialKeys = new List<Pair<Identifier, IndexDefinition>>(1);
     Checks = new List<IExpression>(1);
 }
示例#20
0
 public TableRefFactor(Identifier table, string alias, IList<IndexHint> hintList)
     : base(alias)
 {
     this.table = table;
     if (hintList == null || hintList.IsEmpty())
     {
         HintList = new List<IndexHint>(0);
     }
     else if (hintList is List<IndexHint>)
     {
         HintList = hintList;
     }
     else
     {
         HintList = new List<IndexHint>(hintList);
     }
 }
示例#21
0
 public DmlCallStatement(Identifier procedure, IList<IExpression> arguments)
 {
     this.procedure = procedure;
     if (arguments == null || arguments.IsEmpty())
     {
         this.arguments = new List<IExpression>(0);
     }
     else
     {
         if (arguments is List<IExpression>)
         {
             this.arguments = arguments;
         }
         else
         {
             this.arguments = new List<IExpression>(arguments);
         }
     }
 }
示例#22
0
 /// <exception cref="System.SqlSyntaxErrorException" />
 public DmlDeleteStatement(bool lowPriority,
                           bool quick,
                           bool ignore,
                           Identifier tableName,
                           IExpression where,
                           OrderBy orderBy,
                           Limit limit)
 {
     // ------- single-row delete------------
     IsLowPriority = lowPriority;
     IsQuick = quick;
     IsIgnore = ignore;
     tableNames = new List<Identifier>(1);
     tableNames.Add(tableName);
     TableRefs = null;
     WhereCondition = where;
     OrderBy = orderBy;
     Limit = limit;
 }
 public DdlCreateIndexStatement(Identifier indexName, Identifier table)
 {
     IndexName = indexName;
     Table = table;
 }
示例#24
0
 public ExtDdlCreatePolicy(Identifier name)
 {
     Name = name;
     proportion = new List<Pair<int, IExpression>>(1);
 }
示例#25
0
 public DmlCallStatement(Identifier procedure)
 {
     this.procedure = procedure;
     arguments = new List<IExpression>(0);
 }
示例#26
0
 public Identifier(Identifier parent, string idText, string idTextUp)
 {
     this.parent      = parent;
     this.idText      = idText;
     idTextUpUnescape = UnescapeName(idTextUp);
 }
示例#27
0
 public ShowTriggers(Identifier schema, IExpression where)
 {
     Schema = schema;
     Pattern = null;
     Where = where;
 }
示例#28
0
 public ShowTriggers(Identifier schema, string pattern)
 {
     Schema = schema;
     Pattern = pattern;
     Where = null;
 }
示例#29
0
 public ShowFunctionCode(Identifier functionName)
 {
     FunctionName = functionName;
 }
示例#30
0
 public Identifier(Identifier parent, string idText)
     : this(parent, idText, idText.ToUpper())
 {
 }
示例#31
0
 public IndexColumnName(Identifier columnName, IExpression length, bool asc)
 {
     ColumnName = columnName;
     Length = length;
     IsAsc = asc;
 }
示例#32
0
 public ShowTriggers(Identifier schema)
 {
     Schema = schema;
     Pattern = null;
     Where = null;
 }