Remove mysql_nextval script
This function does not work on binary logging enabled servers, as MySQL is unable to execute the function on slaves without causing possible corruption. Drop the function since it was only created to help administrators, and is unsafe. Change-Id: I986ac9aee5479d3c1d2ed629eeba284e940704eb
This commit is contained in:
committed by
Edwin Kempin
parent
4030f6bbc4
commit
6802493d7b
@@ -1,14 +0,0 @@
|
||||
-- Gerrit 2 : MySQL
|
||||
--
|
||||
delimiter //
|
||||
|
||||
CREATE FUNCTION nextval_account_id ()
|
||||
RETURNS BIGINT
|
||||
LANGUAGE SQL
|
||||
NOT DETERMINISTIC
|
||||
MODIFIES SQL DATA
|
||||
BEGIN
|
||||
INSERT INTO account_id (s) VALUES (NULL);
|
||||
RETURN LAST_INSERT_ID();
|
||||
END;
|
||||
//
|
||||
@@ -42,11 +42,6 @@ public abstract class BaseDataSourceType implements DataSourceType {
|
||||
return getScriptRunner("index_generic.sql");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScriptRunner getNextValScript() throws IOException {
|
||||
return ScriptRunner.NOOP;
|
||||
}
|
||||
|
||||
protected static final ScriptRunner getScriptRunner(String path) throws IOException {
|
||||
if (path == null) {
|
||||
return ScriptRunner.NOOP;
|
||||
|
||||
@@ -33,12 +33,4 @@ public interface DataSourceType {
|
||||
* @throws IOException
|
||||
*/
|
||||
public ScriptRunner getIndexScript() throws IOException;
|
||||
|
||||
/**
|
||||
* Return a ScriptRunner that runs the nextVal script. Must not return
|
||||
* <code>null</code>, but may return a ScriptRunner that does nothing.
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
public ScriptRunner getNextValScript() throws IOException;
|
||||
}
|
||||
|
||||
@@ -23,8 +23,6 @@ import com.google.inject.Inject;
|
||||
|
||||
import org.eclipse.jgit.lib.Config;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
class MySql extends BaseDataSourceType {
|
||||
|
||||
private Config cfg;
|
||||
@@ -51,9 +49,4 @@ class MySql extends BaseDataSourceType {
|
||||
public boolean usePool() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScriptRunner getNextValScript() throws IOException {
|
||||
return getScriptRunner("mysql_nextval.sql");
|
||||
}
|
||||
}
|
||||
@@ -119,7 +119,6 @@ public class SchemaCreator {
|
||||
}
|
||||
|
||||
dataSourceType.getIndexScript().run(db);
|
||||
dataSourceType.getNextValScript().run(db);
|
||||
}
|
||||
|
||||
private AccountGroup newGroup(ReviewDb c, String name, AccountGroup.UUID uuid)
|
||||
|
||||
Reference in New Issue
Block a user