diff --git a/src/NHibernate.Test/Hql/Ast/BulkManipulation.cs b/src/NHibernate.Test/Hql/Ast/BulkManipulation.cs index fcdf0cbe2da..a59720c1d19 100644 --- a/src/NHibernate.Test/Hql/Ast/BulkManipulation.cs +++ b/src/NHibernate.Test/Hql/Ast/BulkManipulation.cs @@ -513,9 +513,8 @@ public void UpdateOnManyToOne() ITransaction t = s.BeginTransaction(); s.CreateQuery("update Animal a set a.mother = null where a.id = 2").ExecuteUpdate(); - if (! (Dialect is MySQLDialect)) + if (Dialect.SupportsSubqueryOnMutatingTable) { - // MySQL does not support (even un-correlated) subqueries against the update-mutating table s.CreateQuery("update Animal a set a.mother = (from Animal where id = 1) where a.id = 2").ExecuteUpdate(); } @@ -624,9 +623,8 @@ public void UpdateOnAnimal() .ExecuteUpdate(); Assert.That(count, Is.EqualTo(6), "incorrect count on 'complex' update assignment"); - if (! (Dialect is MySQLDialect)) + if (Dialect.SupportsSubqueryOnMutatingTable) { - // MySQL does not support (even un-correlated) subqueries against the update-mutating table s.CreateQuery("update Animal set bodyWeight = ( select max(bodyWeight) from Animal )").ExecuteUpdate(); } @@ -682,9 +680,8 @@ public void UpdateOnMammal() count = s.CreateQuery("update Mammal set bodyWeight = 25").ExecuteUpdate(); Assert.That(count, Is.EqualTo(2), "incorrect update count against 'middle' of joined-subclass hierarchy"); - if (! (Dialect is MySQLDialect)) + if (Dialect.SupportsSubqueryOnMutatingTable) { - // MySQL does not support (even un-correlated) subqueries against the update-mutating table count = s.CreateQuery("update Mammal set bodyWeight = ( select max(bodyWeight) from Animal )").ExecuteUpdate(); Assert.That(count, Is.EqualTo(2), "incorrect update count against 'middle' of joined-subclass hierarchy"); } diff --git a/src/NHibernate.Test/SqlTest/Custom/MySQL/MySQLTest.cs b/src/NHibernate.Test/SqlTest/Custom/MySQL/MySQLTest.cs index d3eee8a56a8..5e821b2d082 100644 --- a/src/NHibernate.Test/SqlTest/Custom/MySQL/MySQLTest.cs +++ b/src/NHibernate.Test/SqlTest/Custom/MySQL/MySQLTest.cs @@ -14,7 +14,7 @@ protected override IList Mappings protected override bool AppliesTo(Dialect.Dialect dialect) { - return dialect is MySQL5Dialect || dialect is MySQLDialect; + return dialect is MySQLDialect; } } } \ No newline at end of file diff --git a/src/NHibernate/Dialect/DB2Dialect.cs b/src/NHibernate/Dialect/DB2Dialect.cs index 5dd78d65360..f0b242ab89d 100644 --- a/src/NHibernate/Dialect/DB2Dialect.cs +++ b/src/NHibernate/Dialect/DB2Dialect.cs @@ -270,5 +270,19 @@ public override string ForUpdateString { get { return " for read only with rs"; } } + + #region Overridden informational metadata + + public override bool SupportsEmptyInList => false; + + public override bool SupportsResultSetPositionQueryMethodsOnForwardOnlyCursor => false; + + public override bool SupportsLobValueChangePropogation => false; + + public override bool SupportsExistsInSelect => false; + + public override bool DoesReadCommittedCauseWritersToBlockReaders => true; + + #endregion } } \ No newline at end of file diff --git a/src/NHibernate/Dialect/Dialect.cs b/src/NHibernate/Dialect/Dialect.cs index c9240005f95..402b30b1560 100644 --- a/src/NHibernate/Dialect/Dialect.cs +++ b/src/NHibernate/Dialect/Dialect.cs @@ -1879,7 +1879,7 @@ public virtual bool SupportsParametersInInsertSelect /// /// Does this dialect require that references to result variables - /// (i.e, select expresssion aliases) in an ORDER BY clause be + /// (i.e, select expression aliases) in an ORDER BY clause be /// replaced by column positions (1-origin) as defined by the select clause? /// /// @@ -2050,8 +2050,6 @@ public virtual bool SupportsBindAsCallableArgument get { return true; } } - #endregion - /// /// Does this dialect support subselects? /// @@ -2060,6 +2058,8 @@ public virtual bool SupportsSubSelects get { return true; } } + #endregion + /// /// Retrieve a set of default Hibernate properties for this database. /// @@ -2136,7 +2136,7 @@ public virtual string CreateTemporaryTablePostfix /// /// Should the value returned by /// be treated as callable. Typically this indicates that JDBC escape - /// sytnax is being used... + /// syntax is being used... /// public virtual bool IsCurrentTimestampSelectStringCallable { diff --git a/src/NHibernate/Dialect/Ingres9Dialect.cs b/src/NHibernate/Dialect/Ingres9Dialect.cs index b17ce9eb922..9853388c625 100644 --- a/src/NHibernate/Dialect/Ingres9Dialect.cs +++ b/src/NHibernate/Dialect/Ingres9Dialect.cs @@ -64,5 +64,11 @@ public override SqlString GetLimitString(SqlString queryString, SqlString offset return pagingBuilder.ToSqlString(); } + + #region Overridden informational metadata + + public override bool DoesRepeatableReadCauseReadersToBlockWriters => true; + + #endregion } } \ No newline at end of file diff --git a/src/NHibernate/Dialect/IngresDialect.cs b/src/NHibernate/Dialect/IngresDialect.cs index 78b783ec8e4..616d7cde29b 100644 --- a/src/NHibernate/Dialect/IngresDialect.cs +++ b/src/NHibernate/Dialect/IngresDialect.cs @@ -51,5 +51,17 @@ public IngresDialect() DefaultProperties[Environment.ConnectionDriver] = "NHibernate.Driver.IngresDriver"; } + + #region Overridden informational metadata + + public override bool SupportsEmptyInList => false; + + public override bool SupportsSubselectAsInPredicateLHS => false; + + public override bool SupportsExpectedLobUsagePattern => false; + + public override bool DoesReadCommittedCauseWritersToBlockReaders => true; + + #endregion } } \ No newline at end of file diff --git a/src/NHibernate/Dialect/MsSql2000Dialect.cs b/src/NHibernate/Dialect/MsSql2000Dialect.cs index a2c41524352..c62c4e47259 100644 --- a/src/NHibernate/Dialect/MsSql2000Dialect.cs +++ b/src/NHibernate/Dialect/MsSql2000Dialect.cs @@ -498,6 +498,23 @@ public override bool SupportsSqlBatches get { return true; } } + #region Overridden informational metadata + + public override bool SupportsEmptyInList => false; + + public override bool AreStringComparisonsCaseInsensitive => true; + + public override bool SupportsResultSetPositionQueryMethodsOnForwardOnlyCursor => false; + + // note: at least SQL Server 2005 Express shows this not working... + public override bool SupportsLobValueChangePropogation => false; + + public override bool DoesReadCommittedCauseWritersToBlockReaders => true; + + public override bool DoesRepeatableReadCauseReadersToBlockWriters => true; + + #endregion + public override bool IsKnownToken(string currentToken, string nextToken) { return currentToken == "n" && nextToken == "'"; // unicode character diff --git a/src/NHibernate/Dialect/MsSql2005Dialect.cs b/src/NHibernate/Dialect/MsSql2005Dialect.cs index 49dc47513f0..4e3cd731dde 100644 --- a/src/NHibernate/Dialect/MsSql2005Dialect.cs +++ b/src/NHibernate/Dialect/MsSql2005Dialect.cs @@ -102,5 +102,21 @@ public override string AppendLockHint(LockMode lockMode, string tableName) return tableName; } + + #region Overridden informational metadata + + /// + /// We assume that applications using this dialect are using + /// SQL Server 2005 snapshot isolation modes. + /// + public override bool DoesReadCommittedCauseWritersToBlockReaders => false; + + /// + /// We assume that applications using this dialect are using + /// SQL Server 2005 snapshot isolation modes. + /// + public override bool DoesRepeatableReadCauseReadersToBlockWriters => false; + + #endregion } } diff --git a/src/NHibernate/Dialect/MySQLDialect.cs b/src/NHibernate/Dialect/MySQLDialect.cs index 5c8865985ee..9997784542d 100644 --- a/src/NHibernate/Dialect/MySQLDialect.cs +++ b/src/NHibernate/Dialect/MySQLDialect.cs @@ -386,5 +386,18 @@ public override long TimestampResolutionInTicks return TimeSpan.TicksPerSecond; } } + + #region Overridden informational metadata + + public override bool SupportsEmptyInList => false; + + public override bool AreStringComparisonsCaseInsensitive => true; + + // note: at least MySQL 5.1 shows this not working... + public override bool SupportsLobValueChangePropogation => false; + + public override bool SupportsSubqueryOnMutatingTable => false; + + #endregion } } \ No newline at end of file diff --git a/src/NHibernate/Dialect/PostgreSQLDialect.cs b/src/NHibernate/Dialect/PostgreSQLDialect.cs index 2bb45c861f3..c20ee556d13 100644 --- a/src/NHibernate/Dialect/PostgreSQLDialect.cs +++ b/src/NHibernate/Dialect/PostgreSQLDialect.cs @@ -249,5 +249,22 @@ public override string CurrentTimestampSelectString { get { return "SELECT CURRENT_TIMESTAMP"; } } + + #region Overridden informational metadata + + public override bool SupportsEmptyInList => false; + + /// + /// Should LOBs (both BLOB and CLOB) be bound using stream operations (i.e. + /// {@link java.sql.PreparedStatement#setBinaryStream}). + /// + /// True if BLOBs and CLOBs should be bound using stream operations. + public override bool UseInputStreamToInsertBlob => false; + + public override bool SupportsLobValueChangePropogation => false; + + public override bool SupportsUnboundedLobLocatorMaterialization => false; + + #endregion } }