Budibase / budibase

Low code platform for building business apps and workflows in minutes. Supports PostgreSQL, MySQL, MariaDB, MSSQL, MongoDB, Rest API, Docker, K8s, and more 🚀
https://budibase.com
Other
22.75k stars 1.57k forks source link

MariaDB throwns an error when relationships are added via the builder `Cannot convert undefined or null to object` #14740

Closed ConorWebb96 closed 1 month ago

ConorWebb96 commented 1 month ago

Checklist

Hosting

Describe the bug An error is thrown when trying to add relationships via the Budibase builder to rows after configuring a relationship. Cannot convert undefined or null to object. This prevents the relationship between the two tables from happening.

To Reproduce Steps to reproduce the behavior:

  1. Import the app below
  2. Import the schema below
  3. Change the connection configuration in Budibase to match where you are hosting your MariaDB
  4. Try and add a relationship on the job table
  5. Notice it will remove the relationship between the two tables
  6. Keep trying; eventually, you will see the error listed above

Expected behavior This should work the same way it would if you improved this schema into a MySQL server where the relationships work and no error is thrown when linking relationships together.

Screenshots

Screenshot 2024-10-09 at 09 36 32

App Export Schema

CREATE TABLE `Feature` (
  `feature_id` int(11) NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `creator` varchar(100) DEFAULT NULL,
  `modifier` varchar(100) DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `is_required` bit(1) DEFAULT NULL,
  `job_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`feature_id`),
  KEY `job_id` (`job_id`),
  CONSTRAINT `Feature_ibfk_1` FOREIGN KEY (`job_id`) REFERENCES `Job` (`job_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `Job` (
  `job_id` int(11) NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `creator` varchar(100) DEFAULT NULL,
  `name` varchar(100) NOT NULL,
  `group_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`job_id`),
  UNIQUE KEY `unique_name_group` (`group_id`,`name`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO `Feature` (`feature_id`, `created_at`, `updated_at`, `creator`, `modifier`, `name`, `is_required`, `job_id`) VALUES
(1, '2024-10-05 14:00:00', '2024-10-09 08:30:52', 'admin1', NULL, 'Wood Type', b'1', 3),
(2, '2024-10-06 15:30:00', '2024-10-09 08:30:51', 'admin2', NULL, 'Paint Color', b'0', 3),
(3, '2024-10-07 16:45:00', '2024-10-09 08:27:45', 'admin3', NULL, 'Wire Gauge', b'1', NULL);

INSERT INTO `Job` (`job_id`, `created_at`, `updated_at`, `creator`, `name`, `group_id`) VALUES
(1, '2024-10-01 10:30:00', '2024-10-01 10:30:00', 'admin1', 'Carpentry', 1),
(2, '2024-10-02 11:00:00', '2024-10-02 11:00:00', 'admin2', 'Painting', 1),
(3, '2024-10-03 09:15:00', '2024-10-03 09:15:00', 'admin3', 'Electrical Work', 2);

App export MariaDb-export-1728463110093.tar.gz

linear[bot] commented 1 month ago

BUDI-8711 MariaDB throwns an error when relationships are added via the builder `Cannot convert undefined or null to object`

ConorWebb96 commented 1 month ago

Duplicate of https://github.com/Budibase/budibase/issues/14747