Under advisement for another bug, I just pulled the cvs today and now on all the email screens, I have the following:
DB Error in /home/httpd/html/roundcube/program/include/rcube_db.inc (148): DB Error: syntax error<br /><b>DB Error in /home/httpd/html/roundcube/program/include/rcub e_db.inc (148): DB Error: syntax error<br /><b>DB Error in /home/httpd/html/roundcube/program/include/rcub e_db.inc (148): DB Error: syntax error
And folders don't appear to be loading right.. I tried dropping all tables and running the mysql script again, but it didn't help.
Also had another weird error about fopen on bugs.inc line 67 which I 'fixed' by putting in the full path instead of the variable that was there, not sure what the deal with that was.
Hi !!
Under advisement for another bug, I just pulled the cvs today and now on all the email screens, I have the following:
DB Error in /home/httpd/html/roundcube/program/include/rcube_db.inc (148): DB Error: syntax error
i just uploaded yesterday evening some changes to that file, it works ok on my server, could you please ensure that you have the latest cvs changes ? if the error persists, please take a look at the page source and sent the complete error message.
howdy,
i can confirm this error with a fresh cvs tree.
the problem is in line 85 of program/include/cache.inc:
VALUES (NOW(), ?, ?, ?', ?)
should be:
VALUES (NOW(), ?, ?, ?, ?)
also, it might be worth changing the raise error logging code to include the query string that when there's an error - that's how i found this bug.
cheers justin
David Saez Padros wrote:
Hi !!
Under advisement for another bug, I just pulled the cvs today and now on all the email screens, I have the following:
DB Error in /home/httpd/html/roundcube/program/include/rcube_db.inc (148): DB Error: syntax error
i just uploaded yesterday evening some changes to that file, it works ok on my server, could you please ensure that you have the latest cvs changes ? if the error persists, please take a look at the page source and sent the complete error message.
It does not work for me either. First the MySQL files for MDB2 are missing in the CVS (MDB2 Error: not found). I added them to the repository.
If I add them to program/lib/MDB2/ there is a syntax error coming up at the first query: MDB2 Error: syntax error
As far as I can see, the method rcube_mdb2::query extracts all arguments and passes them to rcube_mdb2::_query but they're never used to replace the ? within the SQL statement. I think this causes the Syntax error.
For Postgres support I think we have to replace all 'NOW()' commands to lowercased 'now()'.
I was also thinking of replacing the rcube_mdb2 class completely and call MDB2 methods directly form the steps. Just create the MDB2 object in rcube_init() and connect to the DB directly. To use UNIX_TIMESTAP we should fetch the raw date from the DB (simple SELECT changed_date ...) and convert it using the MDB2 method mdbstamp2Unix().
What do you think about this?
Thomas
David Saez Padros wrote:
Hi !!
Under advisement for another bug, I just pulled the cvs today and now on all the email screens, I have the following:
DB Error in /home/httpd/html/roundcube/program/include/rcube_db.inc (148): DB Error: syntax error
i just uploaded yesterday evening some changes to that file, it works ok on my server, could you please ensure that you have the latest cvs changes ? if the error persists, please take a look at the page source and sent the complete error message.
Hi !!
It does not work for me either. First the MySQL files for MDB2 are missing in the CVS (MDB2 Error: not found). I added them to the repository.
where did yuo get it ? the package i downloaded from http://pear.php.net/package/MDB2/download has the very same files as my cvs tree ?? (well, i missed just one file that i just added)
As far as I can see, the method rcube_mdb2::query extracts all arguments and passes them to rcube_mdb2::_query but they're never used to replace the ? within the SQL statement. I think this causes the Syntax error.
fixed.
For Postgres support I think we have to replace all 'NOW()' commands to lowercased 'now()'.
that's true ? looks very strange ... anyone using postgres can confirm this ?
I was also thinking of replacing the rcube_mdb2 class completely and call MDB2 methods directly form the steps. Just create the MDB2 object in rcube_init() and connect to the DB directly.
What do you think about this?
maybe it's not a good idea, mdb2 is still beta and does not support as many database backeds as pear does, maybe it's better to have both functional. Also having a first 'abstraction' layer at rcube_db will allow in the future to add or replace the database backend without effort.
To use UNIX_TIMESTAP we should fetch the raw date from the DB (simple SELECT changed_date ...) and convert it using the MDB2 method mdbstamp2Unix().
that has been solved using a different aproach, the rcube_db class has a function that returns the correct syntax for that function (this saves one query)
David Saez Padros wrote:
Hi !!
It does not work for me either. First the MySQL files for MDB2 are missing in the CVS (MDB2 Error: not found). I added them to the repository.
where did yuo get it ? the package i downloaded from http://pear.php.net/package/MDB2/download has the very same files as my cvs tree ?? (well, i missed just one file that i just added)
When I download the MDB2 package (beta6) I just have the basic/common files within the MDB2 folder. Then I have to download each specific DB driver separately (http://pear.php.net/package/MDB2_Driver_mysql/)
As far as I can see, the method rcube_mdb2::query extracts all arguments and passes them to rcube_mdb2::_query but they're never used to replace the ? within the SQL statement. I think this causes the Syntax error.
fixed.
For Postgres support I think we have to replace all 'NOW()' commands to lowercased 'now()'.
that's true ? looks very strange ... anyone using postgres can confirm this ?
As far as we can trust this post: http://sourceforge.net/tracker/index.php?func=detail&aid=1320311&gro...
This is from a previous post "Have you considered MDB2?" on 15.10.2005: "As for your handling of NOW(). Currently MDB2 handles this through MDB2_Date. However there have always been plans to add a module that will generate the necessary SQL to make SQL functions portable."
We should use this abstraction function as well.
I was also thinking of replacing the rcube_mdb2 class completely and call MDB2 methods directly form the steps. Just create the MDB2 object in rcube_init() and connect to the DB directly. What do you think about this?
maybe it's not a good idea, mdb2 is still beta and does not support as many database backeds as pear does, maybe it's better to have both functional. Also having a first 'abstraction' layer at rcube_db will allow in the future to add or replace the database backend without effort.
You maybe right.... but I can live with just support for MDB2. I think MDB2 will be stable before RoundCube gets out of beta state.
To use UNIX_TIMESTAP we should fetch the raw date from the DB (simple SELECT changed_date ...) and convert it using the MDB2 method mdbstamp2Unix().
that has been solved using a different aproach, the rcube_db class has a function that returns the correct syntax for that function (this saves one query)
I saw your solution but this still requires to add a separate abstraction in our layer for each new database. If there's an abstraction functionality in the PEAR package we should use this.
I would prefer that the rcube_db class gets similar methods for data type conversion and just pass them to the PEAR object if available (as in MDB2) and implements them itself if not (as for DB).
Thomas
Hi !!
When I download the MDB2 package (beta6) I just have the basic/common files within the MDB2 folder. Then I have to download each specific DB driver separately (http://pear.php.net/package/MDB2_Driver_mysql/)
ok, i just added all other drivers.
For Postgres support I think we have to replace all 'NOW()' commands to lowercased 'now()'.
that's true ? looks very strange ... anyone using postgres can confirm this ?
As far as we can trust this post: http://sourceforge.net/tracker/index.php?func=detail&aid=1320311&gro...
well, it's hard to understand why NOW() does not work and now() works, but as mysql works with both i changed it to now()
maybe it's not a good idea, mdb2 is still beta and does not support as many database backeds as pear does, maybe it's better to have both functional. Also having a first 'abstraction' layer at rcube_db will allow in the future to add or replace the database backend without effort.
You maybe right.... but I can live with just support for MDB2. I think MDB2 will be stable before RoundCube gets out of beta state.
from my point of view replacing the current rcube_db with mdb2 is a bad idea, first it involves work and no real beneffit, you loose replication support and if something goes wrong with mdb2 you are totally tied to it (what happens if mdb2 is still beta when rc has to be released). Having a own layer is a degree of freedom that does not impose any restriction or speed problem and let's you change all database backend whenever you like with little effort.
I saw your solution but this still requires to add a separate abstraction in our layer for each new database. If there's an abstraction functionality in the PEAR package we should use this.
as far as i know pear does not have this functionality and i cannot find any proper documentation for mdb2 so i also do not know how to do it with mdb2.
I would prefer that the rcube_db class gets similar methods for data type conversion and just pass them to the PEAR object if available (as in MDB2) and implements them itself if not (as for DB).
what do you mean ?
David Saez Padros wrote:
well, it's hard to understand why NOW() does not work and now() works, but as mysql works with both i changed it to now()
CURRENT_TIMESTAMP might be the better choice .. atleast for mysql 4.x and postgresql and the rest of the RDBMS world :-)
maybe it's not a good idea, mdb2 is still beta and does not support as many database backeds as pear does, maybe it's better to have both functional. Also having a first 'abstraction' layer at rcube_db will allow in the future to add or replace the database backend without effort.
You maybe right.... but I can live with just support for MDB2. I think MDB2 will be stable before RoundCube gets out of beta state.
from my point of view replacing the current rcube_db with mdb2 is a bad idea, first it involves work and no real beneffit, you loose replication support and if something goes wrong with mdb2 you are totally tied to it (what happens if mdb2 is still beta when rc has to be released). Having a own layer is a degree of freedom that does not impose any restriction or speed problem and let's you change all database backend whenever you like with little effort.
I would agree if RC could use __call() overloading. But this would make it php5 dependent as in php4 overloading never worked properly. Without it you are likely to have to maintain a needlessly large redundant API.
I saw your solution but this still requires to add a separate abstraction in our layer for each new database. If there's an abstraction functionality in the PEAR package we should use this.
as far as i know pear does not have this functionality and i cannot
I havent implemented unix timestamp function call abstraction yet. I doubt its going to be easy as from a first quick look several RDBMS simply lack the necessary functions.
find any proper documentation for mdb2 so i also do not know how to do it with mdb2.
Actually this is probably the bigger issue with MDB2: Its fairly undocumented. The API is a hybrid of the DB and PDO API, but nowhere is it really documented from an end user perspecitive (of course there is full API documentation!). I have a few talks with slides etc.
regards, Lukas