Skip to content

Conversation

@bbernays
Copy link
Collaborator

Summary

Currently when CQ is syncing to MySQL the query to get all tables returns tables in ALL schemas, not just the schema that the user specified in the connection string. This means that if a user is syncing data from the same plugin multiple times to different schemas the finding tables function will never be able to tell the difference between the same table name in different schemas...

The fix is to only return tables from the current database if it is selected... Users that do not specify a default database in their DSN/connection string will continue to have issues though... In a following PR we should add in validation that will require a default DB select database() should return a value that is not null...

@bbernays bbernays requested review from a team and hermanschaaf and removed request for a team June 28, 2023 16:40
@cq-bot cq-bot added the mysql label Jun 28, 2023
@bbernays bbernays linked an issue Jun 28, 2023 that may be closed by this pull request
2 tasks
Copy link
Member

@disq disq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved in principle :)

@bbernays bbernays added the automerge Automatically merge once required checks pass label Jun 28, 2023
@kodiakhq kodiakhq bot merged commit ab8b39d into cloudquery:main Jun 28, 2023
@bbernays bbernays deleted the fix-mysql branch June 28, 2023 16:59
kodiakhq bot pushed a commit that referenced this pull request Jun 28, 2023
🤖 I have created a release *beep* *boop*
---


## [2.2.2](plugins-destination-mysql-v2.2.1...plugins-destination-mysql-v2.2.2) (2023-06-28)


### Bug Fixes

* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to 0656028 ([#11739](#11739)) ([7a6ad49](7a6ad49))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to 1e68c51 ([#11637](#11637)) ([46043bc](46043bc))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to 43638cb ([#11672](#11672)) ([3c60bbb](3c60bbb))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to 4d76231 ([#11532](#11532)) ([6f04233](6f04233))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to 8366a22 ([#11717](#11717)) ([8eeff5b](8eeff5b))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to 95d3199 ([#11708](#11708)) ([03f214f](03f214f))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to b0832be ([#11651](#11651)) ([71e8c29](71e8c29))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to d864719 ([#11611](#11611)) ([557a290](557a290))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to f060192 ([#11730](#11730)) ([c7019c2](c7019c2))
* **deps:** Update github.com/cloudquery/arrow/go/v13 digest to f0dffc6 ([#11689](#11689)) ([18ac0e9](18ac0e9))
* **deps:** Update module github.com/cloudquery/plugin-pb-go to v1.1.0 ([#11665](#11665)) ([d8947c9](d8947c9))
* **deps:** Update module github.com/cloudquery/plugin-pb-go to v1.2.0 ([#11720](#11720)) ([7ef521d](7ef521d))
* **deps:** Update module github.com/cloudquery/plugin-pb-go to v1.2.1 ([#11722](#11722)) ([309be72](309be72))
* **deps:** Update module github.com/cloudquery/plugin-pb-go to v1.3.3 ([#11726](#11726)) ([f0ca611](f0ca611))
* **deps:** Update module github.com/cloudquery/plugin-pb-go to v1.3.4 ([#11753](#11753)) ([cd4fe1c](cd4fe1c))
* **deps:** Update module github.com/cloudquery/plugin-sdk/v3 to v3.10.6 ([#11473](#11473)) ([7272133](7272133))
* **mysql:** Handle Multiple Schemas ([#11799](#11799)) ([ab8b39d](ab8b39d))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Automatically merge once required checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug (destination plugin mysql): Unknown table when migrating

3 participants