php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39306 Changing Delimiter
Submitted: 2006-10-30 12:20 UTC Modified: 2006-10-30 14:29 UTC
From: ctingley at mediagrids dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.1.6 OS: Windows
Private report: No CVE-ID: None
 [2006-10-30 12:20 UTC] ctingley at mediagrids dot com
Description:
------------
It appears to be unable to change the MySQL delimiter using PHP.  This causes a problem when trying to automate schema creation, especially when trying to create stored procedures.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-30 12:27 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


 [2006-10-30 13:44 UTC] ctingley at mediagrids dot com
This is currently unsupported, but i imagine something similar should work:

<?php
$sql = "DELIMITER //";
mysql_query($sql);
?>

Returns the error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER //' at line 1
 [2006-10-30 13:59 UTC] tony2001@php.net
The delimiter has to be changed when using command line interface to MySQL.
In PHP it's not required, stored procedures and functions can be created without changing it.
 [2006-10-30 14:29 UTC] ctingley at mediagrids dot com
Appologies!  I have just discovered that it is my multiline sql parser that is executing a mysql_query every time it reaches a ;.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 23 03:01:28 2024 UTC