Error Unknown system variable 'NAMES' when accessing database

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
irfan
Posts: 15
Joined: Wed 13 Apr 2005 00:56

Error Unknown system variable 'NAMES' when accessing database

Post by irfan » Tue 04 Oct 2005 23:44

I have an application that is using the CoreLab.MySql.dll version 2.80.5. However when I run it on a system that has version 2.0.5.0 of the DLL in the Global Assembly Cache, I get the Unknown system variable 'NAMES' error.

But if I remove the DLL from the GAC, it works. I have also tried to force the application to load the 2.80.5 version of the DLL manually without any luck.

Serious

Post by Serious » Wed 05 Oct 2005 09:24

We advise you to deploy newest versions of MySQLDirect .NET runtime binaries when distributing your applications.

If you cannot do this, try to use application configuration file. For more information about configuration files and assembly loading see corresponding documentation.

Moreover, you should check MySQL version on target machine (probably it doesn't support UTF8 charset).

irfan
Posts: 15
Joined: Wed 13 Apr 2005 00:56

Post by irfan » Wed 05 Oct 2005 16:19

I would like to run my application without having to write an installer to deploy it. It is a backup utility that is used by the installer of our main application which is in the field and uses an older version of the MySQLDirect .NET runtime binary (version 2.0.5.0).

I have tried setting the config file to load the newer version of the DLL but for some reason it keeps loading the older version. So I programmatically loaded the newer version and verfied that when the application runs it uses the newer version (I check all the assemblies that are loaded when I get the exception). But it seems like as long as the old DLL is in the GAC I cannot run my application.

The only options I have left is to either see if using ILMerge to merge the DLL into the executable will work but I am not sure what the license issues regarding this are and the secondly use another driver for this utility. I do know that if I have .NET 2.0 framework installed on a machine and I used the version 2.0.5.0 DLL, it starts calling the .NET 2.0 framework routines. Is it possible that 2.80.5 has similar issues.

Serious

Post by Serious » Thu 06 Oct 2005 08:55

We tested your scenario and found no problems.
.NET Framework requires exact mathc of major and minor assembly versions when loading. So even in theory your application, which has been built with CoreLab.MySql.dll 2.80, cannot load CoreLab.MySql.dll 2.0.5 assembly.
I programmatically loaded the newer version and verfied that when the application runs it uses the newer version
We think your application has some additional dependencies, that you ignored.

If you think the problem is in MySQLDirect .NET, send us exception call stack, your .NET Framework and MySQL Server version.

Post Reply