[Tickets #15172] Re: 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

noreply at bugs.horde.org noreply at bugs.horde.org
Sat Mar 7 20:17:20 UTC 2026


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: https://bugs.horde.org/ticket/15172
------------------------------------------------------------------------------
  Ticket              | 15172
  Updated By          | Git Commit <commits at lists.horde.org>
  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
  Version             | FRAMEWORK_6_0
  Type                | Bug
  State               | Resolved
  Priority            | 2. Medium
  Github Issue Link   |
  Github Pull Request |
  Milestone           |
  Patch               |
  Owners              | Horde Developers, Ralf Lang
------------------------------------------------------------------------------


Git Commit <commits at lists.horde.org> (2026-03-07 20:17) wrote:

Changes have been made in Git (FRAMEWORK_6_0):

commit 92ada4983862eb8cc2bab76b63a8cf2ea7d71c87
Author: Ralf Lang <ralf.lang at 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





More information about the bugs mailing list