You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docker run -d --rm -p 3306:3306 -e MYSQL_ROOT_PASSWORD=my-secret-pw mysql:5.6
sleep 15
migrate up
Expected result
success
Actual result
ERROR: Error executing command. Cause: org.apache.ibatis.jdbc.RuntimeSqlException: Error executing: DELIMITER ||
CREATE FUNCTION format_time( picoseconds BIGINT UNSIGNED )
RETURNS varchar(16) CHARSET utf8
DETERMINISTIC
BEGIN
IF picoseconds IS NULL THEN
RETURN NULL
. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER ||
CREATE FUNCTION format_time( picoseconds BIGINT UNSIGNED )
RETURN' at line 1
I am Proposing a change to support a fix for this as referenced here and here
The problem is because ScriptRunner doesn't parse the file correctly.
I propose the following changes which will allow anyone to be able to implement their own runner:
Change ScriptRunner to be an interface
The current implementation implements this interface as the default
Use the ServiceLoader mechanism in Java to discover other implementations on the class path
Add a method to ScriptRunner to allow to it declare what DB versions it supports in support of step 3
Define the current implementation in the META-inf/services directory
This would also allow fixing of OutOfMemoryError when parsing large scripts (300+mb)
The text was updated successfully, but these errors were encountered:
MyBatis version
3.3.1
Database vendor and version
mysql 5.6
Test case or example project
https://github.com/chb0github/mybatis-example
Steps to reproduce
docker run -d --rm -p 3306:3306 -e MYSQL_ROOT_PASSWORD=my-secret-pw mysql:5.6
sleep 15
migrate up
Expected result
success
Actual result
ERROR: Error executing command. Cause: org.apache.ibatis.jdbc.RuntimeSqlException: Error executing: DELIMITER ||
CREATE FUNCTION format_time( picoseconds BIGINT UNSIGNED )
RETURNS varchar(16) CHARSET utf8
DETERMINISTIC
BEGIN
IF picoseconds IS NULL THEN
RETURN NULL
. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER ||
CREATE FUNCTION format_time( picoseconds BIGINT UNSIGNED )
RETURN' at line 1
I am Proposing a change to support a fix for this as referenced here and here
The problem is because ScriptRunner doesn't parse the file correctly.
I propose the following changes which will allow anyone to be able to implement their own runner:
META-inf/services
directoryThis would also allow fixing of
OutOfMemoryError
when parsing large scripts (300+mb)The text was updated successfully, but these errors were encountered: