Bug #22882 Registry key 'Global' access denied
Submitted: 2 Oct 2006 9:35 Modified: 6 Nov 2006 14:16
Reporter: Paolo Niccolò Giubelli Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:5.0.0 alpha OS:Microsoft Windows (Windows Vista RC1)
Assigned to: CPU Architecture:Any

[2 Oct 2006 9:35] Paolo Niccolò Giubelli
Description:
When I use this connector in Windows Vista RC1 with .NET2 and I try to fill a DataSet with a DataAdapter I get this exception:

System.UnauthorizedAccessException was unhandled
  Message="Access to the registry key 'Global' is denied."
  Source="mscorlib"
  StackTrace:
       at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
       at Microsoft.Win32.RegistryKey.InternalGetValue(String name, Object defaultValue, Boolean doNotExpand, Boolean checkSecurity)
       at Microsoft.Win32.RegistryKey.GetValue(String name)
       at System.Diagnostics.PerformanceMonitor.GetData(String item)
       at System.Diagnostics.PerformanceCounterLib.GetPerformanceData(String item)
       at System.Diagnostics.PerformanceCounterLib.get_CategoryTable()
       at System.Diagnostics.PerformanceCounterLib.CategoryExists(String machine, String category)
       at System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName, String machineName)
       at MySql.Data.MySqlClient.PerformanceMonitor..ctor(MySqlConnection connection)
       at MySql.Data.MySqlClient.MySqlConnection.Open()
       at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
       at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
       at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
       at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
       at Prova.Program.Main(String[] args) in C:\Users\[myusername]\Documents\Visual Studio 2005\Projects\Prova\Prova\Program.cs:line 19
       at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()

If I run the program in 'Administrator Mode' the exception is not throwed and everithing works fine. In Windows XP SP2 this the exception is not throwed.

How to repeat:
Create a Connection, a DataAdapter and fill a dataset in 'Normal User' mode.
[22 Oct 2006 11:46] Valeriy Kravchuk
Thank you for a problem report. Please, try to repeat with a latest version of Connector/Net, 1.0.8 RC, and inform about the results.
[29 Oct 2006 17:12] Paolo Niccolò Giubelli
The 1.0.8 RC works perfectly as the 1.0.7 does. The problem persists with the 5.0.1.
[30 Oct 2006 20:40] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/14580
[30 Oct 2006 20:41] Reggie Burnett
Fixed in 5.0.2
[6 Nov 2006 14:16] MC Brown
A note has been added to the 5.0.2 changelog