Permalink
Browse files

Fix #589

  • Loading branch information...
1 parent bdd9c11 commit 083e3c8d39a4fb9f8ef37f61f0ea42ec3fe1389f @narfbg narfbg committed Nov 6, 2012
View
8 system/database/DB_query_builder.php
@@ -1444,13 +1444,13 @@ public function insert_batch($table = '', $set = NULL, $escape = NULL)
// --------------------------------------------------------------------
/**
- * Insert_batch statement
+ * Insert batch statement
*
* Generates a platform-specific insert string from the supplied data.
*
- * @param string the table name
- * @param array the insert keys
- * @param array the insert values
+ * @param string $table Table name
+ * @param array $keys INSERT keys
+ * @param array $values INSERT values
* @return string
*/
protected function _insert_batch($table, $keys, $values)
View
23 system/database/drivers/mssql/mssql_driver.php
@@ -489,6 +489,29 @@ protected function _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_unsuported_feature') : FALSE;
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Close DB Connection
*
* @return void
View
2 system/database/drivers/oci8/oci8_driver.php
@@ -604,7 +604,7 @@ public function error()
// --------------------------------------------------------------------
/**
- * Insert_batch statement
+ * Insert batch statement
*
* Generates a platform-specific insert string from the supplied data
*
View
23 system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
@@ -262,6 +262,29 @@ protected function _limit($sql)
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_unsuported_feature') : FALSE;
+ }
+
}
/* End of file pdo_dblib_driver.php */
View
2 system/database/drivers/pdo/subdrivers/pdo_oci_driver.php
@@ -172,7 +172,7 @@ protected function _field_data($table)
// --------------------------------------------------------------------
/**
- * Insert_batch statement
+ * Insert batch statement
*
* @param string $table Table name
* @param array $keys INSERT keys
View
23 system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php
@@ -296,6 +296,29 @@ protected function _limit($sql)
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_unsuported_feature') : FALSE;
+ }
+
}
/* End of file pdo_sqlsrv_driver.php */
View
23 system/database/drivers/sqlsrv/sqlsrv_driver.php
@@ -496,6 +496,29 @@ protected function _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_unsuported_feature') : FALSE;
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Close DB Connection
*
* @return void

0 comments on commit 083e3c8

Please sign in to comment.