[Cdash] database support in cdash

Julien Jomier julien.jomier at kitware.com
Tue Jul 1 00:41:58 UTC 2008


Markus,

I have the installation of CDash working for PostGreSQL.
I'm going to work on switching the default dates to '0001-01-01 
00:00:00' and testing CDash against PostGreSQL and mySQL.

Could you rerun your translation script for PostGreSQL on the current 
SVN head? I have added some tables.

Thanks,
Julien

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