mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-09-30 07:27:36 +02:00
Limited some extension query ID results to 1
MySQL is very strict about subquery size in insert, so duplicate rows would cause issues in next inserts (Duplicates can occur if two servers do the same work at the same time)
This commit is contained in:
parent
641cd24077
commit
f4ff03bbc9
@ -48,7 +48,7 @@ public class ExtensionIconTable {
|
||||
FROM + TABLE_NAME +
|
||||
WHERE + ICON_NAME + "=?" +
|
||||
AND + FAMILY + "=?" +
|
||||
AND + COLOR + "=?)";
|
||||
AND + COLOR + "=? LIMIT 1)";
|
||||
|
||||
public static void set3IconValuesToStatement(PreparedStatement statement, Icon icon) throws SQLException {
|
||||
set3IconValuesToStatement(statement, 1, icon);
|
||||
|
@ -44,7 +44,7 @@ public class ExtensionPluginTable {
|
||||
public static final String STATEMENT_SELECT_PLUGIN_ID = '(' + SELECT + ID +
|
||||
FROM + TABLE_NAME +
|
||||
WHERE + PLUGIN_NAME + "=?" +
|
||||
AND + SERVER_UUID + "=?)";
|
||||
AND + SERVER_UUID + "=? LIMIT 1)";
|
||||
|
||||
public static void set2PluginValuesToStatement(PreparedStatement statement, int parameterIndex, String pluginName, UUID serverUUID) throws SQLException {
|
||||
statement.setString(parameterIndex, pluginName);
|
||||
|
@ -54,7 +54,7 @@ public class ExtensionProviderTable {
|
||||
|
||||
public static final String STATEMENT_SELECT_PROVIDER_ID = '(' + SELECT + ID + FROM + TABLE_NAME +
|
||||
WHERE + PROVIDER_NAME + "=?" +
|
||||
AND + PLUGIN_ID + "=" + ExtensionPluginTable.STATEMENT_SELECT_PLUGIN_ID + ')';
|
||||
AND + PLUGIN_ID + "=" + ExtensionPluginTable.STATEMENT_SELECT_PLUGIN_ID + " LIMIT 1)";
|
||||
|
||||
public static void set3PluginValuesToStatement(PreparedStatement statement, int parameterIndex, String providerName, String pluginName, UUID serverUUID) throws SQLException {
|
||||
statement.setString(parameterIndex, providerName);
|
||||
|
@ -46,7 +46,7 @@ public class ExtensionTabTable {
|
||||
public static final String STATEMENT_SELECT_TAB_ID = '(' + SELECT + ID +
|
||||
FROM + TABLE_NAME +
|
||||
WHERE + TAB_NAME + "=?" +
|
||||
AND + PLUGIN_ID + "=" + ExtensionPluginTable.STATEMENT_SELECT_PLUGIN_ID + ')';
|
||||
AND + PLUGIN_ID + "=" + ExtensionPluginTable.STATEMENT_SELECT_PLUGIN_ID + " LIMIT 1)";
|
||||
|
||||
public static void set3TabValuesToStatement(PreparedStatement statement, int parameterIndex, String tabName, String pluginName, UUID serverUUID) throws SQLException {
|
||||
statement.setString(parameterIndex, tabName);
|
||||
|
@ -59,7 +59,7 @@ public class ExtensionTableProviderTable {
|
||||
|
||||
public static final String STATEMENT_SELECT_TABLE_ID = '(' + SELECT + ID + FROM + TABLE_NAME +
|
||||
WHERE + PROVIDER_NAME + "=?" +
|
||||
AND + PLUGIN_ID + "=" + ExtensionPluginTable.STATEMENT_SELECT_PLUGIN_ID + ')';
|
||||
AND + PLUGIN_ID + "=" + ExtensionPluginTable.STATEMENT_SELECT_PLUGIN_ID + " LIMIT 1)";
|
||||
|
||||
private ExtensionTableProviderTable() {
|
||||
/* Static information class */
|
||||
|
@ -58,8 +58,7 @@ public class ServerTable {
|
||||
public static final String STATEMENT_SELECT_SERVER_ID =
|
||||
'(' + SELECT + TABLE_NAME + '.' + SERVER_ID +
|
||||
FROM + TABLE_NAME +
|
||||
WHERE + TABLE_NAME + '.' + SERVER_UUID + "=?" +
|
||||
" LIMIT 1)";
|
||||
WHERE + TABLE_NAME + '.' + SERVER_UUID + "=? LIMIT 1)";
|
||||
|
||||
private ServerTable() {
|
||||
/* Static information class */
|
||||
|
Loading…
Reference in New Issue
Block a user