private static SqlType GetTimeStamp() { QNameManager.QName name = QNameManager.NewInfoSchemaObjectName("TIME_STAMP", false, 13); TimeStamp = new DateTimeType(0x5d, 0x5d, 6); TimeStamp.userTypeModifier = new UserTypeModifier(name, 13, TimeStamp); return(TimeStamp); }
private static SqlType GetYesOrNo() { QNameManager.QName name = QNameManager.NewInfoSchemaObjectName("YES_OR_NO", false, 13); YesOrNo = new CharacterType(12, 3L); YesOrNo.userTypeModifier = new UserTypeModifier(name, 13, YesOrNo); return(YesOrNo); }
private static SqlType GetSqlIdentifier() { QNameManager.QName name = QNameManager.NewInfoSchemaObjectName("SQL_IDENTIFIER", false, 13); SqlIdentifier = new CharacterType(12, 0x80L); SqlIdentifier.userTypeModifier = new UserTypeModifier(name, 13, SqlIdentifier); return(SqlIdentifier); }
private static SqlType GetCardinalNumber() { QNameManager.QName name = QNameManager.NewInfoSchemaObjectName("CARDINAL_NUMBER", false, 13); CardinalNumber = new NumberType(0x19, 0L, 0); CardinalNumber.userTypeModifier = new UserTypeModifier(name, 13, CardinalNumber); return(CardinalNumber); }
private static SqlType GetCharacterData() { QNameManager.QName name = QNameManager.NewInfoSchemaObjectName("CHARACTER_DATA", false, 13); CharacterData = new CharacterType(12, 0x10000L); CharacterData.userTypeModifier = new UserTypeModifier(name, 13, CharacterData); return(CharacterData); }
public void AddParameter(ColumnSchema param) { QNameManager.QName name = param.GetName(); string key = (name == null) ? QNameManager.GetAutoNoNameColumnString(this.ParameterList.Size()) : name.Name; this.ParameterList.Add(key, param); }
public static void AddAutoColumns(Table table, SqlType[] colTypes) { for (int i = 0; i < colTypes.Length; i++) { ColumnSchema column = new ColumnSchema(QNameManager.GetAutoColumnName(i), colTypes[i], true, false, null); table.AddColumnNoCheck(column); } }
private void ClearStructures() { if (this.schemaManager != null) { this.schemaManager.ClearStructures(); } this.granteeManager = null; this.userManager = null; this.NameManager = null; this.schemaManager = null; this.DbInfo = null; }
private static User GetSystemAuthorisation() { User user = new User(QNameManager.NewSystemObjectName("SYS", 11), null) { IsSystem = true }; user.SetAdminDirect(); user.SetInitialSchema(SqlInvariants.SystemSchemaQname); SqlInvariants.InformationSchemaQname.Owner = user; SqlInvariants.SystemSchemaQname.Owner = user; SqlInvariants.LobsSchemaQname.Owner = user; SqlInvariants.SqljSchemaQname.Owner = user; return(user); }
public static Table NewLookupTable(Database database) { Table table; QNameManager.QName subqueryTableName = database.NameManager.GetSubqueryTableName(); ColumnSchema column = new ColumnSchema(QNameManager.GetAutoColumnName(0), SqlType.SqlInteger, false, true, null); TableDerived derived1 = new TableDerived(database, subqueryTableName, 2, null, null); derived1.AddColumn(column); TableDerived derived2 = table = derived1; QNameManager.QName name = derived2.GetName(); int[] columns = new int[1]; table.CreatePrimaryKeyConstraint(name, columns, true); return(derived2); }
private Result ExecuteBlock(Session session) { Result updateZeroResult = Result.UpdateZeroResult; bool flag = !base.Root.IsTrigger(); if (flag) { session.sessionContext.Push(false); session.sessionContext.PushRoutineTables(this.ScopeTables); if (this.HasUndoHandler) { string autoSavepointNameString = QNameManager.GetAutoSavepointNameString(session.ActionTimestamp, session.sessionContext.Depth); session.Savepoint(autoSavepointNameString); } } for (int i = 0; i < this.Statements.Length; i++) { Result result = this.Statements[i].Execute(session); updateZeroResult = this.HandleCondition(session, result); if (updateZeroResult.IsError() || (updateZeroResult.GetResultType() == 0x2a)) { break; } if (updateZeroResult.IsData() && !base.Root.IsFunction()) { session.AddResultSet(result); updateZeroResult = Result.UpdateZeroResult; } } if ((updateZeroResult.GetResultType() == 0x2a) && (updateZeroResult.GetErrorCode() == 0x59)) { if (updateZeroResult.GetMainString() == null) { updateZeroResult = Result.UpdateZeroResult; } else if ((this.label != null) && this.label.Name.Equals(updateZeroResult.GetMainString())) { updateZeroResult = Result.UpdateZeroResult; } } if (flag) { session.sessionContext.PopRoutineTables(); session.sessionContext.Pop(false); } return(updateZeroResult); }
private void Reopen() { this.SetState(4); try { this.NameManager = new QNameManager(this); this.granteeManager = new GranteeManager(this); this.userManager = new UserManager(this); this.schemaManager = new SchemaManager(this); this.persistentStoreCollection = new PersistentStoreCollectionDatabase(); this._isReferentialIntegrity = true; this.sessionManager = new SessionManager(this); this.collation = Collation.GetDefaultInstance(); this.DbInfo = DatabaseInformation.NewDatabaseInformation(this); this.TxManager = new TransactionManagerMvcc(this); this.lobManager.CreateSchema(); this.sessionManager.GetSysLobSession().SetSchema("SYSTEM_LOBS"); this.schemaManager.SetSchemaChangeTimestamp(); this.logger.OpenPersistence(); if (this.logger.IsNewDatabase) { string property = this.UrlProperties.GetProperty("user", "SA"); string password = this.UrlProperties.GetProperty("password", ""); this.userManager.CreateFirstUser(property, password); this.schemaManager.CreatePublicSchema(); this.lobManager.InitialiseLobSpace(); this.logger.Checkpoint(false); } this.lobManager.Open(); this.DbInfo.SetWithContent(true); } catch (Exception error) { this.logger.ClosePersistence(-1); this.logger.ReleaseLock(); this.SetState(0x10); this.ClearStructures(); DatabaseManager.RemoveDatabase(this); if (!(error is CoreException)) { error = Error.GetError(0x1ca, error); } this.logger.LogSevereEvent(FwNs.Core.LC.cResources.SR.Database_Reopen_could_not_reopen_database, error); throw; } this.SetState(1); }
private static QNameManager.QName GetSystemSubqueryQname() { QNameManager.QName name1 = QNameManager.NewSystemObjectName("SYSTEM_SUBQUERY", 3); name1.SetSchemaIfNull(SystemSchemaQname); return(name1); }
public Collation() { this._name = QNameManager.NewInfoSchemaObjectName(this._locale.EnglishName, true, 15); }