[CDBI] Re: Error deleting object with has_many instances

[prev] [thread] [next] [Date index for 2006/02/07]

From: Peter Speltz
Subject: [CDBI] Re: Error deleting object with has_many instances
Date: 22:37 on 07 Feb 2006
On 2/7/06, Peter Speltz <peterspeltz@xxxxx.xxx> 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} =3D {};
$self->db_Main->{mysql_auto_reconnect} =3D 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=3DHASH(0x959eb2c)~0x9643b48 'Active')
thr#844b848
 T  <- FETCH=3D 1 at DBI.pm line 344
    -> ping for DBD::mysql::db
(DBIx::ContextualFetch::db=3DHASH(0x959eb2c)~0x9643b48) thr#844b848
 T  <- ping=3D 1 at DBI.pm line 344
    -> prepare_cached in DBD::_::db for DBD::mysql::db
(DBIx::ContextualFetch::db=3DHASH(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=3DHASH(0x9643b48)~INNER 'CachedKids')
thr#844b848
1T  <- FETCH=3D HASH(0x920a45c)0keys at DBI.pm line 1606
1   -> prepare for DBD::mysql::db
(DBIx::ContextualFetch::db=3DHASH(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=3D DBIx::ContextualFetch::st=3DHASH(0x96438d0) at DBI.pm lin=
e 1618
 T  <- prepare_cached=3D ( DBIx::ContextualFetch::st=3DHASH(0x96438d0) )
[1 items] at DBI.pm line 416
    -> FETCH for DBD::mysql::st
(DBIx::ContextualFetch::st=3DHASH(0x9643adc)~INNER 'Active') thr#844b848
    -> dbd_st_FETCH_attrib for 092d6280, key Active
 T  <- FETCH=3D '' at DBI.pm line 1131
    -> FETCH for DBD::mysql::st
(DBIx::ContextualFetch::st=3DHASH(0x9643adc)~INNER 'Taint') thr#844b848
    -> dbd_st_FETCH_attrib for 092d6280, key Taint
 T  <- FETCH=3D 1 at ContextualFetch.pm line 50
    -> STORE for DBD::mysql::st
(DBIx::ContextualFetch::st=3DHASH(0x9643adc)~INNER 'Taint' 0)
thr#844b848
-> dbd_st_STORE_attrib for 092d6280, key Taint
<- dbd_st_STORE_attrib for 092d6280, result 0
    <- STORE=3D 1 at ContextualFetch.pm line 51
    -> execute for DBD::mysql::st
(DBIx::ContextualFetch::st=3DHASH(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=3D undef at ContextualFetch.pm line 52
1   -> FETCH for DBD::mysql::st
(DBIx::ContextualFetch::st=3DHASH(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=3D 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=3D '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=3DHASH(0x9637d28)~INNER) thr#844b848


thanks.

--
pjs

_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

[CDBI] Re: Error deleting object with has_many instances
Peter Speltz 22:37 on 07 Feb 2006

Generated at 23:19 on 12 Feb 2006 by mariachi v0.52