php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46438 bug42548.phpt MySQL Syntax Error for MySQL 4.1
Submitted: 2008-10-31 18:21 UTC Modified: 2008-11-01 03:33 UTC
From: hostmaster at uuism dot net Assigned:
Status: Closed Package: MySQLi related
PHP Version: 5.2.6 OS: Fedora Core 4
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: hostmaster at uuism dot net
New email:
PHP Version: OS:

 

 [2008-10-31 18:21 UTC] hostmaster at uuism dot net
Description:
------------
When I run test ext/mysqli/tests/bug42548.phpt with PHP 5.2.6 and MySQL 4.1, I get a MySQL syntax 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 'PROCEDURE IF EXISTS p1' at line 1"

This error occurs because MySQL version 4.1 does not support PROCEDUREs.



Reproduce code:
---------------
<?php
include "connect.inc";

$mysqli = mysqli_init();
$mysqli->real_connect($host, $user, $passwd, 'test');
if (mysqli_connect_errno()) {
  printf("Connect failed: %s\n", mysqli_connect_error());
  exit();
}

$mysqli->query("DROP PROCEDURE IF EXISTS p1") or die($mysqli->error);

?>

Expected result:
----------------
This test should be skipped

Actual result:
--------------
it failed

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-31 22:43 UTC] felipe@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2008-11-01 03:33 UTC] hostmaster at uuism dot net
Thanks.

The revised php5.2-200810312330 test script skips this test perfectly.

Jim
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 14:01:34 2025 UTC