#1483835 closed Bugs (fixed)
DB Error when deleting from the message table
| Reported by: | mmarques | Owned by: | |
|---|---|---|---|
| Priority: | 5 | Milestone: | 0.1-rc1 |
| Component: | Database | Version: | 0.1-beta2 |
| Severity: | critical | Keywords: | |
| Cc: |
Description
I've been seeing lots of errors in the log/errors file related to DELETE
commands to the DB (PostgreSQL in my case):
[09-Jun-2006 08:27:23 -0300] DB Error: DB Error: unknown error Query: DELETE
FROM messages WHERE user_id='1' AND cache_key='pgsql-ayuda.msg' AND
idx>=FALSE [nativecode=ERROR: el operador no existe: integer >= boolean HINT:
Ning?n operador coincide con el nombre y el tipo de los argumentos. Puede desear
agregar conversiones expl?citas de tipos.] in
/var/www/html/roundcubemail/program/include/rcube_db.inc on line 478
Tracking down the error I found out that in the DELETE execution, sometimes the
last argument wasn't passed right, and I found out that it was related to the
clear_message_cache method in rcube_imap.
Here's the patch:
$ svn diff program/include/rcube_imap.inc
Index: program/include/rcube_imap.inc
===================================================================
--- program/include/rcube_imap.inc (revision 259)
+++ program/include/rcube_imap.inc (working copy)
@@ -1052,8 +1052,8 @@
$start_index = 100000;
foreach ($a_uids as $uid)
{
- $index = array_search($uid, $a_cache_index);
- $start_index = min($index, $start_index);
+ if(($index = array_search($uid, $a_cache_index)) !== FALSE)
+ $start_index = min($index, $start_index);
}
clear cache from the lowest index on
Attachments (1)
Change History (7)
Changed 7 years ago by mmarques
comment:1 Changed 7 years ago by richs
- Resolution set to fixed
- Status changed from new to closed
Added patch in SVN
comment:2 Changed 6 years ago by moc
- Milestone set to 0.1-rc1
- Resolution fixed deleted
- Severity changed from normal to critical
- Status changed from closed to reopened
- Version changed from later to 0.1-beta2
It has not been added to the SVN yet
comment:3 Changed 6 years ago by robin
- Resolution set to fixed
- Status changed from reopened to closed
Yes, it has, in [25d8ba63].
comment:4 Changed 6 years ago by moc
check the latest version in trunk of the file rcube_imap.inc, the line 1437 needs to be patched with
if(($index = array_search($uid, $a_cache_index)) !== FALSE)
comment:5 Changed 6 years ago by moc
- Resolution fixed deleted
- Status changed from closed to reopened
comment:6 Changed 6 years ago by robin
- Resolution set to fixed
- Status changed from reopened to closed
Ah, there were two places where this problem occurred. OK, fixed in [6ce04b1f].

patch diff for DB Errors on delete