MySql node - Inserting NULL in MariaDB

Greetings,

I’m trying to insert null values into my MariaDB using MySQL node. I need to use Execute SQL mode so I can call functions inside my db and do verifications in case of a update, for example IFNULL.

There is no error message, the issue is that on Upsert Mode, I can’t call functions. On Execute SQL mode, the data sent as null is not recognized as null.

On my sql node you might notice I’m doing a ternary that will either insert the value or ‘’, but I tried null, ‘null’, ‘’, “”, all with and without using the option Replace Empty Strings with NULL. And it always input as empty string on my db.

I also checked on my db and not only it accepts null on all columns it is also defaults to null.

Information on your n8n setup

  • n8n version: 1.53.2
  • Database: MariaDB
  • n8n EXECUTIONS_PROCESS setting: Not sure where I can find this info, but should be default.
  • Running n8n via : npm, managed in pm2, self-hosted
  • Operating system: Ubuntu 22.04.4

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

I’m pretty sure SQL Node have an issue when using parameterized queries, as it fails to parse the correct type unto the sql query.

To solve my case I ended up using procedures in my db, skipping the usage of parameters.

Hi @GabrielBackend,

I can reproduce this issue and this looks like a bug, will report this internally and keep you posted - thanks for posting :four_leaf_clover:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.