| Summary | mysql V 8.0.36: SQL QUERY FAILED: SQLSTATE[42000]: Syntax error or access violation: 1101 BLOB, TEXT, GEOMETRY or JSON column 'other_attributes' can't have a default value |
| Queue | Kronolith |
| Queue Version | FRAMEWORK_6_0 |
| Type | Bug |
| State | Resolved |
| Priority | 2. Medium |
| Owners | Horde Developers (at) , ralf.lang (at) ralf-lang (dot) de |
| Requester | mrch (at) mailbox (dot) org |
| Created | 9/26/24 (550 days ago) |
| Due | |
| Updated | 3/7/26 (23 days ago) |
| Assigned | 5/29/25 (305 days ago) |
| Resolved | 5/29/25 (305 days ago) |
| Github Issue Link | |
| Github Pull Request | |
| Milestone | |
| Patch | No |
commit 92ada4983862eb8cc2bab76b63a8cf2ea7d71c87
Author: Ralf Lang <ralf.lang@ralf-lang.de>
Date: Sat, 07 Mar 2026 21:17:07 +0100
feat(mysql): add TEXT/BLOB/JSON default value expression support
Port critical bug fix from lib/ (
Bug #15172) to src/. MySQL 8.0.13+requires TEXT, BLOB, JSON, and GEOMETRY column defaults to use
expression syntax: ('value') instead of 'value'.
Changes:
- Add filterDefault() method to Mysql/Schema to wrap defaults in
expression syntax for affected column types
- Update Base/Schema addColumnOptions() to detect and skip quoting
expression defaults (strings starting with "('\'' and ending "\')")
- Apply filter in makeColumn() when creating Column objects
- Apply filter in changeColumn() by passing $typeSql to addColumnOptions()
- Add 20 unit tests in SchemaDefaultsTest covering all column types
- Add 10 integration tests (requires MySQL 8.0.13+, currently skipped)
This prevents SQL syntax errors when setting defaults on TEXT/BLOB/JSON
columns in MySQL 8.0.13+ and MariaDB 10.2.1+.
Related: Tasks 1.1-1.6 from db-bug-fixes-todo.md
M src/Adapter/Base/Schema.php
M src/Adapter/Mysql/Schema.php
A test/Adapter/Mysql/ExpressionDefaultIntegrationTest.php
A test/Adapter/Mysql/SchemaDefaultsTest.php
https://github.com/horde/Db/commit/92ada4983862eb8cc2bab76b63a8cf2ea7d71c87
State ⇒ Resolved
commit 9b12019057d6b5dd3b9a488598256e554e77a136
Author: Ralf Lang <ralf.lang@ralf-lang.de>
Date: Thu, 29 May 2025 12:49:21 +0200
Release 3.0.0-alpha6 (API Version: 3.0.0-alpha1)
fix: Also apply defaults filter when changing an existing column's type
fix: Special case default field values must not be quoted if they are
expressions
feat: Optionally supply sqlType to addColumnOptions
fix:
#15172Add a filter to support column defaults on mysql >= 8.0.13for TEXT, BLOB and JSON format
M .horde.yml
M composer.json
M doc/changelog.yml
https://github.com/horde/Db/commit/9b12019057d6b5dd3b9a488598256e554e77a136
I don't have this in mariadb.
There's a workaround in mysql 8.0.13 and later by using an
expression rather than a literal as default for text and blob field.
We will build a patch based on this.
commit c2d525d02cb0a7c2f087e0c86f9728caf3e44816 (HEAD ->
FRAMEWORK_6_0, origin/HEAD, origin/FRAMEWORK_6_0)
Author: Ralf Lang <ralf.lang@ralf-lang.de>
Date: Thu May 29 11:08:19 2025 +0200
fix:
#15172Add a filter to support column defaults on mysql >=8.0.13 for TEXT, BLOB and JSON format
Will test if this is sufficient for nag and kronolith on this version of mysql
State ⇒ Assigned
Assigned to
Assigned to Ralf Lang
I don't have this in mariadb.
There's a workaround in mysql 8.0.13 and later by using an expression
rather than a literal as default for text and blob field. We will
build a patch based on this.
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ mysql V 8.0.36: SQL QUERY FAILED: SQLSTATE[42000]: Syntax error or access violation: 1101 BLOB, TEXT, GEOMETRY or JSON column 'other_attributes' can't have a default value
Queue ⇒ Kronolith
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
https://wiki.horde.org/Doc/Dev/H6/Installation/InstallBase?referrer=Doc%2FDev%2FH6%2FInstallation
The execution of
http://192.168.122.5/horde/admin/config/?app=kronolith&action=schema
throws the above error.
The schema remains without update.
IMHO the problem seems to be located in
/var/www/html/horde/vendor/horde/kronolith/migration/28_kronolith_icalendar_storage.php
line 46.
IMHO related to:
https://www.percona.com/blog/cant-we-assign-a-default-value-to-the-blob-text-geometry-and-json-data-types/