TMyDump Can't Backup Stored Procedure and Functions If use Embedded Server

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
chintatlim
Posts: 22
Joined: Tue 09 Nov 2004 00:31

TMyDump Can't Backup Stored Procedure and Functions If use Embedded Server

Post by chintatlim » Thu 09 Jul 2015 04:30

refer below backup info:

-- MyDAC version: 8.5.14
-- MySQL server version: 5.5.44-embedded
-- MySQL client version: 5.5.44
-- Script date 09/07/2015 12:24:42 PM
-- ----------------------------------------------------------------------
-- Server:
-- Database: accounting6

/*!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' */;
--
-- StoredProc `getcompanygstpercentage`
--

DELIMITER $$
$$
DELIMITER ;


--
-- StoredProc `getdiscountamountfromformat`
--

DELIMITER $$
$$
DELIMITER ;

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: TMyDump Can't Backup Stored Procedure and Functions If use Embedded Server

Post by ViktorV » Thu 09 Jul 2015 10:07

Unfortunately, we can't reproduce the issue: stored procedures backup was performed successfully on connection to MySQL Embedded 5.5.44. To investigate this behavior of MyDAC, please send us a small sample to demonstrate the issue, including a script for creation and filling in the test database object.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: TMyDump Can't Backup Stored Procedure and Functions If use Embedded Server

Post by ViktorV » Mon 13 Jul 2015 13:35

While backing up stored procedures and functions, the SHOW CREATE PROCEDURE and SHOW CREATE FUNCTION statements are called. One of the constraints of MySQL Embedded server is that execution of aforementioned statements return correct info only when the user is the owner of the stored procedure (function), otherwise the call will return an empty string. In your case, the owner of stored procedures (functions) is the ROOT user. That is why the result file doesn't contain scripts that created stored procedures and functions while backing up. We will try to work around this behavior of MySQL Embedded Server in one of the following versions of MyDAC.

Post Reply