[CDBI] Re: Error deleting object with has_many instances

Peter Speltz peterspeltz at gmail.com
Tue Feb 7 22:37:51 GMT 2006


On 2/7/06, Peter Speltz <peterspeltz at gmail.com> wrote:
> Hi all. I'm getting an SQL syntax error when I delete and object that
> "has_many" other objects.
> If i delete all the has_many objects manually then the delete of the
> main object, it works.
>
> I'm using version 3.14
> The error i am getting is this:
>
> CafeDB::Services::TtAction can't SELECT tt_action_id, date_time,
> tt_id, action, result, solved_problem, entered_by
> FROM   tt_action
> WHERE
> : DBD::mysql::st execute failed: You have an error in your SQL syntax;
> check the manual that corresponds to your MySQL server version for the
> right syntax to use near '' at line 3 [for Statement "SELECT
> tt_action_id, date_time, tt_id, action, result, solved_problem,
> entered_by
> FROM   tt_action
> WHERE
> "] at /usr/local/share/perl/5.8.4/DBIx/ContextualFetch.pm line 52,
> <GEN6> line 3.
>  at /usr/local/share/perl/5.8.4/Class/DBI/Search/Basic.pm line 169
>
> Anyone  else experience any issues similar? Thanks.
> --
> pjs
>

I think this maybe a perpared_cached issue or something.  I read some
on another post and tried :
$self->db_Main->{CachedKids} = {};
$self->db_Main->{mysql_auto_reconnect} = 0;

No luck. Here is some output from DBI->trace.  Hopefully someone will
be fluent in this :) Thanks.
....

  -> FETCH for DBD::mysql::db
(DBIx::ContextualFetch::db=HASH(0x959eb2c)~0x9643b48 'Active')
thr#844b848
 T  <- FETCH= 1 at DBI.pm line 344
    -> ping for DBD::mysql::db
(DBIx::ContextualFetch::db=HASH(0x959eb2c)~0x9643b48) thr#844b848
 T  <- ping= 1 at DBI.pm line 344
    -> prepare_cached in DBD::_::db for DBD::mysql::db
(DBIx::ContextualFetch::db=HASH(0x959eb2c)~0x9643b48 'SELECT
tt_action_id, date_time, tt_id, action, result, solved_problem,
entered_by
FROM   tt_action
WHERE
') thr#844b848
1   -> FETCH for DBD::mysql::db
(DBIx::ContextualFetch::db=HASH(0x9643b48)~INNER 'CachedKids')
thr#844b848
1T  <- FETCH= HASH(0x920a45c)0keys at DBI.pm line 1606
1   -> prepare for DBD::mysql::db
(DBIx::ContextualFetch::db=HASH(0x9643b48)~INNER 'SELECT tt_action_id,
date_time, tt_id, action, result, solved_problem, entered_by
FROM   tt_action
WHERE
' undef) thr#844b848
dbd_st_prepare calling count_params (counting params emulation)
1T  <- prepare= DBIx::ContextualFetch::st=HASH(0x96438d0) at DBI.pm line 1618
 T  <- prepare_cached= ( DBIx::ContextualFetch::st=HASH(0x96438d0) )
[1 items] at DBI.pm line 416
    -> FETCH for DBD::mysql::st
(DBIx::ContextualFetch::st=HASH(0x9643adc)~INNER 'Active') thr#844b848
    -> dbd_st_FETCH_attrib for 092d6280, key Active
 T  <- FETCH= '' at DBI.pm line 1131
    -> FETCH for DBD::mysql::st
(DBIx::ContextualFetch::st=HASH(0x9643adc)~INNER 'Taint') thr#844b848
    -> dbd_st_FETCH_attrib for 092d6280, key Taint
 T  <- FETCH= 1 at ContextualFetch.pm line 50
    -> STORE for DBD::mysql::st
(DBIx::ContextualFetch::st=HASH(0x9643adc)~INNER 'Taint' 0)
thr#844b848
-> dbd_st_STORE_attrib for 092d6280, key Taint
<- dbd_st_STORE_attrib for 092d6280, result 0
    <- STORE= 1 at ContextualFetch.pm line 51
    -> execute for DBD::mysql::st
(DBIx::ContextualFetch::st=HASH(0x96438d0)~0x9643adc) thr#844b848
    -> dbd_st_execute for 092d6280
---> parse_params with statement SELECT tt_action_id, date_time,
tt_id, action, result, solved_problem, entered_by
FROM   tt_action
WHERE
 num params 0
mysql_st_internal_execute
You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near '' at line 3 error 1064 recorded: You have an error in your SQL
syntax; check the manual that corresponds to your MySQL server version
for the right syntax to use near '' at line 3
    <- dbd_st_execute returning imp_sth->row_num 18446744073709551614
    !! ERROR: 1064 'You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near '' at line 3' (err#0)
    <- execute= undef at ContextualFetch.pm line 52
1   -> FETCH for DBD::mysql::st
(DBIx::ContextualFetch::st=HASH(0x9643adc)~INNER 'ParamValues')
thr#844b848
    -> dbd_st_FETCH_attrib for 092d6280, key ParamValues
       ERROR: 1064 'You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near '' at line 3' (err#0)
1   <- FETCH= undef at ContextualFetch.pm line 52
       ERROR: 1064 'You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near '' at line 3' (err#0)
    <> FETCH= 'SELECT tt_action_id, date_time, tt_id, action, result,
solved_problem, entered_by
FROM   tt_action
WHERE
' ('Statement' from cache) at DBI.pm line 1135
    -> DESTROY for DBD::mysql::st
(DBIx::ContextualFetch::st=HASH(0x9637d28)~INNER) thr#844b848


thanks.

--
pjs




More information about the ClassDBI mailing list