Bug #33870 Generated database prefix and connection string
Submitted: 14 Jan 2008 17:36 Modified: 13 Jul 2010 13:51
Reporter: Renaud Paquay Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:5.1.4, 5.2.4 OS:Windows (Vista)
Assigned to: Reggie Burnett CPU Architecture:Any
Tags: table prefix connection string

[14 Jan 2008 17:36] Renaud Paquay
Description:
The problem appears when using Data Provider for MySql and strong typed DataSet.

I develop my application using strong typed datasets.

When I drag and drop a table into the xsd, a code is auto generated which contains the connection, the select statement, and so on.

The problem is that the generated code contains the dabase prefix like :
SELECT `ID`,`Name` from `databaseName`.`Customers`;

When using strong typed dataset, the connection is normally created with :
global::<myNameSpace>.Properties.Settings.Default.<myConnectionStringName>

When I change the Application setting in my app.exe.config, due to the database prefix, nothing changes.

How to repeat:
Create a new application with a MySqlData Provider for mysql.

Drop a table into a new xsd.

Go to the <MyDataSetName>.Designer.cs

Observe the generated update or select commands.

Suggested fix:
Do not generate the database prefix as it should be defined at Application Setting level.
[17 Oct 2008 0:46] Cyrille Giquello
Hello,
I completly agree with Renaud, the database prefix is a real problem.

1. When changing from development database to test database then production database, names are not same.
2. When hosting several times the same application that need distinct database for each instance.

Regards,
Cyrille
[17 Oct 2008 0:49] Cyrille Giquello
problem persists with version 5.2.2
[17 Oct 2008 7:15] Tonci Grgin
Hi Renaud and thanks for your report.

I can't make up my mind on how to treat this problem as both approaches have their good and bad side. But I am setting report to verified on the bases of inconsistency:
  Looking into autogenerated, for example, UPDATE command one sees "database." prefix but if you open same command in query builder the prefix is gone. This should at least look/behave in uniform fashion.

Verified as described.
[17 Oct 2008 7:18] Tonci Grgin
DB prefix present in object explorer

Attachment: BUG33870-1.JPG (image/jpeg, text), 47.44 KiB.

[17 Oct 2008 7:19] Tonci Grgin
DB prefix *not* present in QB (same command)

Attachment: BUG33870-2.JPG (image/jpeg, text), 33.13 KiB.

[20 Oct 2008 6:57] Tonci Grgin
To be checked together with Bug#38922.
[26 Aug 2009 5:55] Tonci Grgin
Bug#38922 was marked as duplicate of this report.
[26 Aug 2009 10:53] Tonci Grgin
Bug#46930 was marked as duplicate of this report.
[31 Aug 2009 13:54] The Assimilator
Error generated when removing database name from CommandText

Attachment: sproc-param-error.PNG (image/png, text), 13.25 KiB.

[31 Aug 2009 21:57] Reggie Burnett
Downgrading this to medium since there is a valid workaround.
[2 Jul 2010 18:35] 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/112800
[2 Jul 2010 18:37] 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/112801
[2 Jul 2010 18:43] Reggie Burnett
fixed in 6.0.7, 6.1.5, 6.2.4, and 6.3.3+
[13 Jul 2010 13:51] Tony Bedford
An entry has been added to the 6.0.7, 6.1.5, 6.2.4, and 6.3.3 changelogs:

Database name was emitted into typed datasets. This prevented users using the configured default database.