Page MenuHomePhabricator
Paste P7068

(An Untitled Masterwork)
ActivePublic

Authored by MarcoAurelio on May 2 2018, 8:19 PM.
Tags
None
Referenced Files
F17603491:
May 2 2018, 8:19 PM
Subscribers
MariaDB [metawiki_p]> describe user;
+--------------------------+-----------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------------------+-----------------+------+-----+---------+-------+
| user_id | int(5) unsigned | NO | | 0 | |
| user_name | varbinary(255) | NO | | | |
| user_real_name | varbinary(255) | NO | | | |
| user_password | binary(0) | YES | | NULL | |
| user_newpassword | binary(0) | YES | | NULL | |
| user_email | binary(0) | YES | | NULL | |
| user_options | binary(0) | YES | | NULL | |
| user_touched | binary(0) | YES | | NULL | |
| user_token | binary(0) | YES | | NULL | |
| user_email_authenticated | binary(0) | YES | | NULL | |
| user_email_token | binary(0) | YES | | NULL | |
| user_email_token_expires | binary(0) | YES | | NULL | |
| user_registration | varbinary(14) | YES | | NULL | |
| user_newpass_time | binary(0) | YES | | NULL | |
| user_editcount | int(11) | YES | | NULL | |
| user_password_expires | binary(0) | YES | | NULL | |
+--------------------------+-----------------+------+-----+---------+-------+
16 rows in set (0.00 sec)

Event Timeline

20:18 <Hauskatze> jynus: when I use "describe user" on metawiki_p, the user_editcount field says it's NULLed, but in fact it's not, and should not
20:19 <Hauskatze> https://phabricator.wikimedia.org/P7068

The default value being NULL has nothing to do with us NULLing some fields that are privacy-sensitive. The default value is used when I do something like INSERT INTO user (user_id, user_name,user_real_name) VALUES (15, 'eddiegp', 'Eddie Greiner-Petter'). Because I didn't specify values for user_password, user_newpassword, user_email, ... these fields get the respective "default value" for that column - which is NULL.

Does the same apply to the Null field too, @EddieGP ?

I'm not sure what that sentence means ("the Null field" is a bit ambiguous). If you're refering to the integer "0" for user_id, yes, it works the same way (if no user id is specified, 0 will be used).

At the very top of the table there's a Null column. Does your explanation aply to that column as well? Because obviously user_editcount is queriable and not nulled in our replicas as it doesn't contain any private data. Thanks.

Each column in the "user" table is a row in the "describe user" view. The column "Null" in the "describe user" view above describes whether the respective column in the "user" table is allowed to have NULL as a value. It says nothing about whether we're nulling it on the cloud replicas for privacy reasons. You cannot see that from the "describe user" view at all.