View Revisions: Issue #6701

Summary 0006701: Support UUID column types for MariaDB
Revision 2025-01-16 19:29 by pmarzullo
Description The UUID column type for MariaDB (and I am assuming MySQL) can be synchonized to a target system successfully, especially if it is a target MariaDB database.

But, SymmetricDS considers a UUID column type to be a LONGVARCHAR in a general sense.
That means that if the UUID column type is part of the primary key, then the synching of the DDL to the target will not include the UUID column as part of the primary key because a LONGVARCHAR can not be part of a primary key because of the limitation of the number of characters that can be part of an index, which is the implementation of the primary key constraint.

The representation of a UUID data type in MariaDB is a 32 character hexadeciimal string representation, with 4 strategically placed dashes (-) to match the format of a UUID format. So a total of 36 characters make up the representation of the UUID value.

This should allow SymmetricDS to consider that the UUID data type can be represented by a VARCHAR value, hence allowing the use of a UUID data type as part of the primary key.

Example UUID values:
067e5909-d440-11ef-89b9-0242ac110002
07e5243d-d440-11ef-89b9-0242ac110002
123e4567-e89b-12d3-a456-426655440000
ff5b6bcc-1a14-11ec-ab4e-f859713e4be4
ffffffff-ffff-ffff-ffff-fffffffffffe
Revision 2025-01-16 21:02 by pmarzullo
Description The UUID column type for MariaDB (and I am assuming MySQL) can be synchonized to a target system successfully, especially if it is a target MariaDB database.

But, SymmetricDS considers a UUID column type to be a LONGVARCHAR in a general sense.
That means that if the UUID column type is part of the primary key, then the synching of the DDL to the target will not include the UUID column as part of the primary key because a LONGVARCHAR can not be part of a primary key because of the limitation of the number of characters that can be part of an index, which is the implementation of the primary key constraint.

The representation of a UUID data type in MariaDB is a 32 character hexadeciimal string representation, with 4 strategically placed dashes (-) to match the format of a UUID format. So a total of 36 characters make up the representation of the UUID value.

This should allow SymmetricDS to consider that the UUID data type can be represented by a VARCHAR value, hence allowing the use of a UUID data type as part of the primary key.

Example UUID values:
INSERT INTO t1 VALUES('123e4567-e89b-12d3-a456-426655440000');
INSERT INTO t1 VALUES (x'fffffffffffffffffffffffffffffffe');
INSERT INTO t1 VALUES (UUID());
INSERT INTO t1 VALUES (SYS_GUID());
INSERT INTO t1 VALUES ('ff5b6bcc1a1411ecab4ef859713e4be4');
select * from t1;
067e5909-d440-11ef-89b9-0242ac110002
07e5243d-d440-11ef-89b9-0242ac110002
123e4567-e89b-12d3-a456-426655440000
ff5b6bcc-1a14-11ec-ab4e-f859713e4be4
ffffffff-ffff-ffff-ffff-fffffffffffe