[Solar-talk] Sequences not created
Paul M Jones
pmjones at solarphp.com
Sun Jul 9 10:04:26 PDT 2006
Hi Antti,
Sorry to be so late in responding, has been a very busy time lately.
>>> 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?
That's *very* strange to me. I would think it should throw an
exception; I'm not sure why it's returning a bool. Will ask Wez
"Evil" Furlong and see if he has any pointers. In the mean time, can
you send me a version of your patch so I can examine it for inclusion?
> Also, one quickfix: test runner 'run.php' is trying to throw a
> 'function' 'Exception' on line 36 ;-)
Fixed now; thanks. :-)
--
Paul M. Jones <http://paul-m-jones.com>
Solar: Simple Object Library and Application Repository
for PHP5. <http://solarphp.com>
Savant: The simple, elegant, and powerful solution for
templates in PHP. <http://phpsavant.com>
More information about the solar-talk
mailing list