dns3l / dns3l-core

Core functionality of dns3l written in Go
1 stars 3 forks source link

SQL schema bootstrapping fails on @@SQL_MODE #40

Closed iaean closed 1 year ago

iaean commented 1 year ago

For MariaDB instances with default

@@SQL_MODE = STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

bootstrapping via dbcreate is failing here:

https://github.com/dns3l/dns3l-core/blob/4ca3864663dd2b322d7e7ae4651b62a28f2f1c2a/state/init.go#L66

with panic: Error 1067: Invalid default value for 'next_renewal_time'.

Maybe the most restrictive @@SQL_MODE setting that supports the bootstrapping sequence should be injected.

https://mariadb.com/kb/en/sql-mode/