summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php')
-rw-r--r--system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php70
1 files changed, 58 insertions, 12 deletions
diff --git a/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php b/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
index 785b2795c..7121819ec 100644
--- a/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
+++ b/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
@@ -1,4 +1,4 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php
/**
* CodeIgniter
*
@@ -24,6 +24,7 @@
* @since Version 3.0.0
* @filesource
*/
+defined('BASEPATH') OR exit('No direct script access allowed');
/**
* PDO DBLIB Database Adapter Class
@@ -40,18 +41,40 @@
*/
class CI_DB_pdo_dblib_driver extends CI_DB_pdo_driver {
+ /**
+ * Sub-driver
+ *
+ * @var string
+ */
public $subdriver = 'dblib';
+ // --------------------------------------------------------------------
+
+ /**
+ * ORDER BY random keyword
+ *
+ * @var string
+ */
protected $_random_keyword = ' NEWID()';
+ /**
+ * Quoted identifier flag
+ *
+ * Whether to use SQL-92 standard quoted identifier
+ * (double quotes) or brackets for identifier escaping.
+ *
+ * @var bool
+ */
protected $_quoted_identifier;
+ // --------------------------------------------------------------------
+
/**
- * Constructor
+ * Class constructor
*
* Builds the DSN if not already set.
*
- * @param array
+ * @param array $params
* @return void
*/
public function __construct($params)
@@ -85,9 +108,9 @@ class CI_DB_pdo_dblib_driver extends CI_DB_pdo_driver {
// --------------------------------------------------------------------
/**
- * Non-persistent database connection
+ * Database connection
*
- * @param bool
+ * @param bool $persistent
* @return object
*/
public function db_connect($persistent = FALSE)
@@ -115,7 +138,7 @@ class CI_DB_pdo_dblib_driver extends CI_DB_pdo_driver {
*
* Generates a platform-specific query string so that the table names can be fetched
*
- * @param bool
+ * @param bool $prefix_limit
* @return string
*/
protected function _list_tables($prefix_limit = FALSE)
@@ -140,7 +163,7 @@ class CI_DB_pdo_dblib_driver extends CI_DB_pdo_driver {
*
* Generates a platform-specific query string so that the column names can be fetched
*
- * @param string the table name
+ * @param string $table
* @return string
*/
protected function _list_columns($table = '')
@@ -157,8 +180,8 @@ class CI_DB_pdo_dblib_driver extends CI_DB_pdo_driver {
*
* Generates a platform-specific update string from the supplied data
*
- * @param string the table name
- * @param array the update data
+ * @param string $table
+ * @param array $values
* @return string
*/
protected function _update($table, $values)
@@ -175,7 +198,7 @@ class CI_DB_pdo_dblib_driver extends CI_DB_pdo_driver {
*
* Generates a platform-specific delete string from the supplied data
*
- * @param string the table name
+ * @param string $table
* @return string
*/
protected function _delete($table)
@@ -191,11 +214,11 @@ class CI_DB_pdo_dblib_driver extends CI_DB_pdo_driver {
// --------------------------------------------------------------------
/**
- * Limit string
+ * LIMIT
*
* Generates a platform-specific LIMIT clause
*
- * @param string the sql query string
+ * @param string $sql SQL Query
* @return string
*/
protected function _limit($sql)
@@ -239,6 +262,29 @@ class CI_DB_pdo_dblib_driver extends CI_DB_pdo_driver {
return preg_replace('/(^\SELECT (DISTINCT)?)/i','\\1 TOP '.$limit.' ', $sql);
}
+ // --------------------------------------------------------------------
+
+ /**
+ * Insert batch statement
+ *
+ * Generates a platform-specific insert string from the supplied data.
+ *
+ * @param string $table Table name
+ * @param array $keys INSERT keys
+ * @param array $values INSERT values
+ * @return string|bool
+ */
+ protected function _insert_batch($table, $keys, $values)
+ {
+ // Multiple-value inserts are only supported as of SQL Server 2008
+ if (version_compare($this->version(), '10', '>='))
+ {
+ return parent::_insert_batch($table, $keys, $values);
+ }
+
+ return ($this->db->db_debug) ? $this->db->display_error('db_unsupported_feature') : FALSE;
+ }
+
}
/* End of file pdo_dblib_driver.php */