Bug #39563 SQLPrimaryKeys returns clobbered resultset rows for some tables
Submitted: 20 Sep 2008 19:39 Modified: 25 Feb 2010 15:29
Reporter: Farid Zidan (Candidate Quality Contributor) Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / ODBC Severity:S1 (Critical)
Version:5.1.5 OS:Microsoft Windows (XP SP3)
Assigned to: CPU Architecture:Any
Tags: clobbered resultset data, qc, SQLPrimaryKeys

[20 Sep 2008 19:39] Farid Zidan
Description:
Executing SQLPrimaryKeys on a bunch of tables, some tables SQLPrimaryKeys resultset is ok, for others ( same ones always ) the driver returns clobbered data for the SQLPrimaryKeys resultset for the tables.

How to repeat:
See attached screen shot. Where SQLPrimaryKeys is executed on a bunch of tables using 3.51.21 driver ( top side ) and 5.1.5 driver ( lower side ) against the same community 5.0.67 server/database. Settings tab shows how resultset columns were bound for the two sides respectively

Suggested fix:
Not sure what is going on. The clobbered resultset data is consistent for the same table( ie, is clobbered or not depending on the table )
[10 Oct 2008 0:36] Jess Balint
Farid,

Please include the output of "SHOW CREATE TABLE" for the problematic tables.
[10 Oct 2008 2:55] Farid Zidan
Hello

here is ddl for table that shows this issue. I also tried to view primary key info in WinSQL and do not get primary key name ( even if named the PK in the create DDL ).

CREATE TABLE  `test_pk` (
  `cpt4` char(5) NOT NULL default '',
  `cpt4group` char(5) NOT NULL default '',
  `section_type` char(1) default NULL,
  `runid` int(11) default NULL,
  `rec_type` char(1) default 'X',
  `cpt4_rec_type` char(6) NOT NULL,
  `cpt4_desc` varchar(50) default NULL,
  `cpt4group_desc` varchar(50) default NULL,
  PRIMARY KEY  (`cpt4_rec_type`),
  UNIQUE KEY `AK_Key_2` (`rec_type`,`cpt4`),
  UNIQUE KEY `x1_cpt4_cpt4group` (`cpt4`,`cpt4group`,`section_type`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
[10 Oct 2008 2:57] Farid Zidan
Viewing PK name in WinSQL for the test table

Attachment: TestPK.jpg (image/jpeg, text), 137.64 KiB.

[25 Feb 2010 15:26] Lawrenty Novitsky
I think this bug is a duplicate of the Bug#36441.
If nobody minds, i will close it.
[25 Feb 2010 15:29] Lawrenty Novitsky
setting as "duplicate" so far