#At file:///C:/Users/Reggie/work/connector-net/trunk/ based on revid:reggie.burnett@stripped
955 Reggie Burnett 2011-02-15 [merge]
merged
modified:
Installer/core.wxs
Installer/main.wxs
Installer/webproviders.wxs
MySql.Data/Provider/Source/MySqlConnectionStringBuilder.cs
MySql.Data/Provider/Source/NativeDriver.cs
MySql.Data/Provider/Source/command.cs
MySql.Data/Provider/Source/common/StreamCreator.cs
MySql.Data/Tests/Source/CommandTests.cs
MySql.Data/Tests/Source/ConnectionStringBuilder.cs
MySql.Data/Tests/Source/DataReaderTests.cs
MySql.VisualStudio/MySql.VisualStudio.VS2010.csproj
MySql.Web/Providers/Source/MembershipProvider.cs
MySql.Web/Tests/UserManagement.cs
=== modified file 'Installer/core.wxs'
=== modified file 'Installer/core.wxs'
--- a/Installer/core.wxs 2010-12-22 21:21:41 +0000
+++ b/Installer/core.wxs 2011-01-07 22:57:06 +0000
@@ -93,6 +93,7 @@
<InstallExecuteSequence>
<!-- v2 custom action scheduling -->
+ <Custom Action="Setv2InstallUtil" After="InstallValidate"/>
<Custom Action='Setv4InstallUtil' After='InstallValidate'>NETFRAMEWORK40FULL</Custom>
<Custom Action='ManagedDataInstallSetup' After="InstallFiles">NOT Installed</Custom>
<Custom Action='ManagedDataInstall' After="ManagedDataInstallSetup">NOT Installed</Custom>
@@ -101,11 +102,12 @@
</InstallExecuteSequence>
<!-- Custom Actions -->
- <CustomAction Id="Setv4InstallUtil" Property="InstallUtil" Value="c:\windows\microsoft.net\framework\v4.0.30319"/>
+ <CustomAction Id="Setv2InstallUtil" Property="INSTALLUTIL" Value="[WindowsFolder]Microsoft.NET\Framework\v2.0.50727\installUtil.exe"/>
+ <CustomAction Id="Setv4InstallUtil" Property="INSTALLUTIL" Value="[WindowsFolder]Microsoft.NET\Framework\v4.0.30319\installUtil.exe"/>
<CustomAction Id="ManagedDataInstallSetup" Property="ManagedDataInstall"
- Value='"[InstallUtil]\installUtil.exe" /LogToConsole=false /LogFile= "[#MySql.Data.v2]"'/>
+ Value='"[INSTALLUTIL]" /LogToConsole=false /LogFile= "[#MySql.Data.v2]"'/>
<CustomAction Id='ManagedDataUnInstallSetup' Property="ManagedDataUnInstall"
- Value='"[InstallUtil]\installUtil.exe" /LogToConsole=false /LogFile= /u "[#MySql.Data.v2]"'/>
+ Value='"[INSTALLUTIL]" /LogToConsole=false /LogFile= /u "[#MySql.Data.v2]"'/>
<CustomAction Id="ManagedDataInstall" BinaryKey="WixCA" DllEntry="CAQuietExec" Return="check" Execute='deferred' Impersonate='no'/>
<CustomAction Id="ManagedDataUnInstall" BinaryKey="WixCA" DllEntry="CAQuietExec" Return="check" Execute='deferred' Impersonate='no'/>
</Fragment>
=== modified file 'Installer/main.wxs'
--- a/Installer/main.wxs 2011-01-06 16:04:23 +0000
+++ b/Installer/main.wxs 2011-01-07 22:57:06 +0000
@@ -110,7 +110,6 @@
<Binary Id="H2Reg" SourceFile="Binary\H2Reg.exe"/>
<Property Id="WIXUI_INSTALLDIR" Value='INSTALLDIR'/>
- <Property Id='INSTALLUTIL' Value='[NETFRAMEWORK20INSTALLROOTDIR]'/>
<!-- Remove the license agreement dialog -->
<UIRef Id='WixUI_MySQL'/>
=== modified file 'Installer/webproviders.wxs'
--- a/Installer/webproviders.wxs 2010-12-22 21:21:41 +0000
+++ b/Installer/webproviders.wxs 2011-01-07 22:57:06 +0000
@@ -48,9 +48,9 @@
</InstallExecuteSequence>
<CustomAction Id="ManagedWebInstallSetup" Property="ManagedWebInstall"
- Value='"[InstallUtil]\installUtil.exe" /LogToConsole=false /LogFile= "[#MySqlWeb.v2]"'/>
+ Value='"[INSTALLUTIL]" /LogToConsole=false /LogFile= "[#MySqlWeb.v2]"'/>
<CustomAction Id='ManagedWebUnInstallSetup' Property="ManagedWebUnInstall"
- Value='"[InstallUtil]\installUtil.exe" /LogToConsole=false /LogFile= /u "[#MySqlWeb.v2]"'/>
+ Value='"[INSTALLUTIL]" /LogToConsole=false /LogFile= /u "[#MySqlWeb.v2]"'/>
<CustomAction Id="ManagedWebInstall" BinaryKey="WixCA" DllEntry="CAQuietExec" Return="check" Execute='deferred' Impersonate='no'/>
<CustomAction Id="ManagedWebUnInstall" BinaryKey="WixCA" DllEntry="CAQuietExec" Return="check" Execute='deferred' Impersonate='no'/>
</Fragment>
=== modified file 'MySql.Data/Provider/Source/MySqlConnectionStringBuilder.cs'
--- a/MySql.Data/Provider/Source/MySqlConnectionStringBuilder.cs 2010-11-03 21:04:38 +0000
+++ b/MySql.Data/Provider/Source/MySqlConnectionStringBuilder.cs 2011-02-15 21:07:24 +0000
@@ -763,6 +763,20 @@
return new Regex(BlobAsUTF8ExcludePattern);
}
+ public override bool ContainsKey(string keyword)
+ {
+ try
+ {
+ object value;
+ ValidateKeyword(keyword);
+ return values.TryGetValue(validKeywords[keyword], out value);
+ }
+ catch (Exception)
+ {
+ return false;
+ }
+ }
+
public override object this[string keyword]
{
get { return values[validKeywords[keyword]]; }
=== modified file 'MySql.Data/Provider/Source/NativeDriver.cs'
--- a/MySql.Data/Provider/Source/NativeDriver.cs 2010-11-30 18:33:23 +0000
+++ b/MySql.Data/Provider/Source/NativeDriver.cs 2011-02-15 21:07:24 +0000
@@ -703,7 +703,7 @@
if (type == MySqlDbType.Decimal || type == MySqlDbType.NewDecimal)
{
- field.Precision = (byte)(field.ColumnLength - (int)field.Scale);
+ field.Precision = (byte)(field.ColumnLength - 2);
if ((colFlags & ColumnFlags.UNSIGNED) != 0)
field.Precision++;
}
=== modified file 'MySql.Data/Provider/Source/command.cs'
--- a/MySql.Data/Provider/Source/command.cs 2010-10-11 18:30:02 +0000
+++ b/MySql.Data/Provider/Source/command.cs 2011-02-14 17:19:36 +0000
@@ -410,11 +410,11 @@
commandTimer = new CommandTimer(connection, CommandTimeout);
lastInsertedId = -1;
- if (cmdText == null ||
- cmdText.Trim().Length == 0)
+ cmdText = cmdText.Trim();
+ if (String.IsNullOrEmpty(cmdText))
throw new InvalidOperationException(Resources.CommandTextNotInitialized);
- string sql = TrimSemicolons(cmdText);
+ string sql = cmdText.Trim(';');
if (CommandType == CommandType.TableDirect)
sql = "SELECT * FROM " + sql;
@@ -580,18 +580,6 @@
internal AsyncDelegate caller = null;
internal Exception thrownException;
- private static string TrimSemicolons(string sql)
- {
- int start = 0;
- while (sql[start] == ';')
- start++;
-
- int end = sql.Length - 1;
- while (sql[end] == ';')
- end--;
- return sql.Substring(start, end-start+1);
- }
-
internal object AsyncExecuteWrapper(int type, CommandBehavior behavior)
{
thrownException = null;
=== modified file 'MySql.Data/Provider/Source/common/StreamCreator.cs'
--- a/MySql.Data/Provider/Source/common/StreamCreator.cs 2011-01-06 16:33:06 +0000
+++ b/MySql.Data/Provider/Source/common/StreamCreator.cs 2011-02-14 21:14:07 +0000
@@ -188,7 +188,7 @@
Socket socket = unix ?
new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.IP) :
- new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+ new Socket(ip.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
if (keepalive > 0)
{
SetKeepAlive(socket, keepalive);
=== modified file 'MySql.Data/Tests/Source/CommandTests.cs'
--- a/MySql.Data/Tests/Source/CommandTests.cs 2010-12-14 15:25:24 +0000
+++ b/MySql.Data/Tests/Source/CommandTests.cs 2011-02-14 17:19:36 +0000
@@ -487,6 +487,33 @@
Assert.IsTrue(c.State == ConnectionState.Closed);
}
}
+
+ /// <summary>
+ /// Bug #59537 Different behavior from console and
+ /// </summary>
+ [Test]
+ public void EmptyOrJustSemiCommand()
+ {
+ MySqlCommand cmd = new MySqlCommand("", conn);
+ try
+ {
+ cmd.ExecuteNonQuery();
+ Assert.Fail();
+ }
+ catch (InvalidOperationException)
+ {
+ }
+
+ cmd.CommandText = ";";
+ try
+ {
+ cmd.ExecuteNonQuery();
+ }
+ catch (MySqlException)
+ {
+ }
+
+ }
}
=== modified file 'MySql.Data/Tests/Source/ConnectionStringBuilder.cs'
--- a/MySql.Data/Tests/Source/ConnectionStringBuilder.cs 2010-08-18 19:48:34 +0000
+++ b/MySql.Data/Tests/Source/ConnectionStringBuilder.cs 2011-02-15 21:06:20 +0000
@@ -116,5 +116,20 @@
Assert.IsFalse(s.UseCompression);
Assert.IsTrue(s.Pooling);
}
+
+ /// <summary>
+ /// Bug #59835 .Net Connector MySqlConnectionStringBuilder wrong result ContainsKey function
+ /// </summary>
+ [Test]
+ public void ContainsKey()
+ {
+ MySqlConnectionStringBuilder s = new MySqlConnectionStringBuilder();
+ s["database"] = "test";
+ Assert.IsTrue(s.ContainsKey("initial catalog"));
+ s["server"] = "myserver";
+ Assert.IsTrue(s.ContainsKey("server"));
+ Assert.IsTrue(s.ContainsKey("host"));
+ Assert.IsFalse(s.ContainsKey("badkey"));
+ }
}
}
=== modified file 'MySql.Data/Tests/Source/DataReaderTests.cs'
--- a/MySql.Data/Tests/Source/DataReaderTests.cs 2010-08-18 19:48:34 +0000
+++ b/MySql.Data/Tests/Source/DataReaderTests.cs 2011-02-15 21:06:20 +0000
@@ -153,15 +153,19 @@
}
}
+ /// <summary>
+ /// Bug #59989 MysqlDataReader.GetSchemaTable returns incorrect Values an types
+ /// </summary>
[Test]
public void GetSchema()
{
- string sql = "CREATE TABLE test2(id INT UNSIGNED AUTO_INCREMENT " +
- "NOT NULL, name VARCHAR(255) NOT NULL, name2 VARCHAR(40), fl FLOAT, " +
- "dt DATETIME, PRIMARY KEY(id))";
+ string sql = @"CREATE TABLE test2(id INT UNSIGNED AUTO_INCREMENT
+ NOT NULL, name VARCHAR(255) NOT NULL, name2 VARCHAR(40), fl FLOAT,
+ dt DATETIME, `udec` DECIMAL(20,6) unsigned,
+ `dec` DECIMAL(44,3), bt boolean, PRIMARY KEY(id))";
execSQL(sql);
- execSQL("INSERT INTO test2 VALUES(1,'Test', 'Test', 1.0, now())");
+ execSQL("INSERT INTO test2 VALUES(1,'Test', 'Test', 1.0, now(), 20.0, 12.324, True)");
MySqlCommand cmd = new MySqlCommand("SELECT * FROM test2", conn);
using (MySqlDataReader reader = cmd.ExecuteReader())
@@ -174,6 +178,16 @@
Assert.AreEqual(false, dt.Rows[1]["AllowDBNull"], "Checking AllowDBNull");
Assert.AreEqual(255, dt.Rows[1]["ColumnSize"]);
Assert.AreEqual(40, dt.Rows[2]["ColumnSize"]);
+
+ // udec column
+ Assert.AreEqual(21, dt.Rows[5]["ColumnSize"]);
+ Assert.AreEqual(20, dt.Rows[5]["NumericPrecision"]);
+ Assert.AreEqual(6, dt.Rows[5]["NumericScale"]);
+
+ // dec column
+ Assert.AreEqual(46, dt.Rows[6]["ColumnSize"]);
+ Assert.AreEqual(44, dt.Rows[6]["NumericPrecision"]);
+ Assert.AreEqual(3, dt.Rows[6]["NumericScale"]);
}
}
=== modified file 'MySql.VisualStudio/MySql.VisualStudio.VS2010.csproj'
--- a/MySql.VisualStudio/MySql.VisualStudio.VS2010.csproj 2011-01-06 16:04:23 +0000
+++ b/MySql.VisualStudio/MySql.VisualStudio.VS2010.csproj 2011-02-14 17:15:44 +0000
@@ -429,7 +429,7 @@
</PropertyGroup>
<PropertyGroup />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Import Project="C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\VSSDK\Microsoft.VsSDK.targets" />
+ <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\VSSDK\Microsoft.VsSDK.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
=== modified file 'MySql.Web/Providers/Source/MembershipProvider.cs'
--- a/MySql.Web/Providers/Source/MembershipProvider.cs 2010-12-14 23:04:23 +0000
+++ b/MySql.Web/Providers/Source/MembershipProvider.cs 2011-02-14 19:21:23 +0000
@@ -192,7 +192,14 @@
public override string ApplicationName
{
get { return app.Name; }
- set { app.Name = value; }
+ set
+ {
+ lock (this)
+ {
+ if (value.ToLowerInvariant() == app.Name.ToLowerInvariant()) return;
+ app = new Application(value, String.Empty);
+ }
+ }
}
/// <summary>
=== modified file 'MySql.Web/Tests/UserManagement.cs'
--- a/MySql.Web/Tests/UserManagement.cs 2010-08-18 19:48:34 +0000
+++ b/MySql.Web/Tests/UserManagement.cs 2011-02-14 19:21:23 +0000
@@ -666,5 +666,37 @@
MembershipUser u = provider.GetUser("foo", false);
string newpw = provider.ResetPassword("foo", null);
}
+
+ /// <summary>
+ /// Bug #59438 setting Membership.ApplicationName has no effect
+ /// </summary>
+ [Test]
+ public void ChangeAppName()
+ {
+ provider = new MySQLMembershipProvider();
+ NameValueCollection config = new NameValueCollection();
+ config.Add("connectionStringName", "LocalMySqlServer");
+ config.Add("applicationName", "/");
+ config.Add("passwordStrengthRegularExpression", "bar.*");
+ config.Add("passwordFormat", "Clear");
+ provider.Initialize(null, config);
+ MembershipCreateStatus status;
+ provider.CreateUser("foo", "bar!bar", null, null, null, true, null, out status);
+ Assert.IsTrue(status == MembershipCreateStatus.Success);
+
+ MySQLMembershipProvider provider2 = new MySQLMembershipProvider();
+ NameValueCollection config2 = new NameValueCollection();
+ config2.Add("connectionStringName", "LocalMySqlServer");
+ config2.Add("applicationName", "/myapp");
+ config2.Add("passwordStrengthRegularExpression", "foo.*");
+ config2.Add("passwordFormat", "Clear");
+ provider2.Initialize(null, config2);
+ provider2.CreateUser("foo2", "foo!foo", null, null, null, true, null, out status);
+ Assert.IsTrue(status == MembershipCreateStatus.Success);
+
+ provider.ApplicationName = "/myapp";
+ Assert.IsFalse(provider.ValidateUser("foo", "bar!bar"));
+ Assert.IsTrue(provider.ValidateUser("foo2", "foo!foo"));
+ }
}
}
No bundle (reason: revision is a merge (you can force generation of a bundle with env var BZR_FORCE_BUNDLE=1)).
| Thread |
|---|
| • bzr commit into connector-net-trunk branch (reggie.burnett:955) | Reggie Burnett | 15 Feb |