Q: WinXP, MySQL V 5.0.15, DBI V 1.49, DBD::mysql V 3.002,and primary_key_info

Q: WinXP, MySQL V 5.0.15, DBI V 1.49, DBD::mysql V 3.002,and primary_key_info

am 03.03.2006 06:48:14 von ron

Hi Folks

When I call primary_key_info(undef, undef, 'table name in lower case') I get
back an undefined sth and hence can't get primary key info.

Should I expect this to work? I can't see anything in the Change log about this,
although there is a bug report on RT 1 year ago against V 2.9005_3.

Yes, I can get mysql_is_pri_key from a column attribute, although what happens
if the primary key is made up of several keys? How do I tell what order they are
combined in?
--
Ron Savage
ron@savage.net.au
http://savage.net.au/index.html

RE: Q: WinXP, MySQL V 5.0.15, DBI V 1.49, DBD::mysql V 3.002, and primary_key_info

am 03.03.2006 16:17:38 von Martin.Evans

With mysql 3.0002_4:

perl -e 'use DBI; my $dbh =
DBI->connect("dbi:mysql:xxxxxxxxxx", "ppp","qqq");
print "supported\n" if ($dbh->can("primary_key_info"));'

does not print supported for me.

The same with DBD::ODBC does print "supported".

So, I'd guess primary_key_info is not supported in DBD::mysql.

Martin
--
Martin J. Evans
Easysoft Ltd, UK
http://www.easysoft.com


On 03-Mar-2006 Ron Savage wrote:
> Hi Folks
>
> When I call primary_key_info(undef, undef, 'table name in lower case') I get
> back an undefined sth and hence can't get primary key info.
>
> Should I expect this to work? I can't see anything in the Change log about
> this,
> although there is a bug report on RT 1 year ago against V 2.9005_3.
>
> Yes, I can get mysql_is_pri_key from a column attribute, although what
> happens
> if the primary key is made up of several keys? How do I tell what order they
> are
> combined in?
> --
> Ron Savage
> ron@savage.net.au
> http://savage.net.au/index.html