Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

chengxip's avatar

database null value become NULL string in model result

After migrating to MariaDB 10.2.10

The data fetching from database where null value become NULL string

after name: "NULL",

before

name: "",

after some googling .. it's related to

MDEV-13132: Literals in the COLUMN_DEFAULT column in the Information Schema COLUMNS table are now quoted to distinguish them from expressions.

https://mariadb.com/kb/en/library/mariadb-1027-release-notes/

not sure if this can be fixed from laravel side or already got fixed ? I'm currently using laravel 5.4.

Thanks.

0 likes
1 reply
bobbybouwmann's avatar

Yes this is already fixed in the doctrine layer which should be updated in your project.

If you use the latest Laravel it should already be fixed for quite some time! However if you want it to be fixed in your PHP version you either need to update doctrine/dbal to a newer version!

Source: https://github.com/doctrine/dbal/pull/2825

Note: I'm not sure if this will work, but I expect it to work! Also never just update your database server without testing! As you see it might give errors!

Please or to participate in this conversation.