public void UnsignedAutoIncrement() { Mysqltypetest2Collection coll = new Mysqltypetest2Collection(); // There is a bug in the 1.0.7 Connector/Net for unsigned types. // It is fixed in 5.0.3. switch (coll.es.Connection.ProviderSignature.DataProviderName) { case "EntitySpaces.MySqlClientProvider": using (esTransactionScope scope = new esTransactionScope()) { Mysqltypetest2 datatypeTest = new Mysqltypetest2(); datatypeTest.CharType = "X"; datatypeTest.VarCharType = "xxx"; datatypeTest.str().DateType = "2007-01-01"; datatypeTest.str().DateTimeType = "2006-12-31 11:59:30"; datatypeTest.TextType = "Some test text."; datatypeTest.str().TimeType = "12:34:56.789"; datatypeTest.LongTextType = "Some more test text."; datatypeTest.Save(); uint?tempKey = datatypeTest.Id; Assert.IsTrue(datatypeTest.LoadByPrimaryKey(tempKey.Value)); datatypeTest.MarkAsDeleted(); datatypeTest.Save(); } break; default: Assert.Ignore("MySQL only"); break; } }
public void MySQLBinaryTest() { Mysqltypetest2Collection collection = new Mysqltypetest2Collection(); if (collection.es.Connection.ProviderMetadataKey == "esMySQL" && collection.es.Connection.SqlAccessType == EntitySpaces.Interfaces.esSqlAccessType.DynamicSQL) { try { Mysqltypetest2 datatypeTest = new Mysqltypetest2(); datatypeTest.LoadByPrimaryKey(1); Assert.AreEqual("Hello", datatypeTest.BinaryType.TrimEnd('\0')); Assert.AreEqual("Hello 2", datatypeTest.VarBinaryType); datatypeTest = new Mysqltypetest2(); datatypeTest.BinaryType = "Testing"; datatypeTest.VarBinaryType = "Testing 2"; datatypeTest.Save(); uint typeKey = datatypeTest.Id.Value; datatypeTest = new Mysqltypetest2(); datatypeTest.LoadByPrimaryKey(typeKey); Assert.AreEqual("Testing", datatypeTest.BinaryType.TrimEnd('\0')); Assert.AreEqual("Testing 2", datatypeTest.VarBinaryType); // Clean up datatypeTest.MarkAsDeleted(); datatypeTest.Save(); } catch (Exception ex) { Assert.Fail(ex.ToString()); } } else { Assert.Ignore("MySQL Dynamic only"); } }
public void UnsignedAutoIncrement() { Mysqltypetest2Collection coll = new Mysqltypetest2Collection(); // There is a bug in the 1.0.7 Connector/Net for unsigned types. // It is fixed in 5.0.3. switch (coll.es.Connection.ProviderSignature.DataProviderName) { case "EntitySpaces.MySqlClientProvider": using (esTransactionScope scope = new esTransactionScope()) { Mysqltypetest2 datatypeTest = new Mysqltypetest2(); datatypeTest.CharType = "X"; datatypeTest.VarCharType = "xxx"; datatypeTest.str().DateType = "2007-01-01"; datatypeTest.str().DateTimeType = "2006-12-31 11:59:30"; datatypeTest.TextType = "Some test text."; datatypeTest.str().TimeType = "12:34:56.789"; datatypeTest.LongTextType = "Some more test text."; datatypeTest.Save(); uint? tempKey = datatypeTest.Id; Assert.IsTrue(datatypeTest.LoadByPrimaryKey(tempKey.Value)); datatypeTest.MarkAsDeleted(); datatypeTest.Save(); } break; default: Assert.Ignore("MySQL only"); break; } }