Open dartartem opened 3 years ago
Tests on mysql8 also fail.
For now made this obvious change, it fixes the issue: https://gist.github.com/dartartem/db9aca1d275e8dc489dbb596643c3286
It just ignores if there are several PKs with the same name.
All mysql tests pass.
Presumably, this is failing getting the primary key of the 'events' table.
At the time, getPrimaryKeys() is called, how many tables called 'events' exist in one or more databases.
I'd need to look up how the catalog
, and schema
arguments map to MySQL but perhaps it's not doing what you think.
For example, a quick google search found a couple of examples like this getPrimaryKeys("my_database", null, "my_table").
Googling 'MySQL JDBC getPrimaryKeys' I also found this MySQL
According this explanation: https://stackoverflow.com/a/7944489 catalogue is a different thing for each database. So I propose to specify catalogue only for mysql, for other databases left it null.
script build-and-test-mysql.sh shown failed tests, than stuck:
mysql-binlog tests passed, polling tests failed.
After testing via Idea I found reason.
Method that retrieves primary keys: https://github.com/eventuate-foundation/eventuate-cdc/blob/wip-db-id-gen/eventuate-local-java-cdc-connector-polling/src/main/java/io/eventuate/local/polling/PollingDao.java#L238 throws exception:
Under debug I found that that result set contains 2 primary keys with same value: "event_id".
I did not find why it works like this.
I am going to test it with mysql 8 (I just realized that since it is polling tests it is not necessary to update binlog connector).