Jump to content

Extension:GlobalBlocking/globalblocks table

From mediawiki.org

The globalblocks table stores global blocks that have not expired. These blocks can target IP addresses, IP ranges, and accounts.

This table is stored on a central DB. Since 1.43, updates to it are applied via update.php . For versions before 1.43, you need to apply the updates manually.

Fields

[edit]

gb_id

[edit]

Primary key

gb_address

[edit]

The target of the block. An IP address, IP range, or account.

gb_target_central_id

[edit]
MediaWiki version:
1.42

The central ID for the target of the block. 0 if the target is an IP address or IP range.

gb_by

[edit]
MediaWiki version:
1.43

The username of the performer of the global block.

gb_by_central_id

[edit]
MediaWiki version:
1.38

The central ID for the performer of the global block.

gb_by_wiki

[edit]

The wiki where the block was performed, used to provide a link to the performer of the block on another wiki.

gb_reason

[edit]

The reason for the global block, provided by the performer of the block.

gb_timestamp

[edit]

The timestamp the block was applied.

gb_anon_only

[edit]

Whether the global block only targets anon users

gb_create_account

[edit]
MediaWiki version:
1.43

Whether the global block prevents account creation.

gb_enable_autoblock

[edit]
MediaWiki version:
1.43

Whether the global block triggers global autoblocks.

gb_autoblock_parent_id

[edit]
MediaWiki version:
1.43

If null, then this is not an autoblock. If an integer, then this is an autoblock and the integer is the gb_id for the global block that caused this autoblock. This value is set for autoblocks to allow deleting the autoblock when the parent block is deleted.

gb_expiry

[edit]

The expiry timestamp for the block. Blocks can have an infinite expiry.

gb_range_start

[edit]

The first IP address in hexadecimal form for the range of IPs that is targeted by this block. For a block that targets a single IP this will be the same as gb_address but in hexadecimal form.

gb_range_end

[edit]

The last IP address in hexadecimal form for the range of IPs that is targeted by this block. For a block that targets a single IP this will be the same as gb_address but in hexadecimal form.

Schema summary

[edit]
MediaWiki version:
1.43

DESCRIBE globalblocks;

+------------------------+------------------+------+-----+---------+----------------+
| Field                  | Type             | Null | Key | Default | Extra          |
+------------------------+------------------+------+-----+---------+----------------+
| gb_id                  | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| gb_address             | varbinary(255)   | NO   | MUL | NULL    |                |
| gb_by_central_id       | int(10) unsigned | NO   |     | NULL    |                |
| gb_by_wiki             | varbinary(255)   | NO   |     | NULL    |                |
| gb_reason              | varbinary(767)   | NO   |     | NULL    |                |
| gb_timestamp           | binary(14)       | NO   | MUL | NULL    |                |
| gb_anon_only           | tinyint(1)       | NO   |     | 0       |                |
| gb_expiry              | varbinary(14)    | NO   | MUL | NULL    |                |
| gb_range_start         | varbinary(35)    | NO   | MUL | NULL    |                |
| gb_range_end           | varbinary(35)    | NO   |     | NULL    |                |
| gb_target_central_id   | int(10) unsigned | NO   | MUL | 0       |                |
| gb_create_account      | tinyint(1)       | NO   |     | 1       |                |
| gb_enable_autoblock    | tinyint(1)       | NO   |     | 1       |                |
| gb_autoblock_parent_id | int(10) unsigned | YES  | MUL | NULL    |                |
+------------------------+------------------+------+-----+---------+----------------+
MediaWiki version:
1.42

DESCRIBE globalblocks;

+----------------------+------------------+------+-----+---------+----------------+
| Field                | Type             | Null | Key | Default | Extra          |
+----------------------+------------------+------+-----+---------+----------------+
| gb_id                | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| gb_address           | varbinary(255)   | NO   | MUL | NULL    |                |
| gb_by                | varbinary(255)   | NO   |     |         |                |
| gb_by_central_id     | int(10) unsigned | NO   |     | NULL    |                |
| gb_by_wiki           | varbinary(255)   | NO   |     | NULL    |                |
| gb_reason            | varbinary(767)   | NO   |     | NULL    |                |
| gb_timestamp         | binary(14)       | NO   | MUL | NULL    |                |
| gb_anon_only         | tinyint(1)       | NO   |     | 0       |                |
| gb_expiry            | varbinary(14)    | NO   | MUL | NULL    |                |
| gb_range_start       | varbinary(35)    | NO   | MUL | NULL    |                |
| gb_range_end         | varbinary(35)    | NO   |     | NULL    |                |
| gb_target_central_id | int(10) unsigned | NO   | MUL | 0       |                |
+----------------------+------------------+------+-----+---------+----------------+


MediaWiki versions:
1.39 – 1.41

DESCRIBE globalblocks;

+----------------------+------------------+------+-----+---------+----------------+
| Field                | Type             | Null | Key | Default | Extra          |
+----------------------+------------------+------+-----+---------+----------------+
| gb_id                | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| gb_address           | varbinary(255)   | NO   | MUL | NULL    |                |
| gb_by                | varbinary(255)   | NO   |     |         |                |
| gb_by_central_id     | int(10) unsigned | NO   |     | NULL    |                |
| gb_by_wiki           | varbinary(255)   | NO   |     | NULL    |                |
| gb_reason            | varbinary(767)   | NO   |     | NULL    |                |
| gb_timestamp         | binary(14)       | NO   | MUL | NULL    |                |
| gb_anon_only         | tinyint(1)       | NO   |     | 0       |                |
| gb_expiry            | varbinary(14)    | NO   | MUL | NULL    |                |
| gb_range_start       | varbinary(35)    | NO   | MUL | NULL    |                |
| gb_range_end         | varbinary(35)    | NO   |     | NULL    |                |
| gb_target_central_id | int(10) unsigned | NO   | MUL | 0       |                |
+----------------------+------------------+------+-----+---------+----------------+

