[BUDI-7444] Queries use blank string instead of column default value when binding default value is empty #11629
Closed
1 task done
Labels
bb-bindings
bug
Something isn't working
env - production
Bug found in production
firestorm
Data/Infra/Revenue Team
linear
Medium priority
Created by Linear-GitHub Sync
Checklist
Hosting
I am using a MySQL 8.0.34 database and one of my tables has the following columns:
But when I create a query and try to insert, using the following SQL/handlebars:
INSERT INTO configs (type, customer_project_id, board_id, vendor_id, build_phase_id, cvl_id)
VALUES ( {{ type }}, {{ customer_project_id }}, {{ board_id}}, {{ vendor_id}}, {{ build_phase_id}}, {{ cvl_id}} );
and the following bindings:
I get an incorrect integer value error, as follows:
I am assuming this is happening because BudiBase is trying to insert an empty string to an int column, because I left some of the binding defaults blank. In my case, those columns are nullable and have a default value of NULL, but since BudiBase is trying to insert an empty string it is getting rejected. Is there any way to use NULL as a default value directly? Or more generally, can BudiBase use the column default value when there is no default value in the binding field?
Notably, BudiBase is able to save the row just fine (And use the column default value of NULL) when I use the 'Save Row' action instead to save this data, instead of building a query.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
When no default value is set in the bindings, and no data has been passed to the binding from the app, BudiBase will insert the column default value.
App Export
If possible - please attach an export of your budibase application for debugging/reproduction purposes.
Desktop (please complete the following information):
From SyncLinear.com | BUDI-7444
The text was updated successfully, but these errors were encountered: