Commit 00f9c254 authored by Dries's avatar Dries

- Patch #422366 by jamesAn: improved static caching in database drivers.

parent 69287245
......@@ -175,6 +175,7 @@ public function getFieldTypeMap() {
// Put :normal last so it gets preserved by array_flip. This makes
// it much easier for modules (such as schema.module) to map
// database types back into schema types.
// $map does not use drupal_static as its value never changes.
static $map = array(
'varchar:normal' => 'VARCHAR',
'char:normal' => 'CHAR',
......
......@@ -213,7 +213,8 @@ function getFieldTypeMap() {
// Put :normal last so it gets preserved by array_flip. This makes
// it much easier for modules (such as schema.module) to map
// database types back into schema types.
$map = array(
// $map does not use drupal_static as its value never changes.
static $map = array(
'varchar:normal' => 'varchar',
'char:normal' => 'character',
......
......@@ -1077,6 +1077,8 @@ public function compile(DatabaseConnection $connection) {
// rather than just this query. That is OK, because we only need definitive
// placeholder names if we're going to use them for _alter hooks, which we
// are not. The alter hook would intervene before compilation.
// $next_placeholder does not use drupal_static as it increments and should
// never be reset during a request.
static $next_placeholder = 1;
if ($this->changed) {
......@@ -1168,6 +1170,7 @@ public function __toString() {
* The extra handling directives for the specified operator, or NULL.
*/
protected function mapConditionOperator($operator) {
// $specials does not use drupal_static as its value never changes.
static $specials = array(
'BETWEEN' => array('delimiter' => ' AND '),
'IN' => array('delimiter' => ', ', 'prefix' => ' (', 'postfix' => ')'),
......
......@@ -168,7 +168,8 @@ public function getFieldTypeMap() {
// Put :normal last so it gets preserved by array_flip. This makes
// it much easier for modules (such as schema.module) to map
// database types back into schema types.
$map = array(
// $map does not use drupal_static as its value never changes.
static $map = array(
'varchar:normal' => 'VARCHAR',
'text:tiny' => 'TEXT',
......
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