Indexes

[edit]
MediaWiki version:
1.43

SHOW INDEX IN globalblocks;

+--------------+------------+------------------------+--------------+------------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
| Table        | Non_unique | Key_name               | Seq_in_index | Column_name            | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Ignored |
+--------------+------------+------------------------+--------------+------------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
| globalblocks |          0 | PRIMARY                |            1 | gb_id                  | A         |           0 |     NULL | NULL   |      | BTREE      |         |               | NO      |
| globalblocks |          0 | gb_address             |            1 | gb_address             | A         |           0 |     NULL | NULL   |      | BTREE      |         |               | NO      |
| globalblocks |          0 | gb_address             |            2 | gb_anon_only           | A         |           0 |     NULL | NULL   |      | BTREE      |         |               | NO      |
| globalblocks |          1 | gb_range               |            1 | gb_range_start         | A         |           0 |     NULL | NULL   |      | BTREE      |         |               | NO      |
| globalblocks |          1 | gb_range               |            2 | gb_range_end           | A         |           0 |     NULL | NULL   |      | BTREE      |         |               | NO      |
| globalblocks |          1 | gb_timestamp           |            1 | gb_timestamp           | A         |           0 |     NULL | NULL   |      | BTREE      |         |               | NO      |
| globalblocks |          1 | gb_expiry              |            1 | gb_expiry              | A         |           0 |     NULL | NULL   |      | BTREE      |         |               | NO      |
| globalblocks |          1 | gb_target_central_id   |            1 | gb_target_central_id   | A         |           0 |     NULL | NULL   |      | BTREE      |         |               | NO      |
| globalblocks |          1 | gb_autoblock_parent_id |            1 | gb_autoblock_parent_id | A         |           0 |     NULL | NULL   | YES  | BTREE      |         |               | NO      |
+--------------+------------+------------------------+--------------+------------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
MediaWiki version:
1.42

SHOW INDEX IN globalblocks;

+--------------+------------+----------------------+--------------+----------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
| Table        | Non_unique | Key_name             | Seq_in_index | Column_name          | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Ignored |
+--------------+------------+----------------------+--------------+----------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
| globalblocks |          0 | PRIMARY              |            1 | gb_id                | A         |           0 |     NULL | NULL   |      | BTREE      |         |               | NO      |
| globalblocks |          0 | gb_address           |            1 | gb_address           | A         |           0 |     NULL | NULL   |      | BTREE      |         |               | NO      |
| globalblocks |          0 | gb_address           |            2 | gb_anon_only         | A         |           0 |     NULL | NULL   |      | BTREE      |         |               | NO      |
| globalblocks |          1 | gb_range             |            1 | gb_range_start       | A         |           0 |     NULL | NULL   |      | BTREE      |         |               | NO      |
| globalblocks |          1 | gb_range             |            2 | gb_range_end         | A         |           0 |     NULL | NULL   |      | BTREE      |         |               | NO      |
| globalblocks |          1 | gb_timestamp         |            1 | gb_timestamp         | A         |           0 |     NULL | NULL   |      | BTREE      |         |               | NO      |
| globalblocks |          1 | gb_expiry            |            1 | gb_expiry            | A         |           0 |     NULL | NULL   |      | BTREE      |         |               | NO      |
| globalblocks |          1 | gb_target_central_id |            1 | gb_target_central_id | A         |           0 |     NULL | NULL   |      | BTREE      |         |               | NO      |
+--------------+------------+----------------------+--------------+----------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
MediaWiki version:
1.41

SHOW INDEX IN globalblocks;

+--------------+------------+----------------------+--------------+----------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
| Table        | Non_unique | Key_name             | Seq_in_index | Column_name          | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Ignored |
+--------------+------------+----------------------+--------------+----------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
| globalblocks |          0 | PRIMARY              |            1 | gb_id                | A         |           0 |     NULL | NULL   |      | BTREE      |         |               | NO      |
| globalblocks |          0 | gb_address           |            1 | gb_address           | A         |           0 |     NULL | NULL   |      | BTREE      |         |               | NO      |
| globalblocks |          0 | gb_address           |            2 | gb_anon_only         | A         |           0 |     NULL | NULL   |      | BTREE      |         |               | NO      |
| globalblocks |          1 | gb_range             |            1 | gb_range_start       | A         |           0 |     NULL | NULL   |      | BTREE      |         |               | NO      |
| globalblocks |          1 | gb_range             |            2 | gb_range_end         | A         |           0 |     NULL | NULL   |      | BTREE      |         |               | NO      |
| globalblocks |          1 | gb_timestamp         |            1 | gb_timestamp         | A         |           0 |     NULL | NULL   |      | BTREE      |         |               | NO      |
| globalblocks |          1 | gb_expiry            |            1 | gb_expiry            | A         |           0 |     NULL | NULL   |      | BTREE      |         |               | NO      |
+--------------+------------+----------------------+--------------+----------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+