From:             tim at timcrider dot com
Operating system: Fedora Core 2
PHP version:      5.0.0RC2
PHP Bug Type:     Reproducible crash
Bug description:  MySQL seg faults through PHP

Description:
------------
If mysql_select_db() fails to select a DB, either the DB is gone or it has
been renamed, and you try to run a LOAD DATA INFILE using PHP 5.0.0 RC2,
it will seg fault and crash MySQL.

PHP continues to run fine, but MySQL crashes. Also, when trying to do this
task inside of the mysql monitor and typing in the command with no
database selected, it gives the standard:

ERROR 1046: No Database Selected

 I have been able to reproduce this using MySQL 4.1.1 and MySQL 4.0.20.
After installing both versions, I recompiled php to use those specific
libararies.

Reproduce code:
---------------
mysql_query("LOAD DATA LOCAL INFILE
'/usr/local/data_processor/.working/30953/ALL_SORTED.30953' INTO TABLE
`tDWD31HTva`");

Expected result:
----------------
a mysql error, that does not seg fault MySQL.

Actual result:
--------------
MySQL Seg faults, no php error is produced, and MySQL doesn't log the
crash as an error.

-- 
Edit bug report at http://bugs.php.net/?id=28511&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28511&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28511&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=28511&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=28511&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=28511&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=28511&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=28511&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=28511&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=28511&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=28511&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=28511&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=28511&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28511&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=28511&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=28511&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=28511&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28511&r=float

Reply via email to