On Mon, Sep 20, 2010 at 8:25 AM, A.L.E.C alec@alec.pl wrote:
On 18.09.2010 19:12, Thomas Bruederli wrote:
I think this is a bug. When I look at the code, in db_connect() we do $this->db_mode = $mode right at the beginning and later we have if ($this->db_mode == 'w') return;
Having $this->db_mode = $mode set at the end of the procedure would be correct.
Problem is because rcube_mdb2 stores DB handle in one variable. So, it is overwritten.
I don't think this is a problem. The behavior sould be: Connect to read-only DB first and switch to read-write connection when the first write operation is to be done. From that time on, also read operations can be performed on the read-write connection. This is exactly what if ($this->db_mode == 'w') return; tries to achieve. Unfortunately the whole logic doesn't work at all because rcmail::get_dbh() opens a read-write connection right from the beginning.
I'll try to fix this in rcube_mdb2 class.
~Thomas _______________________________________________ List info: http://lists.roundcube.net/dev/ BT/aba52c80