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:
Shawn Pearce
2013-01-02 22:11:43 -08:00
committed by Edwin Kempin
parent 4030f6bbc4
commit 6802493d7b
5 changed files with 0 additions and 35 deletions

View File

@@ -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;
//

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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");
}
}

View File

@@ -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)