MySqlBackupNET/MySqlBackup.Net

Retores of procedures do not seem to work under Linux

txs-lars opened this issue · 2 comments

Retores of procedures do not seem to work under Linux due to the following bug in the Mysql connector:
https://bugs.mysql.com/bug.php?id=98037

If you try to restore this script under Linux a syntax exception occurs:

`-- MySqlBackup.NET 2.3.1
-- Dump Time: 2019-12-18 14:04:41


-- Server version 10.4.8-MariaDB-1:10.4.8+maria~bionic-log mariadb.org binary distribution

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT /;
/
!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS /;
/
!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION /;
/
!40101 SET NAMES utf8 /;
/
!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 /;
/
!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 /;
/
!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' /;
/
!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Dumping functions

DROP FUNCTION IF EXISTS TEST;
DELIMITER §§§
CREATE FUNCTION TEST() RETURNS int(11)
DETERMINISTIC
RETURN 8081; §§§
DELIMITER ;`

A quick workaround until Oracle solves the problem seems to make in line 1372 in the class MySqlBackup.cs in the method "Import_AppendLineAndExecute" no AppendLine but only an Append.

void Import_AppendLineAndExecute(string line) { _sbImport.Append(line); //if (!line.EndsWith(_delimiter)) // return;

The Mysql connector seems to have problems with the last line break (\n) under Linux.

I'm changing AppendLine to Append.
thanks for sharing this info.

Hi, new version of nuget is released