diff --git a/symmetric-client/src/main/java/org/jumpmind/symmetric/db/mysql/MySqlSymmetricDialect.java b/symmetric-client/src/main/java/org/jumpmind/symmetric/db/mysql/MySqlSymmetricDialect.java index 1153d3cfac..ae84791eef 100644 --- a/symmetric-client/src/main/java/org/jumpmind/symmetric/db/mysql/MySqlSymmetricDialect.java +++ b/symmetric-client/src/main/java/org/jumpmind/symmetric/db/mysql/MySqlSymmetricDialect.java @@ -78,41 +78,37 @@ public void createRequiredDatabaseObjects() { if (this.functionTemplateKeySuffix.equals(PRE_5_1_23)) { String function = this.parameterService.getTablePrefix() + "_" + TRANSACTION_ID + this.functionTemplateKeySuffix; if (!installed(SQL_FUNCTION_INSTALLED, function)) { - String sql = "create function $(functionName)() " + - " returns varchar(50) NOT DETERMINISTIC READS SQL DATA " + - " begin " + - " declare comm_name varchar(50); " + - " declare comm_value varchar(50); " + - " declare comm_cur cursor for show status like 'Com_commit'; " + - " if @@autocommit = 0 then " + - " open comm_cur; " + - " fetch comm_cur into comm_name, comm_value; " + - " close comm_cur; " + - " return concat(concat(connection_id(), '.'), comm_value); " + - " else " + - " return null; " + - " end if; " + - " end "; + String sql = "create function $(functionName)() " + + " returns varchar(50) NOT DETERMINISTIC READS SQL DATA " + + " begin " + + " declare comm_name varchar(50); " + + " declare comm_value varchar(50); " + + " declare comm_cur cursor for show status like 'Com_commit'; " + + " if @@autocommit = 0 then " + + " open comm_cur; " + + " fetch comm_cur into comm_name, comm_value; " + + " close comm_cur; " + + " return concat(concat(connection_id(), '.'), comm_value); " + + " else " + + " return null; " + + " end if; " + + " end "; install(sql, function); } } else { String function = this.parameterService.getTablePrefix() + "_" + TRANSACTION_ID + this.functionTemplateKeySuffix; if (!installed(SQL_FUNCTION_INSTALLED, function)) { - String sql = "create function $(functionName)() " + - " returns varchar(50) NOT DETERMINISTIC READS SQL DATA " + - " begin " + - " declare comm_value varchar(50); " + - " declare comm_cur cursor for select VARIABLE_VALUE from INFORMATION_SCHEMA.SESSION_STATUS where VARIABLE_NAME='COM_COMMIT'; " + - " if @@autocommit = 0 then " + - " open comm_cur; " + - " fetch comm_cur into comm_value; " + - " close comm_cur; " + - " return concat(concat(connection_id(), '.'), comm_value); " + - " else " + - " return null; " + - " end if; " + - " end "; + String sql = "create function $(functionName)() " + + " returns varchar(50) NOT DETERMINISTIC READS SQL DATA \n" + + " begin \n" + + " declare comm_value varchar(50); \n" + + " declare comm_cur cursor for select VARIABLE_VALUE from INFORMATION_SCHEMA.SESSION_STATUS where VARIABLE_NAME='COM_COMMIT'; \n" + + " open comm_cur; \n" + + " fetch comm_cur into comm_value; \n" + + " close comm_cur; \n" + + " return concat(concat(connection_id(), '.'), comm_value); \n" + + " end \n"; install(sql, function); } }