Closed Ampsyy closed 1 month ago
@airbytehq/destinations can someone take a look on this? MySQL is a community connector but def this can be relevant for other destinations too.
@Ampsyy can you please include the full sync log? Also, which source are your using?
@evantahler Attached is the exported sync logs, I'm syncing from a MSSQL server (source-mssql).
To note I've also tried syncing the same source to another MySQL server (one which has 'sql_require_primary_key' set to OFF) and it works great.
aha, this is the _airbyte_destination_state
table. I think you can just create that manually with a composite PK on the name
+namespace
columns:
create table airbyte_internal._airbyte_destination_state
name varchar,
namespace varchar,
destination_state varchar,
updated_at datetime,
PRIMARY KEY (name, namespace)
I did try to create the table manually on my destination MySQL which has primary keys disabled but added an Id column and made that the PK. When the sync ran it seemed to update the table and remove the Id column along with the PK.
I'll try creating and setting the name and namespace as the PK
Yeah, we do mange the columns on that table, but having an extra index should be OK
Thanks all! Resolved the issue running the following to create the table:
CREATE TABLE `_airbyte_destination_state` (
`name` varchar(255) NOT NULL,
`namespace` varchar(255) NOT NULL,
`destination_state` varchar(255) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`name`,`namespace`)
);
Connector Name
destination-mysql
Connector Version
1.0.0
What step the error happened?
During the sync
Relevant information
Hi,
Installed AirByte today to allow us to replicate data from MSSQL to MySQL, have
been
able to setup both connectors successfully however when trying to perform a sync between them. I receive the following from the destination:java.util.concurrent.CompletionException: java.lang.RuntimeException: java.sql.SQLException: Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.
It seems to be: airbyte_internal._airbyte_destination_state that causes the issue.
Our MySQL server has 'sql_require_primary_key' set to ON which we cannot turn off due to other processes requiring it to be enabled.
Relevant log output
Contribute