Bug #29124 Usage Advisor not checking UseUsageAdvisor setting
Submitted: 14 Jun 2007 22:53 Modified: 2 Jul 2007 5:07
Reporter: mohit srivastava Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:5.0.7 OS:Windows
Assigned to: CPU Architecture:Any
Tags: .net, connector, usageadvisor

[14 Jun 2007 22:53] mohit srivastava
Description:
Note that this function checks the usage advisor setting before logging,
		public void UsingBadIndex(string cmdText)
		{
			if (!conn.Settings.UseUsageAdvisor) return;

			LogUAWarning(cmdText, "Using a bad index.");
		}

But, this doesn't
		public void Converting(string cmdText, string columnName,
									  string fromType, string toType)
		{
			LogUAHeader(cmdText);
			Logger.WriteLine("Reason: Performing unnecessary conversion on field "
									  + columnName + ".");
			Logger.WriteLine("From: " + fromType + " to " + toType);
			LogUAFooter();
		}

As a result, my log files get filled with usage advisor warnings that I'd prefer to ignore.

How to repeat:
Use the MySqlConnector .Net and
1) Create a column of TINYINT
2) Try to access it by MySqlDataReader.GetInt32(<column ordinal>)

Suggested fix:
Add the UseUsageAdvisor check to any UsageAdvisor function that logs.
[15 Jun 2007 18:01] 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/28898
[15 Jun 2007 18:01] Reggie Burnett
Fixed in 5.0.8 and 5.1.3
[15 Jun 2007 18:05] 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/28899
[2 Jul 2007 5:07] MC Brown
A note has been added to the 5.0.8 and 5.1.3 changelog: 

Certain operations would not check the UsageAdvisor setting, causing log messages from the Usage Advisor even when it was disabled.
[13 Jul 2007 9:56] Tonci Grgin
Bug#29776 was marked as duplicate of this report.