1

Topic: sqlite and "truncate" statement in 12_to_125_update.php

Hello,

I just did an update from 1.2.4 to 1.2.5. I'm using sqlite as the backend. The update script 12_to_125_update.php failed with an error at line 135 which I tracked down to a truncate statement ("truncate table search_cache"). sqlite apparently doesn't support this statement, so I commented it out and then the update went fine.

I'm not familiar with the "truncate" command - would "delete from search_cache" be analogous?

Re: sqlite and "truncate" statement in 12_to_125_update.php

Yes.
Nice catch smile

Re: sqlite and "truncate" statement in 12_to_125_update.php

You're right. I'll make a note of it for future update scripts.

The difference between TRUNCATE and DELETE is in the way they are implemented. TRUNCATE usually drops the table and re-creates it whereas DELETE iterates through the table and deletes the rows one by one. TRUNCATE is a lot faster (at least in MySQL).

"Programming is like sex: one mistake and you have to support it for the rest of your life."