示例#1
0
 public XDataTableKey(XDataTableKey clone)
 {
     this.primary = clone.primary;
     this.unique  = clone.unique;
     this.name    = clone.name;
     this.columns = clone.columns;
 }
示例#2
0
        //----------------------------------------------------------------------

        static void AddIndexKey(XDataTable <DataRow> table, ref Types.XStringSeg word, bool has_name, bool primary, bool unique)
        {
            //table.Columns.
            XDataTableKey key = new XDataTableKey();

            //key.null = null;
            key.primary = primary;
            key.unique  = unique;
            bool quoted = false;

            if (has_name)
            {
                GrabName(ref word, out key.name, out quoted);
            }
            //else
            //	table.keys.key[table.keys.count-1].name = null;
            //table.keys.key[table.keys.count-1].colnames = New( CTEXTSTR );
            //table.keys.key[table.keys.count-1].colnames[0] = null;

            // 5.0 database this occurs before the columns
            if (word == "USING")
            {
                word = word.Next;
                if (word == "BTREE")
                {
                    word = word.Next;
                }
            }
            GrabKeyColumns(ref word, ref key.columns);
            // 5.5 database this occurs after the columns of index
            if (word == "USING")
            {
                word = word.Next;
                if (word == "BTREE")
                {
                    word = word.Next;
                }
            }
            table.keys.Add(key);
        }