Subject: | Curious behaviour with serial and primary_key method |
First table definition:
create table delivery_lists (
code serial,
created datetime not null
);
Second table definition:
create table delivery_lists (
code serial,
created datetime not null,
primary key(code)
);
MySQL shows in both cases:
Show quoted text
mysql> describe delivery_lists;
+---------+---------------------+------+-----+---------+----------------
+
| Field | Type | Null | Key | Default | Extra
|
+---------+---------------------+------+-----+---------+----------------
+
| code | bigint(20) unsigned | NO | PRI | NULL | auto_increment
|
| created | datetime | NO | | NULL |
|
+---------+---------------------+------+-----+---------+----------------
+
2 rows in set (0.00 sec)
primary_key method yields different results in these two cases:
@keys = $self->{dbh}->primary_key(undef, undef, 'delivery_tables);
First case: @keys = ('code');
Second case: @keys = ();
That differs from what MySQL is showing.
Please advise.
Regards
Racke