mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-12 06:18:52 +00:00
[ticket/10942] Add sql_concatenate to dbal
PHPBB3-10942
This commit is contained in:
parent
dd0da6fffb
commit
1e3272bfce
7 changed files with 60 additions and 0 deletions
|
@ -300,6 +300,18 @@ class dbal
|
||||||
return $sql_condition;
|
return $sql_condition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build a concatenated string
|
||||||
|
*
|
||||||
|
* @param string $string1 Base SQL statement where we append the second one
|
||||||
|
* @param string $string2 SQL statement that is appended on the first statement
|
||||||
|
* @return string Concatenated string
|
||||||
|
*/
|
||||||
|
function sql_concatenate($string1, $string2)
|
||||||
|
{
|
||||||
|
return 'CONCAT(' . $string1 . ', ' . $string2 . ')';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether results of a query need to be buffered to run a transaction while iterating over them.
|
* Returns whether results of a query need to be buffered to run a transaction while iterating over them.
|
||||||
*
|
*
|
||||||
|
|
|
@ -110,6 +110,14 @@ class dbal_firebird extends dbal
|
||||||
return ($raw) ? '2.1' : 'Firebird/Interbase';
|
return ($raw) ? '2.1' : 'Firebird/Interbase';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
function sql_concatenate($string1, $string2)
|
||||||
|
{
|
||||||
|
return $string1 . ' || ' . $string2;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SQL Transaction
|
* SQL Transaction
|
||||||
* @access private
|
* @access private
|
||||||
|
|
|
@ -91,6 +91,14 @@ class dbal_mssql extends dbal
|
||||||
return ($this->sql_server_version) ? 'MSSQL<br />' . $this->sql_server_version : 'MSSQL';
|
return ($this->sql_server_version) ? 'MSSQL<br />' . $this->sql_server_version : 'MSSQL';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
function sql_concatenate($string1, $string2)
|
||||||
|
{
|
||||||
|
return $string1 . ' + ' . $string2;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SQL Transaction
|
* SQL Transaction
|
||||||
* @access private
|
* @access private
|
||||||
|
|
|
@ -109,6 +109,14 @@ class dbal_mssql_odbc extends dbal
|
||||||
return ($this->sql_server_version) ? 'MSSQL (ODBC)<br />' . $this->sql_server_version : 'MSSQL (ODBC)';
|
return ($this->sql_server_version) ? 'MSSQL (ODBC)<br />' . $this->sql_server_version : 'MSSQL (ODBC)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
function sql_concatenate($string1, $string2)
|
||||||
|
{
|
||||||
|
return $string1 . ' + ' . $string2;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SQL Transaction
|
* SQL Transaction
|
||||||
* @access private
|
* @access private
|
||||||
|
|
|
@ -257,6 +257,14 @@ class dbal_mssqlnative extends dbal
|
||||||
return ($this->sql_server_version) ? 'MSSQL<br />' . $this->sql_server_version : 'MSSQL';
|
return ($this->sql_server_version) ? 'MSSQL<br />' . $this->sql_server_version : 'MSSQL';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
function sql_concatenate($string1, $string2)
|
||||||
|
{
|
||||||
|
return $string1 . ' + ' . $string2;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -154,6 +154,14 @@ class dbal_postgres extends dbal
|
||||||
return ($raw) ? $this->sql_server_version : 'PostgreSQL ' . $this->sql_server_version;
|
return ($raw) ? $this->sql_server_version : 'PostgreSQL ' . $this->sql_server_version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
function sql_concatenate($string1, $string2)
|
||||||
|
{
|
||||||
|
return $string1 . ' || ' . $string2;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SQL Transaction
|
* SQL Transaction
|
||||||
* @access private
|
* @access private
|
||||||
|
|
|
@ -72,6 +72,14 @@ class dbal_sqlite extends dbal
|
||||||
return ($raw) ? $this->sql_server_version : 'SQLite ' . $this->sql_server_version;
|
return ($raw) ? $this->sql_server_version : 'SQLite ' . $this->sql_server_version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
function sql_concatenate($string1, $string2)
|
||||||
|
{
|
||||||
|
return $string1 . ' || ' . $string2;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SQL Transaction
|
* SQL Transaction
|
||||||
* @access private
|
* @access private
|
||||||
|
|
Loading…
Add table
Reference in a new issue