MySqlBackup.Net icon indicating copy to clipboard operation
MySqlBackup.Net copied to clipboard

Retores of procedures do not seem to work under Linux

Open txs-lars opened this issue 5 years ago • 2 comments
trafficstars

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.

txs-lars avatar Dec 20 '19 08:12 txs-lars

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

adriancs2 avatar Jun 21 '20 15:06 adriancs2

Hi, new version of nuget is released

adriancs2 avatar Jul 16 '20 15:07 adriancs2