Bug #19671 mysql_list_fields returns incorrect table name for VIEWs
Submitted: 10 May 2006 11:12 Modified: 3 Jul 2006 20:28
Reporter: Bogdan Degtyariov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: C API (client library) Severity:S2 (Serious)
Version: OS:
Assigned to: Sergei Glukhov CPU Architecture:Any

[10 May 2006 11:12] Bogdan Degtyariov
Description:
mysql_list_fields() function returns the name of the table alias instead of the name in VIEWs.
For the following view:
create view xyz as select t1.* from tab01 t1;

and following function call
res = mysql_list_fields(&mysql, "xyz", NULL);
it will return t1 as the table name for any field from xyz.
This causes the problem in Access

How to repeat:
Run the following SQL statements

create database thoga;
use thoga;
CREATE TABLE `tab01` (
  `id01` int(11) NOT NULL auto_increment
  PRIMARY KEY  (`id01`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
create view xyz as select t1.* from tab01 t1;
[10 May 2006 11:13] Bogdan Degtyariov
test case

Attachment: select_test.c (text/x-csrc), 932 bytes.

[26 Jun 2006 7:00] Steve Jorgensen
Is there a known work-around for this until it can be fixed?  It is significantly interfering with work I'm trying to do.
[26 Jun 2006 14:53] 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/8249
[29 Jun 2006 10:30] Alexander Barkov
The patch looks ok to push.
[29 Jun 2006 11:49] 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/8475
[3 Jul 2006 11:32] Sergei Glukhov
Fixed in 5.0.24
[3 Jul 2006 20:28] Paul DuBois
Noted in 5.0.24 changelog.
[13 Jul 2006 3:41] Paul DuBois
Fix went to 5.0.25 instead.
[14 Sep 2006 12:44] Eric Fauvel
How can we find out when version 5.0.25 will be available, this bug is really a show stopper for my Apps under developement?
[5 Jul 2007 17:17] Paul DuBois
Noted in 5.1.12 changelog.