Skip to content

silent data loss for pads above 64KB on MySQL/MariaDB #521

Closed
@ccoenen

Description

@ccoenen

Problem

Pads above 64KB get truncated silently (on MySQL / Mariadb)
The same is true for their revisions.

Desired Solution (Preferred)

The Field should deal with larger Texts. 64KB is not extremely much (though it is quite long). MEDIUMTEXT (16MB) or LONGTEXT (4GB) would give the user more headroom.

Desired Solution (Additionally)

The editor should warn in case of data loss, regardless of where the limit lies.

Problem source

content is Sequelize.TEXT.

This becomes

MariaDB [hackmd]> show fields from Notes;
+------------------+----------------------------------------------+------+-----+---------+-------+
| Field            | Type                                         | Null | Key | Default | Extra |
+------------------+----------------------------------------------+------+-----+---------+-------+
| id               | char(36)                                     | NO   | PRI |         |       |
| shortid          | varchar(255)                                 | NO   | UNI | NULL    |       |
| alias            | varchar(255)                                 | YES  | UNI | NULL    |       |
| permission       | enum('freely','editable','locked','private') | YES  |     | NULL    |       |
| viewcount        | int(11)                                      | NO   |     | 0       |       |
| title            | text                                         | YES  |     | NULL    |       |
| content          | text                                         | YES  |     | NULL    |       | <----
| authorship       | text                                         | YES  |     | NULL    |       |
| lastchangeAt     | datetime                                     | YES  |     | NULL    |       |
| savedAt          | datetime                                     | YES  |     | NULL    |       |
| createdAt        | datetime                                     | NO   |     | NULL    |       |
| updatedAt        | datetime                                     | NO   |     | NULL    |       |
| deletedAt        | datetime                                     | YES  |     | NULL    |       |
| ownerId          | char(36)                                     | YES  |     | NULL    |       |
| lastchangeuserId | char(36)                                     | YES  |     | NULL    |       |
+------------------+----------------------------------------------+------+-----+---------+-------+
15 rows in set (0.00 sec)

MySQL text (no surprise here).

TEXT types in combination with Storage Requirements leads me to believe that TEXT is 2^16 bytes large - or ~64KB.

Metadata

Metadata

Assignees

Labels

HacktoberfestbugSomething isn't workingdatabase/sequelizeSomehow this is related to the database or ORM

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions