Commit a375a620 by Carsten Brandt

bump minimum required cubrid version

there is no reliable way to determine the cubrid PDO extension version used and also no reliable way to detect which combination of server and client produces wrong behavior. By requiering 9.3 or higher in both client and server we can be sure it works. fixes #852
parent 010704d3
...@@ -35,7 +35,8 @@ Below is the list of databases that are currently supported by Yii Active Record ...@@ -35,7 +35,8 @@ Below is the list of databases that are currently supported by Yii Active Record
* SQLite 2 and 3: via [[yii\db\ActiveRecord]] * SQLite 2 and 3: via [[yii\db\ActiveRecord]]
* Microsoft SQL Server 2010 or later: via [[yii\db\ActiveRecord]] * Microsoft SQL Server 2010 or later: via [[yii\db\ActiveRecord]]
* Oracle: via [[yii\db\ActiveRecord]] * Oracle: via [[yii\db\ActiveRecord]]
* CUBRID 9.1 or later: via [[yii\db\ActiveRecord]] * CUBRID 9.3 or later: via [[yii\db\ActiveRecord]] (Note that due to a [bug](http://jira.cubrid.org/browse/APIS-658) in
the cubrid PDO extension, quoting of values will not work, so you need CUBRID 9.3 as the client as well as the server)
* Sphnix: via [[yii\sphinx\ActiveRecord]], requires `yii2-sphinx` extension * Sphnix: via [[yii\sphinx\ActiveRecord]], requires `yii2-sphinx` extension
* ElasticSearch: via [[yii\elasticsearch\ActiveRecord]], requires `yii2-elasticsearch` extension * ElasticSearch: via [[yii\elasticsearch\ActiveRecord]], requires `yii2-elasticsearch` extension
* Redis 2.6.12 or later: via [[yii\redis\ActiveRecord]], requires `yii2-redis` extension * Redis 2.6.12 or later: via [[yii\redis\ActiveRecord]], requires `yii2-redis` extension
......
...@@ -10,7 +10,8 @@ uniform API and solves some inconsistencies between different DBMS. By default Y ...@@ -10,7 +10,8 @@ uniform API and solves some inconsistencies between different DBMS. By default Y
- [MariaDB](https://mariadb.com/) - [MariaDB](https://mariadb.com/)
- [SQLite](http://sqlite.org/) - [SQLite](http://sqlite.org/)
- [PostgreSQL](http://www.postgresql.org/) - [PostgreSQL](http://www.postgresql.org/)
- [CUBRID](http://www.cubrid.org/): version 9.1.0 or higher. - [CUBRID](http://www.cubrid.org/): version 9.3 or higher. (Note that due to a [bug](http://jira.cubrid.org/browse/APIS-658) in
the cubrid PDO extension, quoting of values will not work, so you need CUBRID 9.3 as the client as well as the server)
- [Oracle](http://www.oracle.com/us/products/database/overview/index.html) - [Oracle](http://www.oracle.com/us/products/database/overview/index.html)
- [MSSQL](https://www.microsoft.com/en-us/sqlserver/default.aspx): version 2005 or higher. - [MSSQL](https://www.microsoft.com/en-us/sqlserver/default.aspx): version 2005 or higher.
......
...@@ -10,7 +10,7 @@ namespace yii\db\cubrid; ...@@ -10,7 +10,7 @@ namespace yii\db\cubrid;
use yii\base\InvalidParamException; use yii\base\InvalidParamException;
/** /**
* QueryBuilder is the query builder for CUBRID databases (version 9.1.x and higher). * QueryBuilder is the query builder for CUBRID databases (version 9.3.x and higher).
* *
* @author Carsten Brandt <mail@cebe.cc> * @author Carsten Brandt <mail@cebe.cc>
* @since 2.0 * @since 2.0
......
...@@ -13,7 +13,7 @@ use yii\db\ColumnSchema; ...@@ -13,7 +13,7 @@ use yii\db\ColumnSchema;
use yii\db\Transaction; use yii\db\Transaction;
/** /**
* Schema is the class for retrieving metadata from a CUBRID database (version 9.1.x and higher). * Schema is the class for retrieving metadata from a CUBRID database (version 9.3.x and higher).
* *
* @author Carsten Brandt <mail@cebe.cc> * @author Carsten Brandt <mail@cebe.cc>
* @since 2.0 * @since 2.0
...@@ -104,30 +104,6 @@ class Schema extends \yii\db\Schema ...@@ -104,30 +104,6 @@ class Schema extends \yii\db\Schema
} }
/** /**
* Quotes a string value for use in a query.
* Note that if the parameter is not a string, it will be returned without change.
* @param string $str string to be quoted
* @return string the properly quoted string
* @see http://www.php.net/manual/en/function.PDO-quote.php
*/
public function quoteValue($str)
{
if (!is_string($str)) {
return $str;
}
$pdo = $this->db->getSlavePdo();
// workaround for broken PDO::quote() implementation in CUBRID 9.1.0 http://jira.cubrid.org/browse/APIS-658
$version = $pdo->getAttribute(\PDO::ATTR_CLIENT_VERSION);
if (version_compare($version, '8.4.4.0002', '<') || $version[0] == '9' && version_compare($version, '9.2.0.0002', '<=')) {
return "'" . addcslashes(str_replace("'", "''", $str), "\000\n\r\\\032") . "'";
} else {
return $pdo->quote($str);
}
}
/**
* Creates a query builder for the CUBRID database. * Creates a query builder for the CUBRID database.
* @return QueryBuilder query builder instance * @return QueryBuilder query builder instance
*/ */
......
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