View Issue Details

IDProjectCategoryView StatusLast Update
0006888OXID eShop (all versions)4.01. Database handlingpublic2020-05-25 12:16
Reporterdirkbaumeister 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionreopened 
Product Version6.1.0 
Target VersionFixed in Version6.2.0-beta.1 
Summary0006888: Wrong default value of columns is read on mariadb 10.2.7 and higher
DescriptionDue to a change in mariadb 10.2.7 ( https://mariadb.com/kb/en/library/mariadb-1027-release-notes/ , MDEV-13132 ) now empty default values (no value, not null) are quoted. This leads to unexpected behaviour while reading the default value of a column by the oxid shop.

In our test-installation, for example, this leads to oxparentid fields in the oxarticles table which are filled with '' (two single quotes) instead of nothing. Every field that is empty but not null is affected by this problem.

This problem seems to be in the class Database (Core\Database\Adapter\Doctrine\Database) in the method metaColumns($table):

Here is checked if the column has a default value by the syntax:

('' === $default || is_null($default))

Obviously this will not work if the field has the default value ''.
Steps To Reproduce- Install oxid with mariadb database version 10.2.7 or higher.
- Create an article in the backend (It will disappear due to filled oxparentid field after save).
- Now inspect the entry in the oxarticles table. It should have a '' in several fields.
- If you look up the columns of the oxarticles table, for example, in the table COLUMNS in the information_schema you will see that the default value for empty fields is ''.
Additional InformationTested Versions: OXID 6.0.3 and OXID 6.1.0 (I think every version of OXID 6)
TagsNo tags attached.
ThemeNot defined
BrowserNot defined
PHP Version7.0
Database VersionOther

Relationships

related to 0006914 resolvedanton.fedurtsya Incorrect default values from database-columns, if empty 

Activities

QA

2018-08-17 12:57

administrator   ~0012585

MariaDB isn't officially supported by OXID eShop. You can find the system requirements in our docs:
https://docs.oxid-esales.com/eshop/de/6.1/installation/neu-installation/server-und-systemvoraussetzungen.html

Nevertheless, if you want, you might create a pull request at our oxideshop_ce repository on GitHub:
https://github.com/OXID-eSales/oxideshop_ce

[sp]

QA

2020-05-25 12:16

administrator   ~0013241

https://github.com/OXID-eSales/oxideshop_ce/blob/v6.5.5/CHANGELOG.md#fixed-5
https://github.com/OXID-eSales/oxideshop_ce/pull/709
-MK