Browse Source

fix: add proper comment for MariaDB fix

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/4900/head
mertmit 2 years ago
parent
commit
15fd97671d
  1. 5
      packages/nocodb/src/lib/db/sql-client/lib/mysql/MysqlClient.ts

5
packages/nocodb/src/lib/db/sql-client/lib/mysql/MysqlClient.ts

@ -671,6 +671,11 @@ class MysqlClient extends KnexClient {
column.cdf = response[0][i].cdf; column.cdf = response[0][i].cdf;
} }
// Reference: https://github.com/nocodb/nocodb/issues/4625
// There is an information_schema difference on MariaDB and MySQL
// while MySQL keeps NULL as default value if no value provided
// MariaDB keeps NULL as string (if you provide a string NULL it is wrapped by single-quotes)
// so we check if database is MariaDB and if so we convert the string NULL to null
if (this._version?.version) { if (this._version?.version) {
if (this._version.version.includes('Maria')) { if (this._version.version.includes('Maria')) {
if (column.cdf === 'NULL') { if (column.cdf === 'NULL') {

Loading…
Cancel
Save