#2317 (ok 2.9.2) export of stored procedures not correct

Latest_Git
fixed
None
1
2014-08-12
2006-12-11
Jürgen Wind
No

if i create a stored procedure in `test` and do an export
i get:

-- phpMyAdmin SQL Dump
-- version 2.10.0-dev
-- http://www.phpmyadmin.net
--
-- Host: localhost:9306
-- Generation Time: Dec 11, 2006 at 01:17 AM
-- Server version: 5.0.21
-- PHP Version: 5.1.4

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Database: `test`
--

-- --------------------------------------------------------

--
-- Table structure for table `TTT`
--

CREATE TABLE `ttt` (
`FFF` varchar(222) collate latin1_german2_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci;

--
-- Procedures
--
-- DELIMITER $$
--
CREATE DEFINER=`root`@`l` PROCEDURE `payment`(payment_amount DECIMAL(6,2),
payment_seller_id INT)
BEGIN
DECLARE n DECIMAL(6,2);
SET n = payment_amount - 1.00;
INSERT INTO Moneys VALUES (n, CURRENT_DATE);
IF payment_amount > 1.00 THEN
UPDATE Sellers
SET commission = commission + 1.00
WHERE seller_id = payment_seller_id;
END IF;
END$$

--
-- DELIMITER ;
--

to be able to import it again using mysql CLI
(after adding "use `test`;" of course)
i have to remove "-- " before DELIMITER

(but import using pma fails anyway)

Discussion

  • Jürgen Wind
    Jürgen Wind
    2006-12-11

    Logged In: YES
    user_id=1383652
    Originator: YES

    sorry, should be a bug report, i didn't get accustomed to the new design yet ;)

     
  • Michal Čihař
    Michal Čihař
    2007-01-02

    • milestone: 284141 --> Latest_Git
    • assigned_to: nobody --> nijel
     
  • Michal Čihař
    Michal Čihař
    2007-01-02

    • priority: 5 --> 1
    • summary: export of stored procedures not correct --> (ok 2.9.2) export of stored procedures not correct
    • status: open --> open-fixed
     
  • Michal Čihař
    Michal Čihař
    2007-01-02

    Logged In: YES
    user_id=192186
    Originator: NO

    Fixed in subversion, thanks for reporting.

     
  • Marc Delisle
    Marc Delisle
    2007-01-02

    Logged In: YES
    user_id=210714
    Originator: NO

    One day we'll have to deal with the parsing of DELIMITER at import time, in a more complete way than what is currently done in libraries/import/sql.php:

    if (isset($_POST['sql_delimiter'])) {
    $sql_delimiter = $_POST['sql_delimiter'];
    } else {
    $sql_delimiter = ';';
    }

    But I'm not sure I like the present fix. I would prefer to enclose all the stored procedures inside comments, this way the whole export file can be imported back from PMA (I assume that most users don't even have access to CLI). Or better, at export time, we could export the procedures in a separate file?

     
  • Marc Delisle
    Marc Delisle
    2007-01-16

    • status: open-fixed --> closed-fixed
     
  • Michal Čihař
    Michal Čihař
    2013-06-11

    • Status: closed-fixed --> fixed