|
From: Chris W. <ch...@cw...> - 2002-03-03 21:29:44
|
On Sun, 2002-03-03 at 15:08, John Sequeira wrote:
> Can you pass a DEBUG=>1 flag into $object->fetch_group to see what SQL is
> being run?
>
> The docs say you can do this for fetch, but it doesn't appear to have any
> effect on fetch_group.
It works ok for me. Using the 0.57 release, I setup the testing tables
in eg/ for SQLite (which I recommend everyone install since it's so easy
to set things up and tear them down) like this:
... edit eg/My/Common.pm to have the relevant SQLite info ...
1. $ cd eg/
2. $ perl users_groups_sqlite.pl
3. $ perl stock_user_group.pl
4. edit eg/fetch_all.pl to pass a DEBUG => 1 to the
fetch_group call for My::User so that line 14 change from:
my $users = My::User->fetch_group({ skip_security => 1 });
to:
my $users = My::User->fetch_group({ skip_security => 1,
DEBUG => 1 });
5. $ perl fetch_all.pl
And got:
--------------------
SPOPS::SQLInterface::db_select (91) >> No SQL passed in to execute
directly; building.
SPOPS::SQLInterface::db_select (112) >> SQL for select:
SELECT spops_user.user_id, spops_user.login_name,
spops_user.password, spops_user.first_name, spops_user.last_name,
spops_user.email, spops_user.notes
FROM spops_user
SPOPS::SQLInterface::db_select (124) >> Values bound:
SPOPS::SQLInterface::db_select (134) >> Returning statement handle
(after prepare/execute)
SPOPS::DBI::_fetch_assign_row (449) >> Setting data from row into
My::User
SPOPS::DBI::_fetch_assign_row (452) >> user_id -->
-202991066
SPOPS::DBI::_fetch_assign_row (452) >> login_name -->
superuser
SPOPS::DBI::_fetch_assign_row (452) >> password -->
password
SPOPS::DBI::_fetch_assign_row (452) >> first_name --> super
SPOPS::DBI::_fetch_assign_row (452) >> last_name --> user
SPOPS::DBI::_fetch_assign_row (452) >> email -->
superuser@
SPOPS::DBI::_fetch_assign_row (452) >> notes -->
SPOPS::DBI::_fetch_post_process (486) >> My::User ( -2029910665 ) :
cache set (if available), post_fetch_action() done, change flag cleared
and save flag set. Security: 8
--------------------
> Also, is there another way to get this info for debugging?
Not right now. Did you have an idea about another way to get it?
Debugging has always kind of been a PITA, so ideas are welcome.
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988.
|