From: Paul D. <pa...@sn...> - 2003-01-17 23:53:44
|
I am assuming that DBI.trace can be used to set the global trace level for a script, but it appears not to be doing what I expect. For example, in the DBI distribution, examples/trace_test.rb begins like this: require "dbi" require "dbi/trace" DBI.trace(0) dbh = DBI.connect('dbi:Mysql:database=test') However, when I run the script, I get trace output from the connect call, even though the global level is set to 0. (The DBI docs don't specify so, but I assume 0 = "off".) Output is: % ruby trace_test.rb -> connect for #<DBI::DriverHandle:0x184148> ("database=test", nil, nil, nil) !! Access denied for user: 'paul@localhost' (Using password: NO) <- connect for #<DBI::DriverHandle:0x184148> /usr/lib/ruby/site_ruby/1.6/DBD/Mysql/Mysql.rb:66:in `connect': Access denied for user: 'paul@localhost' (Using password: NO) (DBI::DatabaseError) from /usr/lib/ruby/site_ruby/1.6/dbi/dbi.rb:550:in `connect' from (eval):8:in `connect' from /usr/lib/ruby/site_ruby/1.6/dbi/dbi.rb:367:in `connect' from trace_test.rb:6 What am I not understanding here? |