Hi Ron Thanks...
On 9 Apr 2006 at 12:40, Ron Savage wrote: > On Sat, 08 Apr 2006 20:39:45 +0800, Allan Dyer wrote: > > Hi Allan > > > I'm sorry if I offended everyone with my previous message - I've > > I can't see why you'd think that :-). :-) > > got no replies, so I guess I did something wrong. I would still > > I can't see why you'd guess that :-). :-) > > like to be pointed in a useful direction... > > > > I've found that the problem with table_info has been reported three > > times before in this group: > > Here's how I call table_info(...). I have not used DBD::Proxy. ... > This is from a program to dump all table, column, and index info for the 3 > tested vendors. > > Let me know how it goes. OK, I tried that and got basically the same result as my test program: if I specify a direct connection to mysql, it works OK, but if I specify a proxy connection to the same database, it fails (my full listing & sample output below). The error is from mysql, so it appears that what the proxy gives to mysql is not the same as what I give to the proxy. My listing: (added statements to set variables & connect to the database) #!/usr/bin/perl # # Testing problem with table_info use strict; use warnings; use Data::Dumper; use DBI; #my $dbn= 'DBI:Proxy:hostname=localhost;port=3333;dsn=DBI:mysql:ima'; my $dbn= 'DBI:mysql:ima'; my $charset= 'UTF-8'; my $dbh = DBI->connect( $dbn, 'root', '', { RaiseError => 1, PrintError => 0 } ); my $user= ''; my(%vendor) = ( MYSQL => { attributes => {}, catalog => undef, column => '%', schema => undef, table => '%', type => 'table', }, ORACLE => { attributes => {}, catalog => undef, column => '%', schema => $user, table => '%', type => 'TABLE', }, PG => { attributes => {noprefix => 1, pg_noprefix => 1}, # Only supported for $DBD::Pg::VERSION >= 1.31. catalog => undef, # Prior to that, use $dbh -> tables() column => '%', # instead of $dbh -> table_info(...). schema => 'public', table => '%', type => 'table', }, ); my $vendor= 'MYSQL'; my($sth) = $dbh -> table_info($vendor{$vendor}{'catalog'}, $vendor{$vendor}{'schema'}, $vendor{$vendor}{'table'}, $vendor{$vendor}{'type'}); my($info) = $sth -> fetchall_arrayref({}); print Dumper( $info); exit ------------------------------------------------ Output using direct connection: my $dbn= 'DBI:mysql:ima'; $VAR1 = [ { 'REMARKS' => undef, 'TABLE_NAME' => 'BaseKit', 'TABLE_CAT' => undef, 'TABLE_SCHEM' => undef, 'TABLE_TYPE' => 'TABLE' }, { 'REMARKS' => undef, 'TABLE_NAME' => 'Manufacturer', 'TABLE_CAT' => undef, 'TABLE_SCHEM' => undef, 'TABLE_TYPE' => 'TABLE' }, ... etc. ------------------------------------------------ Output using proxy connection: DBD::Proxy::db table_info failed: Server returned error: Failed to execute method CallMethod: Can't call method "execute" without a package or object reference at /usr/lib/perl5/site_perl/5.8.8/i486-linux/DBD/mysql.pm line 262. ------------------------------------------------- Who's maintaining DBD::Proxy? Perhaps I should contact them direct. Cheers Allan > -- > Cheers > Ron Savage, [EMAIL PROTECTED] on 9/04/2006 > http://savage.net.au/index.html > Let the record show: Microsoft is not an Australian company > > -------------------------------------------------------------------- Allan Dyer, CISSP, MHKCS, MIAP | [EMAIL PROTECTED] Chief Consultant | http://www.yuikee.com.hk/ Yui Kee Computing Ltd. | +852 28708555