neos / neos-development-collection

The unified repository containing the Neos core packages, used for Neos development.
https://www.neos.io/
GNU General Public License v3.0
258 stars 221 forks source link

Check database platform and version in adapters #4337

Open mhsdesign opened 1 year ago

mhsdesign commented 1 year ago

See slack, where i was confused, why the doctrine:migrate would run through because:

An exception occurred while executing 'CREATE TABLE neos_neos_projection_asset_usage...

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 3072 bytes

i found out, that mariadb 10.3 is to old and it works with mariadb 10.4 after upgrading

https://neos-project.slack.com/archives/C3MCBK6S2/p1686684718496799

we should also enforce thoses constraints somehow - no? Or throw a nice error message :P

Related: #4434

crydotsnake commented 1 year ago

Which part of the core could be responsible/taking care for that?

mhsdesign commented 1 year ago

Thats a tricky problem, because as far as i understand it can just depend on the sql features we are using (the migrations)

So maybe the easiest is to enhance a doctrine migrate error with a note that your current db version is maybe to less?

crydotsnake commented 1 year ago

So maybe the easiest is to enhance a doctrine migrate error with a note that your current db version is maybe to less?

Sounds good. But how do we check which mariadb is installed on the specific system?

mhsdesign commented 1 year ago

Idk but this information should be available. You can ask the connection and SELECT VERSION or sth idk. But i feel like we should still have a constraint. Like each package can declare it only works with Mariadb or Mysql or Postgres bla, and flow will validate this. Wdyt @kitsunet ?

bwaidelich commented 1 year ago

I took the freedom to rename this issue so that it can act as a replacement for #4435 – I also added it to the project board and prioritized it

kitsunet commented 9 months ago

\Doctrine\DBAL\Connection::getServerVersion() is probably our ticket here

mhsdesign commented 9 months ago

Yes that seems like it, but as far as i know there is no way of knowing except with testing if a maria or mysql version would work. Should we just set a sane limit like mariadb 10.4 (as i tested 10.3 which failed?) Then we have to find out which mysql version would work, ive heard we need 8 and that we can validate in the neos/setup

bwaidelich commented 9 months ago

MySQL versions can be easily tested on Macs thanks to https://dbngin.com/

kitsunet commented 9 months ago

https://docs.neos.io/guide/installation-development-setup/system-requirements#database

has some infos on that, I assume no compressed row format enabled for you.

I guess 10.4 / 8.0 is fine...

mhsdesign commented 9 months ago

yes well these informations might be outdated if someone felt like using a never db feature. But i think enforcing this in the setup is important so people now whats wrong.

mhsdesign commented 3 months ago

i updated to maria db 11.0 but Bernhard could confirm that 10.6 also supports all the required features.