Skip to content

Commit

Permalink
Revert changes to MySQL
Browse files Browse the repository at this point in the history
Reverted changes due to bug https://bugs.mysql.com/bug.php?id=106465
  • Loading branch information
José Fidalgo committed Feb 15, 2022
1 parent 521e370 commit b1b7714
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

import static com.feedzai.commons.sql.abstraction.util.StringUtils.md5;
Expand Down Expand Up @@ -105,20 +104,6 @@ public MySqlEngine(PdbProperties properties) throws DatabaseEngineException {
super(MYSQL_DRIVER, properties, Dialect.MYSQL);
}

@Override
protected Properties getDBProperties() {
final Properties props = super.getDBProperties();

/*
To respect the fetchsize setting, MySQL needs a cursor on the server side. See
https://dev.mysql.com/doc/connectors/en/connector-j-reference-implementation-notes.html
https://dev.mysql.com/doc/connectors/en/connector-j-connp-props-performance-extensions.html#cj-conn-prop_useCursorFetch
*/
props.setProperty("useCursorFetch", Boolean.TRUE.toString());

return props;
}

/**
* Sets the session to ANSI mode.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import com.feedzai.commons.sql.abstraction.engine.impl.abs.AbstractEngineSchemaTest;
import com.feedzai.commons.sql.abstraction.engine.testconfig.DatabaseConfiguration;
import com.feedzai.commons.sql.abstraction.engine.testconfig.DatabaseTestUtil;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

Expand All @@ -37,6 +39,15 @@ public static Collection<DatabaseConfiguration> data() throws Exception {
return DatabaseTestUtil.loadConfigurations("mysql");
}

@Override
@Test
@Ignore("MySQL doesn't respect fetch size unless we use a server cursor, which can be enabled by setting the property" +
" 'useCursorFetch' to true in the JDBC URL. However, when server cursor is enabled, the query timeouts are" +
" not respected." +
"See https://bugs.mysql.com/bug.php?id=106465")
public void testFetchSize() {
}

@Override
protected void defineUDFGetOne(final DatabaseEngine engine) throws DatabaseEngineException {
engine.executeUpdate("DROP FUNCTION IF EXISTS GetOne");
Expand Down

0 comments on commit b1b7714

Please sign in to comment.