Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema merge conflict when there should be a clean schema merge #8134

Open
timsehn opened this issue Jul 18, 2024 · 0 comments
Open

Schema merge conflict when there should be a clean schema merge #8134

timsehn opened this issue Jul 18, 2024 · 0 comments
Labels
enhancement New feature or request merge Issues relating to merge version control

Comments

@timsehn
Copy link
Sponsor Contributor

timsehn commented Jul 18, 2024

schema_conflicts/main> call dolt_merge('add-units');
+------+--------------+-----------+-----------------+
| hash | fast_forward | conflicts | message         |
+------+--------------+-----------+-----------------+
|      | 0            | 1         | conflicts found |
+------+--------------+-----------+-----------------+
1 row in set (0.00 sec)

schema_conflicts/main*> select * from dolt_status;
+------------+--------+-----------------+
| table_name | staged | status          |
+------------+--------+-----------------+
| weights    | 0      | schema conflict |
+------------+--------+-----------------+
1 row in set (0.00 sec)

schema_conflicts/main*> select * from dolt_schema_conflicts;
+------------+-------------------------------------------------------------------+-------------------------------------------------------------------+-------------------------------------------------------------------+------------------------------------------------------------------+
| table_name | base_schema                                                       | our_schema                                                        | their_schema                                                      | description                                                      |
+------------+-------------------------------------------------------------------+-------------------------------------------------------------------+-------------------------------------------------------------------+------------------------------------------------------------------+
| weights    | CREATE TABLE `weights` (                                          | CREATE TABLE `weights` (                                          | CREATE TABLE `weights` (                                          | incompatible column types for column 'weight': Float32 and Int32 |
|            |   `id` int NOT NULL,                                              |   `id` int NOT NULL,                                              |   `id` int NOT NULL,                                              |                                                                  |
|            |   `weight` int,                                                   |   `weight` float,                                                 |   `weight` int,                                                   |                                                                  |
|            |   PRIMARY KEY (`id`)                                              |   PRIMARY KEY (`id`)                                              |   `units` varchar(10),                                            |                                                                  |
|            | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin; | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin; |   PRIMARY KEY (`id`)                                              |                                                                  |
|            |                                                                   |                                                                   | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin; |                                                                  |
+------------+-------------------------------------------------------------------+-------------------------------------------------------------------+-------------------------------------------------------------------+------------------------------------------------------------------+
1 row in set (0.00 sec)

The merge base and add-units branch both have int as their type for weight column. main should be free to change the type of weight because that column is not modified on add-units. Resulting schema should be:

CREATE TABLE `weights` ( 
`id` int NOT NULL,
`weight` float,
`units` varchar(10),
PRIMARY KEY (`id`) 
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin
@timsehn timsehn added enhancement New feature or request version control merge Issues relating to merge labels Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request merge Issues relating to merge version control
Projects
None yet
Development

No branches or pull requests

1 participant