Function not copied when transfering database from Mariadb on Windows to Linux

mhzujo's profile image mhzujo posted 2 years ago in General Permalink

Hi,

looking for some assistance.

When transfering db from Mariadb on Windows to Linux, by using Export/Import in Heidi, all the structure (tables, views, procedures) and data is copied correctly, except for the function.

Function needs to be manually transfered.

When transfering from Windows to Windows - everythng is working just fine.

I suspect it has something to do with the DELIMITER but not quite sure how to overried it.

Any help will be greatly appreciated.

Marko

ansgar's profile image ansgar posted 2 years ago Permalink

Windows or Linux should not matter here. I guess this has more to do with the server version.

I just exported a function, with the latest HeidiSQL build, and got this, looks ok to me:

-- --------------------------------------------------------
-- Host:                         127.0.0.1
-- Server version:               10.3.12-MariaDB - mariadb.org binary distribution
-- Server OS:                    Win64
-- HeidiSQL Version:             11.3.0.0
-- --------------------------------------------------------

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!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 structure for function test.sdf
DELIMITER //
CREATE FUNCTION `sdf`(
    `Param1` INT

) RETURNS tinyint(4)
BEGIN
return Param1;
return 1;
return 2;
END//
DELIMITER ;

/*!40103 SET TIME_ZONE=IFNULL(@OLD_TIME_ZONE, 'system') */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;

Please login to leave a reply, or register at first.