Commit 6f5cf403 authored by lsmith's avatar lsmith

- default to sql standard concat syntax instead of mysql's non standard variant

parent 442fb477
......@@ -299,15 +299,16 @@ class Doctrine_Expression_Driver extends Doctrine_Connection_Module
* Returns a series of strings concatinated
*
* concat() accepts an arbitrary number of parameters. Each parameter
* must contain an expression or an array with expressions.
* must contain an expression
*
* @param string|array(string) strings that will be concatinated.
* @param string $arg1, $arg2 ... $argN strings that will be concatinated.
* @return string
*/
public function concat()
{
$args = func_get_args();
return 'CONCAT(' . join(', ', (array) $args) . ')';
return join(' || ' , $args);
}
/**
......
......@@ -112,16 +112,17 @@ class Doctrine_Expression_Mysql extends Doctrine_Expression_Driver
}
/**
* Returns string to concatenate two or more string parameters
* Returns a series of strings concatinated
*
* @param string $value1
* @param string $value2
* @param string $values...
* @return string to concatenate two strings
**/
function concat($value1, $value2)
* concat() accepts an arbitrary number of parameters. Each parameter
* must contain an expression or an array with expressions.
*
* @param string|array(string) strings that will be concatinated.
*/
public function concat()
{
$args = func_get_args();
return 'CONCAT('.implode(', ', $args).')';
return 'CONCAT(' . join(', ', (array) $args) . ')';
}
}
......@@ -32,22 +32,6 @@ Doctrine::autoload('Doctrine_Expression_Driver');
*/
class Doctrine_Expression_Oracle extends Doctrine_Expression_Driver
{
/**
* Returns a series of strings concatinated
*
* concat() accepts an arbitrary number of parameters. Each parameter
* must contain an expression
*
* @param string $arg1, $arg2 ... $argN strings that will be concatinated.
* @return string
*/
public function concat()
{
$args = func_get_args();
return join(' || ' , $args);
}
/**
* return string to call a function to get a substring inside an SQL statement
*
......
......@@ -83,17 +83,6 @@ class Doctrine_Expression_Pgsql extends Doctrine_Expression_Driver
}
}
/**
* Returns a series of strings concatinated
*
* concat() accepts an arbitrary number of parameters. Each parameter
* must contain an expression or an array with expressions.
*
* @param string|array(string) strings that will be concatinated.
* @return string
*/
/**
* PostgreSQLs AGE(<timestamp1> [, <timestamp2>]) function.
*
......@@ -131,19 +120,6 @@ class Doctrine_Expression_Pgsql extends Doctrine_Expression_Driver
return 'TO_CHAR(' . $time . ', ' . $text . ')';
}
/**
* PostgreSQLs CONCAT() function
*
* @param an array of values
* @return string
*/
public function concat()
{
$args = func_get_args();
return join(' || ' , $args);
}
/**
* Returns the SQL string to return the current system date and time.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment