View Issue Details

IDProjectCategoryView StatusLast Update
0007806OXID eShop (all versions)4.01. Database handlingpublic2025-07-03 17:07
Reporterkjunker Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
Product Version6.5.3 
Summary0007806: Default Value Timestamp is invalid
DescriptionOXID eShop CE/PE/EE v6.x (confirmed with v6.14.1)
MySQL 5.7.4x+

Environment:
MySQL 5.7.44 (default SQL mode includes NO_ZERO_DATE, STRICT_TRANS_TABLES)

OXID eShop's database schema defines several TIMESTAMP columns with NOT NULL DEFAULT '0000-00-00 00:00:00', which was compatible with MySQL 5.6. Starting from MySQL 5.7, this default value is disallowed when NO_ZERO_DATE is active (default setting), resulting in failing INSERT statements if those fields are omitted.

A typical example is the OXACTIVEFROM column in the oxarticles table:
`OXACTIVEFROM` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
Steps To ReproduceRunning a simple INSERT without explicitly setting any column with the described DEFAULT Value fails:
INSERT INTO oxarticles (oxid) SELECT UUID();
[2025-07-03 15:56:44] [22001][1292] Data truncation: Incorrect datetime value: '0000-00-00 00:00:00' for column 'OXACTIVEFROM' at row 1
Additional InformationRoot Cause:
MySQL 5.7 (and higher) treats '0000-00-00 00:00:00' as an invalid value for DATETIME/TIMESTAMP fields when NO_ZERO_DATE is enabled.
This was permitted in MySQL 5.6, so existing schema definitions and queries silently relied on this.

Potential Impact on OXID:
- Setup fails on clean installations with MySQL 5.7+
- Inserts into affected tables fail unless workarounds are applied
- Breaking change for hosting environments that upgraded MySQL versions
- Limits compatibility with MySQL 5.7+ and newer (including MariaDB forks that follow this rule)

Recommended Solutions:
Update all affected TIMESTAMP columns (e.g., in oxarticles, oxorder, oxuser, etc.) to use a valid default, such as:

`OXACTIVEFROM` TIMESTAMP NOT NULL DEFAULT '1970-01-01 00:00:01'
TagsNo tags attached.
ThemeNot defined
BrowserNot defined
PHP Version8.1
Database VersionMySQL 5.7

Activities

There are no notes attached to this issue.