Bug #52085 MySQL Connector /Net
Submitted: 16 Mar 2010 11:25 Modified: 22 Jul 2010 15:03
Reporter: Rodrigo Hentz Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:6.0.5 OS:Windows
Assigned to: Reggie Burnett CPU Architecture:Any
Tags: CHAR(36), Guid

[16 Mar 2010 11:25] Rodrigo Hentz
Description:
I have a table in MySQL with two fields:
table: session
 - sessionId char(36)
 - name      varchar(45)

When a import the data model, by ADO.net Entity Framework, my table shows ok, with the field sessionId as Guid. OK.

But I have a view in database and this view not show the filed as Guid, but as String. I try change this type but not work.

The view is:
select sessionId, name from session

How to repeat:
Create a table with the two fields.
Create a view with the two fields.
Import the model by Entity Framework.
See the table field as Guid and the filed view as String.

Suggested fix:
That the view propertie show as Guid in model.
[16 Mar 2010 11:45] Tonci Grgin
Hi Rodrigo and thanks for your report.

Verified as described using c/NET 6.2.2:
Server version: 5.1.31-log MySQL Community Server (GPL)
create table bug52085 (
  sessionId char(36) not null primary key, 
  name varchar(45));

create view vbug52085 as select * from bug52085;

Server returned metadata is consistent:
mysql> select * from bug52085;
Field   1:  `sessionId`
Catalog:    `def`
Database:   `test`
Table:      `bug52085`
Org_table:  `bug52085`
Type:       STRING
Collation:  latin1_swedish_ci (8)
Length:     36
Max_length: 0
Decimals:   0
Flags:      NOT_NULL PRI_KEY NO_DEFAULT_VALUE PART_KEY

Field   2:  `name`
Catalog:    `def`
Database:   `test`
Table:      `bug52085`
Org_table:  `bug52085`
Type:       VAR_STRING
Collation:  latin1_swedish_ci (8)
Length:     45
Max_length: 0
Decimals:   0
Flags:

0 rows in set (0.00 sec)

mysql> select * from vbug52085;
Field   1:  `sessionId`
Catalog:    `def`
Database:   `test`
Table:      `vbug52085`
Org_table:  `vbug52085`
Type:       STRING
Collation:  latin1_swedish_ci (8)
Length:     36
Max_length: 0
Decimals:   0
Flags:      NOT_NULL PRI_KEY NO_DEFAULT_VALUE PART_KEY

Field   2:  `name`
Catalog:    `def`
Database:   `test`
Table:      `vbug52085`
Org_table:  `vbug52085`
Type:       VAR_STRING
Collation:  latin1_swedish_ci (8)
Length:     45
Max_length: 0
Decimals:   0
Flags:

0 rows in set (0.00 sec)

EF model maps sessionId (table) to GUID while sessionId (view) is mapped as String.
[16 Mar 2010 11:59] Rodrigo Hentz
Exactly. And in my application I need the resource view to display data and link to the entries, but the type has to be Guid and not String. Thank you.
[17 Mar 2010 14:32] Rodrigo Hentz
Reggie Burnett, this error has some expected to be corrected? How is the process? Thank you.
[19 Jul 2010 18:26] 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/113891

826 Reggie Burnett	2010-07-19
      - fixed recognition of char(36) columns to be guids when used in views with entity models (bug #52085)
[19 Jul 2010 18:32] 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/113893

827 Reggie Burnett	2010-07-19
      - fixed recognition of char(36) columns to be guids when used in views with entity models (bug #52085)
[19 Jul 2010 18:35] Reggie Burnett
fixed in 6.1.5, 6.2.4, 6.3.3+
[22 Jul 2010 15:03] Tony Bedford
An entry has been added to the 6.1.5, 6.2.4, 6.3.3 changelogs:

CHAR(36) columns were not recognized as GUIDs when used in views with entity models.