[Cdash] database support in cdash

Julien Jomier julien.jomier at kitware.com
Mon Jun 30 23:41:11 UTC 2008


Thanks for the patch.

I'm modifying the current SVN with support for PDO, as long as we keep 
it compatible with MySQL we should be OK. I'm currently working on the 
installation part.

I'll setup a postgres installation on our CDash testing server to see if 
everything works as expected.

I'll keep you posted on my progress,

Markus Grabner wrote:
> Am Montag, 30. Juni 2008 schrieb Julien Jomier:
>> Markus,
>> This is great.
>> Here's what I suggest:
>> 1) We transform the classes to make use of PDO
> Ok, those not yet using PDO should not be affected due to the backward 
> compatibility layer (i.e., mapping PDO calls back to MySQL).
>> 2) We modify the installation to support PostgreSQL
> This is probably less straightforward. I tried to run cdash on a PostgreSQL 
> database and discovered several incompatibilities between MySQL and 
> PostgreSQL (see below for more detail). Working on these issues might also 
> affect the MySQL interface. Do you think we should open a branch for this 
> task until the code stabilizes?
>> 3) We create a Utilities/PDO directory where we put the translation files.
> Ok.
>> I think we should start first with PostGreSQL and make sure that it
>> works, I'm a little bit hesitant to put the other database support
>> without testing them first.
> I agree, I just added the translations for the other databases as additional 
> test cases for the SQL-Translator.
> Here are the MySQL/PostgreSQL issues I noted so far:
> *) MySQL quotes table identifiers like `this`, while PostgreSQL uses "this" 
> notation. There is a table "user" for which quoting is essential at least in 
> PostgreSQL, therefore I added a function "qid()" to "common.php" to quote SQL 
> identifiers.
> *) For numeric fields, MySQL interprets '' (two single quotes) as the default 
> value, while the same code produces an error in PostgreSQL. I added the 
> function "qnum()" to "common.php" to quote numbers for use in SQL statements 
> (i.e., replace "''" by "DEFAULT"). BTW, MySQL doesn't require single quotes 
> for numbers, so portability is probably improved by removing quotes 
> altogether for numeric values.
> *) The timestamp "0000-00-00 00:00:00" is illegal in PostgreSQL, I replaced it 
> by "0001-01-01 00:00:00". The NULL value might also be a good choice instead, 
> but I didn't further verify this.
> *) PostgreSQL expects timestamps in the format 'YYYY-MM-DD HH:mm:ss'. I 
> changed a few occurences of YYYYMMDDHHmmss.
> With these changes applied at some places in the code (see attached patch 
> against rev. 996), one can create and edit projects, register new users, and 
> assign users to projects in cdash connected to a PostgreSQL database. 
> However, it definitely requires more testing and modifications to support 
> more cdash features.
> 	Kind regards,
> 		Markus

More information about the CDash mailing list