[Solar-talk] Sequences not created

Antti Holvikari anttih at gmail.com
Sun Jul 9 03:51:43 PDT 2006


On 7/6/06, Antti Holvikari <anttih at gmail.com> wrote:
> On 7/6/06, Antti Holvikari <anttih at gmail.com> wrote:
> > Hello!
> >
> > I'm trying to use one of my apps on my shared host but it's not
> > workin'. The problem is that I can't add new records to one of my
> > tables. On my own computer the sequence tables are created but not on
> > the shared host. I'm not using 'autoinc' on any of the columns and I
> > don't have any columns named 'id'. They have mysql version 4.0.23, but
> > I guess it shouldn't be a problem in my case. It inserts the first
> > record with id 0 and after that tries using 0 again, that is,
> > Solar_Table::increment() doesn't work as supposed to.
> >
> > What could be wrong?
>
> I ran the Solar tests on the shared host and all the sequence stuff
> fails. Weird that I'm not getting any Exceptions thrown at me...

I think I'm getting somewhere with this. At least for me the problem
is in Solar_Sql_Adapter_Mysql::nextSequence(). I don't know why but
the $stmt->execute is returning false when it should be (according to
the code) throwing an Exception. That's why the sequence tables never
get created. I fixed it to check for bool false and all the unit tests
pass. Somehow the PDO::ERRMODE_EXCEPTION isn't affecting
PDOStatement::execute(). Should it really be throwing Exceptions or
does it always return bool?



Also, one quickfix: test runner 'run.php' is trying to throw a
'function' 'Exception' on line 36 ;-)

-- 
Antti Holvikari <http://antti.dotgeek.org/blog>
Zend Certified Engineer (ZCE)


More information about the solar-talk mailing list