From 18ba4c443e398c8dbee71a5fcb34c9e5317cb811 Mon Sep 17 00:00:00 2001
From: Lars Toomre <ltoomre@23809.no-reply.drupal.org>
Date: Wed, 2 Nov 2011 18:41:34 -0400
Subject: [PATCH] Issue 1326574 by Lars Toomre: Fixes malformed lists in
 includes/database/.

---
 core/includes/database/database.inc     |   12 ++--
 core/includes/database/pgsql/schema.inc |    6 +-
 core/includes/database/schema.inc       |  148 +++++++++++++++----------------
 3 files changed, 81 insertions(+), 85 deletions(-)

diff --git a/core/includes/database/database.inc b/core/includes/database/database.inc
index 77584f9..1b8f9ea 100644
--- a/core/includes/database/database.inc
+++ b/core/includes/database/database.inc
@@ -194,7 +194,7 @@ abstract class DatabaseConnection extends PDO {
 
   /**
    * The key representing this connection.
-   * 
+   *
    * The key is a unique string which identifies a database connection. A
    * connection can be a single server or a cluster of master and slaves (use
    * target to pick between master and slave).
@@ -986,7 +986,7 @@ abstract class DatabaseConnection extends PDO {
    * Returns a new DatabaseTransaction object on this connection.
    *
    * @param $name
-   *   Optional name of the savepoint.
+   *   (optional) Name of the savepoint.
    *
    * @see DatabaseTransaction
    */
@@ -2488,9 +2488,9 @@ function db_select($table, $alias = NULL, array $options = array()) {
  * Returns a new transaction object for the active database.
  *
  * @param string $name
- *   Optional name of the transaction.
+ *   (optional) Name of the transaction.
  * @param array $options
- *   An array of options to control how the transaction operates:
+ *   (optional) An array of options to control how the transaction operates:
  *   - target: The database target name.
  *
  * @return DatabaseTransaction
@@ -2793,7 +2793,7 @@ function db_drop_table($table) {
  *   will be set to the value of the key in all rows. This is most useful for
  *   creating NOT NULL columns with no default value in existing tables.
  * @param $keys_new
- *   Optional keys and indexes specification to be created on the table along
+ *   (optional) Keys and indexes specification to be created on the table along
  *   with adding the field. The format is the same as a table specification, but
  *   without the 'fields' element. If you are adding a type 'serial' field, you
  *   MUST specify at least one key or index including it in this array. See
@@ -2973,7 +2973,7 @@ function db_drop_index($table, $name) {
  * @param $spec
  *   The field specification for the new field.
  * @param $keys_new
- *   Optional keys and indexes specification to be created on the table along
+ *   (optional) Keys and indexes specification to be created on the table along
  *   with changing the field. The format is the same as a table specification
  *   but without the 'fields' element.
  */
diff --git a/core/includes/database/pgsql/schema.inc b/core/includes/database/pgsql/schema.inc
index 9ed8a26..a236a3a 100644
--- a/core/includes/database/pgsql/schema.inc
+++ b/core/includes/database/pgsql/schema.inc
@@ -31,10 +31,10 @@ class DatabaseSchema_pgsql extends DatabaseSchema {
    *
    * @param $table_name
    *   The non-prefixed name of the table.
-   * @return
+   * @return object
    *   An object with two member variables:
-   *     - 'blob_fields' that lists all the blob fields in the table.
-   *     - 'sequences' that lists the sequences used in that table.
+   *   - blob_fields: List of all the blob fields in the table.
+   *   - sequences: List of all of the sequences used in that table.
    */
   public function queryTableInformation($table) {
     // Generate a key to reference this table's information on.
diff --git a/core/includes/database/schema.inc b/core/includes/database/schema.inc
index 27934dc..4aa8a22 100644
--- a/core/includes/database/schema.inc
+++ b/core/includes/database/schema.inc
@@ -26,72 +26,69 @@ require_once __DIR__ . '/query.inc';
  * the module defines.
  *
  * The following keys are defined:
- *   - 'description': A string in non-markup plain text describing this table
- *     and its purpose. References to other tables should be enclosed in
- *     curly-brackets. For example, the node_revisions table
- *     description field might contain "Stores per-revision title and
- *     body data for each {node}."
- *   - 'fields': An associative array ('fieldname' => specification)
- *     that describes the table's database columns. The specification
- *     is also an array. The following specification parameters are defined:
- *     - 'description': A string in non-markup plain text describing this field
- *       and its purpose. References to other tables should be enclosed in
- *       curly-brackets. For example, the node table vid field
- *       description might contain "Always holds the largest (most
- *       recent) {node_revision}.vid value for this nid."
- *     - 'type': The generic datatype: 'char', 'varchar', 'text', 'blob', 'int',
- *       'float', 'numeric', or 'serial'. Most types just map to the according
- *       database engine specific datatypes. Use 'serial' for auto incrementing
- *       fields. This will expand to 'INT auto_increment' on MySQL.
- *     - 'mysql_type', 'pgsql_type', 'sqlite_type', etc.: If you need to
- *       use a record type not included in the officially supported list
- *       of types above, you can specify a type for each database
- *       backend. In this case, you can leave out the type parameter,
- *       but be advised that your schema will fail to load on backends that
- *       do not have a type specified. A possible solution can be to
- *       use the "text" type as a fallback.
- *     - 'serialize': A boolean indicating whether the field will be stored as
- *       a serialized string.
- *     - 'size': The data size: 'tiny', 'small', 'medium', 'normal',
- *       'big'. This is a hint about the largest value the field will
- *       store and determines which of the database engine specific
- *       datatypes will be used (e.g. on MySQL, TINYINT vs. INT vs. BIGINT).
- *       'normal', the default, selects the base type (e.g. on MySQL,
- *       INT, VARCHAR, BLOB, etc.).
- *       Not all sizes are available for all data types. See
- *       DatabaseSchema::getFieldTypeMap() for possible combinations.
- *     - 'not null': If true, no NULL values will be allowed in this
- *       database column. Defaults to false.
- *     - 'default': The field's default value. The PHP type of the
- *       value matters: '', '0', and 0 are all different. If you
- *       specify '0' as the default value for a type 'int' field it
- *       will not work because '0' is a string containing the
- *       character "zero", not an integer.
- *     - 'length': The maximal length of a type 'char', 'varchar' or 'text'
- *       field. Ignored for other field types.
- *     - 'unsigned': A boolean indicating whether a type 'int', 'float'
- *       and 'numeric' only is signed or unsigned. Defaults to
- *       FALSE. Ignored for other field types.
- *     - 'precision', 'scale': For type 'numeric' fields, indicates
- *       the precision (total number of significant digits) and scale
- *       (decimal digits right of the decimal point). Both values are
- *       mandatory. Ignored for other field types.
- *     All parameters apart from 'type' are optional except that type
- *     'numeric' columns must specify 'precision' and 'scale'.
- *  - 'primary key': An array of one or more key column specifiers (see below)
- *    that form the primary key.
- *  - 'unique keys': An associative array of unique keys ('keyname' =>
- *    specification). Each specification is an array of one or more
- *    key column specifiers (see below) that form a unique key on the table.
- *  - 'foreign keys': An associative array of relations ('my_relation' =>
- *    specification). Each specification is an array containing the name of
- *    the referenced table ('table'), and an array of column mappings
- *    ('columns'). Column mappings are defined by key pairs ('source_column' =>
- *    'referenced_column').
- *  - 'indexes':  An associative array of indexes ('indexname' =>
- *    specification). Each specification is an array of one or more
- *    key column specifiers (see below) that form an index on the
- *    table.
+ * - description: A string in non-markup plain text describing this table are
+ *   its purpose. References to other tables should be enclosed in
+ *   curly-brackets. For example, the node_revisions table description field
+ *   might contain "Stores per-revision title and body data for each {node}."
+ * - fields: An associative array ('fieldname' => specification) that describes
+ *   the table's database columns. The specification is also an array where the
+ *   following parameters are defined:
+ *   - description: A string in non-markup plain text describing this field and
+ *     its purpose. References to other tables should be enclosed in
+ *     curly-brackets. For example, the node table vid field description might
+ *     contain "Always holds the largest (most recent) {node_revision}.vid value
+ *     for this nid."
+ *   - type: The generic datatype: 'char', 'varchar', 'text', 'blob', 'int',
+ *     'float', 'numeric', or 'serial'. Most types just map to the according
+ *     database engine specific datatypes. Use 'serial' for auto incrementing
+ *     fields. This will expand to 'INT auto_increment' on MySQL.
+ *   - mysql_type, pgsql_type, sqlite_type, etc.: If you need to use a record
+ *     type not included in the officially supported list of types above, you
+ *     can specify a type for each database backend. In this case, you can leave
+ *     out the type parameter, but be advised that your schema will fail to load
+ *     on backends that do not have a type specified. A possible solution can be
+ *     to use the "text" type as a fallback.
+ *   - serialize: A boolean indicating whether the field will be stored as a
+ *     serialized string.
+ *   - size: The data size: 'tiny', 'small', 'medium', 'normal', or 'big'. This
+ *     is a hint about the largest value the field will store and determines
+ *     which of the database engine specific datatypes will be used (e.g. on
+ *     MySQL, TINYINT vs. INT vs. BIGINT). The default, 'normal', selects the
+ *     base type (e.g. on MySQL, INT, VARCHAR, BLOB, etc.). Not all sizes are
+ *     available for all data types. See DatabaseSchema::getFieldTypeMap() for
+ *     possible combinations.
+ *   - not null: If true, no NULL values will be allowed in this database
+ *     column. Defaults to FALSE.
+ *   - default: The field's default value. The PHP type of the value matters:
+ *     '', '0', and 0 are all different. If you specify '0' as the default
+ *     value for a type 'int' field it will not work because '0' is a string
+ *     containing the character "zero", not an integer.
+ *   - length: The maximal length of a type 'char', 'varchar' or 'text' field.
+ *     Ignored for other field types.
+ *   - unsigned: A boolean indicating whether a type 'int', 'float' and
+ *     'numeric' only is signed or unsigned. Defaults to FALSE and is ignored
+ *     for other field types.
+ *   - precision: For type 'numeric' fields, indicates the precision (total
+ *     number of significant digits).  Both 'precision' and 'scale' are
+ *     mandatory for 'numeric' fields and ignored by other field types.
+ *   - scale: For type 'numeric' fields, indicates scale (decimal digits right
+ *     of the decimal point).  Both 'precision' and 'scale' are  mandatory for
+ *     'numeric' fields and ignored by other field types.
+ *     All parameters apart from 'type' are optional except that type 'numeric'
+ *     columns must specify 'precision' and 'scale'.
+ * - primary key: An array of one or more key column specifiers (see below) that
+ *   form the primary key.
+ * - unique keys: An associative array of unique keys ('keyname' =>
+ *   specification). Each specification is an array of one or more key column
+ *   specifiers (see below) that form a unique key on the table.
+ * - foreign keys: An associative array of relations ('my_relation' =>
+ *   specification). Each specification is an array containing the name of the
+ *   referenced table ('table'), and an array of column mappings ('columns').
+ *   Column mappings are defined by key pairs ('source_column' =>
+ *   'referenced_column').
+ * - indexes:  An associative array of indexes ('indexname' => specification).
+ *   Each specification is an array of one or more key column specifiers (see
+ *   below) that form an index on the table.
  *
  * A key column specifier is either a string naming a column or an
  * array of two elements, column name and length, specifying a prefix
@@ -412,12 +409,11 @@ abstract class DatabaseSchema implements QueryPlaceholderInterface {
    *   This is most useful for creating NOT NULL columns with no default
    *   value in existing tables.
    * @param $keys_new
-   *   Optional keys and indexes specification to be created on the
-   *   table along with adding the field. The format is the same as a
-   *   table specification but without the 'fields' element. If you are
-   *   adding a type 'serial' field, you MUST specify at least one key
-   *   or index including it in this array. See db_change_field() for more
-   *   explanation why.
+   *   (optional) Keys and indexes specification to be created on the table
+   *   along with adding the field. The format is the same as a table
+   *   specification but without the 'fields' element. If you are  adding a type
+   *   'serial' field, you MUST specify at least one key or index including it
+   *   in this array. See db_change_field() for more explanation why.
    *
    * @throws DatabaseSchemaObjectDoesNotExistException
    *   If the specified table doesn't exist.
@@ -626,9 +622,9 @@ abstract class DatabaseSchema implements QueryPlaceholderInterface {
    * @param $spec
    *   The field specification for the new field.
    * @param $keys_new
-   *   Optional keys and indexes specification to be created on the
-   *   table along with changing the field. The format is the same as a
-   *   table specification but without the 'fields' element.
+   *   (optional) Keys and indexes specification to be created on the table
+   *   along with changing the field. The format is the same as a table
+   *   specification but without the 'fields' element.
    *
    * @throws DatabaseSchemaObjectDoesNotExistException
    *   If the specified table or source field doesn't exist.
@@ -689,7 +685,7 @@ abstract class DatabaseSchema implements QueryPlaceholderInterface {
    * @param $comment
    *   The comment string to prepare.
    * @param $length
-   *   Optional upper limit on the returned string length.
+   *   (optional) Upper limit on the returned string length.
    *
    * @return
    *   The prepared comment.
-- 
1.7.6.msysgit.0

