Skip to:
Content

BuddyPress.org

Opened 5 months ago

Closed 3 months ago

#9261 closed defect (bug) (fixed)

MySQL: error when creating invitations API tables

Reported by: espellcaste's profile espellcaste Owned by: espellcaste's profile espellcaste
Milestone: 15.0.0 Priority: normal
Severity: normal Version: 5.0.0
Component: Friends Keywords:
Cc:

Description

It seems there is an issue when trying to install the Invitations API tables and the project uses mysql 8+ (I confirmed here with MySQL 8.4).

Here is the following error:

WordPress database error BLOB, TEXT, GEOMETRY or JSON column 'content' can't have a default value for query ALTER TABLE wp_bp_invitations ALTER COLUMN `content` SET DEFAULT '' made by

Specifically, this function bp_core_install_invitations. See code here.

After a bit of research, it seems that MySQL 8.0+ doesn't accept a string as the default value anymore.

See https://stackoverflow.com/questions/3466872/why-cant-a-text-column-have-a-default-value-in-mysql

See https://dev.mysql.com/doc/refman/8.0/en/data-type-defaults.html#data-type-defaults-explicit

Change History (1)

#1 @espellcaste
3 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 14100:

MySQL: fix an error when creating the invitations API tables.

MySQL 8+ introduced a change where it no longer accepts a string as the default value for the TEXT data type. A literal default needs to be specified as expression instead.

To avoid breaking back-compat, we will default the data type to NULL, similar to how we do it in similar schema deta types in BuddyPress.

Fixes #9261
See https://github.com/buddypress/wp-cli-buddypress/pull/113

Note: See TracTickets for help on using tickets.