[Typo3-dev] DBAL issues solved for postgresql and mysql
Karsten Dambekalns
k.dambekalns at fishfarm.de
Thu Dec 9 15:52:01 CET 2004
Hi Ries.
On 2004-12-08, Ries van Twisk <typo3 at rvt.dds.nl> wrote:
> we found some isues using dbal with the folowing functions, comments are added
> with the marking RVT.
...
> $str = $this->handlerInstance[$this->lastHandlerKey]->qstr($str);
> // RVT remove begin and end quotes which has been added by adodb, addslashes
> does not do such a thing
> // so we always return a quoted string WITHOUT begin and end quotes!!!!!
NO, NO, NO.
Yesterday the changes needed for the core have been sent to Kapser
(finally), and quoteStr DOES add single quotes now. We *need* those
quotes, so we can remove existing hardcoded quotes throughout the code
and use 'proper' quoting according to the database used (see below).
> // RVT In case of postgress we don't want to quote a DEFAULT!!
> // is THIS the right place to check for this condition???, maby better to
> override this function in DBAL!!!
> if ($v != 'DEFAULT') {
> // RVT add begin and end quotes
> $fields_values[$k] = '\''.$this->quoteStr($v, $table).'\'';
This I don't understand - when would DEFAULT be handed to this
function? I may be missing something here about PostgreSQL, has
DEFAULT as a value a special meaning with it?
> // RVT replaced double quotes (") with single quotes (') UNTESTED!!!!!!!
Right, exactly this is what my changes (see above) do to the whole
core. And a lot more, of course. :)
Regards,
Karsten
More information about the TYPO3-dev
mailing list