JImageHash icon indicating copy to clipboard operation
JImageHash copied to clipboard

Attempting to recreate tables that already exist with DatabaseMatcher

Open JustTalDevelops opened this issue 1 year ago • 1 comments

Class.forName("com.mysql.cj.jdbc.Driver").newInstance();

var conn = DriverManager.getConnection(...);

imageMatcher = new DatabaseImageMatcher(conn);
imageMatcher.addHashingAlgorithm(hasher, 1);

Doing this first causes the library to throw the following exception:

java.sql.SQLSyntaxErrorException: Table 'WaveletHash89644008' already exists

On subsequent restarts, this also seems to happen on the main table:

java.sql.SQLSyntaxErrorException: Table 'ImageHasher' already exists

JustTalDevelops avatar May 07 '24 19:05 JustTalDevelops

image

Looking at the code, it seems to be coming from this function making the table name uppercase before checking if it exists. Passing the name as is seems to return the expected output here. Any idea why this is?

JustTalDevelops avatar May 07 '24 19:05 JustTalDevelops