Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: Perl-8.4.1
-
Component/s: Perl
-
Labels:None
Description
Test Build:CUBRID 2008 R4.0 (8.4.0.2019) (64bit release build for linux_gnu)
OS: Linux 64
Description: Multiple foreign key
Repro Steps
perl perl foreign_10.pl
Statement in perl foreign_6.pl:
$dbh->do("CREATE TABLE album(id CHAR(10) primary key,title VARCHAR(100), artist VARCHAR(100));") or die $dbh->errstr . " : create error\n";
$dbh->do("CREATE TABLE aaaa(aid CHAR(10), uid int primary key);") or die $dbh->errstr . " :create error \n";
$dbh->do("CREATE TABLE ssss(album CHAR(10),dsk INTEGER,FOREIGN KEY (album) REFERENCES album(id), FOREIGN KEY (dsk) REFERENCES aaaa(uid));") or die $dbh->errstr . " : create error\n";
my $sth=$dbh->foreign_key_info('','','','','','ssss') or die $dbh->errstr . " :foreign_key error\n";
while(my @row =$sth->fetchrow_array()){
my $length=@row;
print "PKTABLE_NAME: $row[2]\n";
print "PKCOLUMN_NAME: $row[3]\n";
print "FKTABLE_NAME : $row[6]\n";
print "FKCOLUMN_NAME: $row[7]\n";
print "KEY_SEQ: $row[8]\n";
print "UPDATE_RULE: $row[9]\n";
print "DELETE_RULE: $row[10]\n";
print "FK_NAME: $row[11]\n";
print "PK_NAME: $row[12]\n";
print "DEFERRABILITY: $row[13]\n";
print "UNIQUE_OR_PRIMARY : $row[14]\n\n\n\n";
}
Actual result:
PK_NAME don't contain pk_aaaa_uid.
[perl@NC-PL-QA033 cases]$ perl foreign_10.pl pldb PKTABLE_NAME: album PKCOLUMN_NAME: id FKTABLE_NAME : ssss FKCOLUMN_NAME: album KEY_SEQ: 1 UPDATE_RULE: 1 DELETE_RULE: 1 FK_NAME: fk_ssss_album PK_NAME: pk_album_id DEFERRABILITY: UNIQUE_OR_PRIMARY :
Expect result:
If only PKT is given, then the result set contains the primary key of that table and all foreign keys that refer to it.
If only FKT is given, then the result set contains all foreign keys in that table and the primary keys to which they refer. (Note: In SQL/CLI, the result includes unique keys too.)
PK_NAME: pk_album_id pk_aaaa_uid
Commit rev: 367