Bug #63582 [Nab]: ReflectionClass-getProperties() omits private members of parent classes

2012-11-24 Thread anthon dot pang at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=63582edit=1

 ID: 63582
 User updated by:anthon dot pang at gmail dot com
 Reported by:anthon dot pang at gmail dot com
 Summary:ReflectionClass-getProperties() omits private
 members of parent classes
 Status: Not a bug
 Type:   Bug
 Package:Reflection related
 Operating System:   Ubuntu 12.04
 PHP Version:5.5.0alpha1
 Block user comment: N
 Private report: N

 New Comment:

Thanks for the explanation.


Previous Comments:

[2012-11-23 01:54:10] ahar...@php.net

Private properties and methods only exist within the exact class they are 
defined in: note that if you call getParentClass() on the $reflection object 
and then call getProperties() on that, c appears along with the other 
properties defined in Foo.


[2012-11-22 16:12:23] anthon dot pang at gmail dot com

Description:

getProperties() doesn't include private scoped properties from parent classes

Test script:
---
?php
abstract class Foo {
public  $a;
protected $b;
private $c;
}

class Bar extends Foo {
public $d;
protected $e;
private $f;
}

$obj = new Bar;
$reflection = new ReflectionClass($obj);
$propertyList = $reflection-getProperties();

foreach ($propertyList as $property) {
var_dump($property-getName());
}

Expected result:

string(1) d
string(1) e
string(1) f
string(1) a
string(1) b
string(1) c

Actual result:
--
string(1) d
string(1) e
string(1) f
string(1) a
string(1) b






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=63582edit=1


Req #62858 [Com]: Please remove 'final' restriction on SimpleXMLElement::__construct

2012-11-24 Thread anthon dot pang at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=62858edit=1

 ID: 62858
 Comment by: anthon dot pang at gmail dot com
 Reported by:michaelduff at yahoo dot com
 Summary:Please remove 'final' restriction on
 SimpleXMLElement::__construct
 Status: Open
 Type:   Feature/Change Request
 Package:SimpleXML related
 PHP Version:5.4.6
 Block user comment: N
 Private report: N

 New Comment:

Dupe of #46684


Previous Comments:

[2012-08-21 05:47:48] larue...@php.net

there must be some reason for the author mark the constructor as final, like 
some 
work must be done before any user access to it.


[2012-08-18 19:36:50] michaelduff at yahoo dot com

Description:

The __construct() method on SimpleXMLElement is marked 'final', which prevents 
extension of the class for, say, XML-format-specific objects which augment 
otherwise empty incoming XML data.

The current workaround is to use __get and __set and company (which 
unfortunately means ?= $obj instanceof SimpleXMLElement ? fails), and which 
is much slower -- or to use a static factory method which forces some XML in 
there (which is syntactically ugly imo.)

Not to shoot my request in the foot, but I forsee possible issues with these 
functions:

- simplexml_import_dom ( $node [, $class_name ] )
- simplexml_load_file ( string $filename [, string $class_name ] ... )
- simplexml_load_string ( string $data [, string $class_name ] ... )

However, perhaps it would suffice to require 'a compatible function signature' 
rather than to mark it final?







-- 
Edit this bug report at https://bugs.php.net/bug.php?id=62858edit=1


[PHP-BUG] Bug #63582 [NEW]: ReflectionClass-getProperties() omits private members of parent classes

2012-11-22 Thread anthon dot pang at gmail dot com
From: anthon dot pang at gmail dot com
Operating system: Ubuntu 12.04
PHP version:  5.5.0alpha1
Package:  Reflection related
Bug Type: Bug
Bug description:ReflectionClass-getProperties() omits private members of 
parent classes

Description:

getProperties() doesn't include private scoped properties from parent
classes

Test script:
---
?php
abstract class Foo {
public  $a;
protected $b;
private $c;
}

class Bar extends Foo {
public $d;
protected $e;
private $f;
}

$obj = new Bar;
$reflection = new ReflectionClass($obj);
$propertyList = $reflection-getProperties();

foreach ($propertyList as $property) {
var_dump($property-getName());
}

Expected result:

string(1) d
string(1) e
string(1) f
string(1) a
string(1) b
string(1) c

Actual result:
--
string(1) d
string(1) e
string(1) f
string(1) a
string(1) b

-- 
Edit bug report at https://bugs.php.net/bug.php?id=63582edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63582r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63582r=trysnapshot53
Try a snapshot (trunk): 
https://bugs.php.net/fix.php?id=63582r=trysnapshottrunk
Fixed in SVN:   https://bugs.php.net/fix.php?id=63582r=fixed
Fixed in release:   https://bugs.php.net/fix.php?id=63582r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=63582r=needtrace
Need Reproduce Script:  https://bugs.php.net/fix.php?id=63582r=needscript
Try newer version:  https://bugs.php.net/fix.php?id=63582r=oldversion
Not developer issue:https://bugs.php.net/fix.php?id=63582r=support
Expected behavior:  https://bugs.php.net/fix.php?id=63582r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=63582r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=63582r=submittedtwice
register_globals:   https://bugs.php.net/fix.php?id=63582r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63582r=php4
Daylight Savings:   https://bugs.php.net/fix.php?id=63582r=dst
IIS Stability:  https://bugs.php.net/fix.php?id=63582r=isapi
Install GNU Sed:https://bugs.php.net/fix.php?id=63582r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63582r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=63582r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63582r=mysqlcfg



Bug #54508 [Com]: mysqli: truncated floats

2011-04-14 Thread anthon dot pang at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=54508edit=1

 ID: 54508
 Comment by: anthon dot pang at gmail dot com
 Reported by:anthon dot pang at gmail dot com
 Summary:mysqli: truncated floats
 Status: Bogus
 Type:   Bug
 Package:MySQLi related
 Operating System:   Linux
 PHP Version:5.3.6
 Block user comment: N
 Private report: N

 New Comment:

Thank you very much for the explanation.


Previous Comments:

[2011-04-13 11:53:11] johan...@php.net

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

PDO is using emulation of prepared statements by default. By such it is
executing a regular query command which uses the MySQL text
protocol. When using prepared statements with mysqli it is using true
prepared statements and they are using the binary protocol for talking
to the MySQL server. This means data is received in different formats
and by such is interpreteded differently.


[2011-04-11 19:07:59] anthon dot pang at gmail dot com

Description:

There's an inconsistency in behaviour between mysqli and PDO_MSYQL in
the following SELECT, e.g.,



SELECT TRUNCATE(SUM(aFloatColumn),2) FROM aTable;



Let's say the sum of the column is 42.001.



With PDO_MYSQL, you'll get 42.00.



But with MYSQLI, you'll instead get 42.



Test script:
---
?php

$link = mysqli_connect(localhost, user, password, dbname);



$query = 'CREATE TABLE t (f FLOAT)';

$stmt = mysqli_prepare($link, $query);

mysqli_stmt_execute($stmt);



$query = 'TRUNCATE TABLE t';

$stmt = mysqli_prepare($link, $query);

mysqli_stmt_execute($stmt);



$query = 'INSERT INTO t (f) VALUES (42.001)';

$stmt = mysqli_prepare($link, $query);

mysqli_stmt_execute($stmt);



$query = SELECT truncate(sum(f), 2) from t;

$stmt = mysqli_prepare($link, $query);

mysqli_stmt_execute($stmt);



mysqli_stmt_bind_result($stmt, $revenue);

while (mysqli_stmt_fetch($stmt)) {

printf (%s\n, $revenue);

}



mysqli_stmt_close($stmt);

mysqli_close($link);



Expected result:

42.00

Actual result:
--
42






-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54508edit=1


[PHP-BUG] Bug #54508 [NEW]: mysqli: truncated floats

2011-04-11 Thread anthon dot pang at gmail dot com
From: 
Operating system: Linux
PHP version:  5.3.6
Package:  MySQLi related
Bug Type: Bug
Bug description:mysqli: truncated floats

Description:

There's an inconsistency in behaviour between mysqli and PDO_MSYQL in the
following SELECT, e.g.,



SELECT TRUNCATE(SUM(aFloatColumn),2) FROM aTable;



Let's say the sum of the column is 42.001.



With PDO_MYSQL, you'll get 42.00.



But with MYSQLI, you'll instead get 42.



Test script:
---
?php

$link = mysqli_connect(localhost, user, password, dbname);



$query = 'CREATE TABLE t (f FLOAT)';

$stmt = mysqli_prepare($link, $query);

mysqli_stmt_execute($stmt);



$query = 'TRUNCATE TABLE t';

$stmt = mysqli_prepare($link, $query);

mysqli_stmt_execute($stmt);



$query = 'INSERT INTO t (f) VALUES (42.001)';

$stmt = mysqli_prepare($link, $query);

mysqli_stmt_execute($stmt);



$query = SELECT truncate(sum(f), 2) from t;

$stmt = mysqli_prepare($link, $query);

mysqli_stmt_execute($stmt);



mysqli_stmt_bind_result($stmt, $revenue);

while (mysqli_stmt_fetch($stmt)) {

printf (%s\n, $revenue);

}



mysqli_stmt_close($stmt);

mysqli_close($link);



Expected result:

42.00

Actual result:
--
42

-- 
Edit bug report at http://bugs.php.net/bug.php?id=54508edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=54508r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=54508r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=54508r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=54508r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=54508r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=54508r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=54508r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=54508r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=54508r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=54508r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=54508r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=54508r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=54508r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=54508r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=54508r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=54508r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=54508r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=54508r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=54508r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=54508r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=54508r=mysqlcfg



Bug #54158 [Com]: MYSQLND + PDO MySQL requires #define MYSQL_OPT_LOCAL_INFILE

2011-04-02 Thread anthon dot pang at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=54158edit=1

 ID: 54158
 Comment by: anthon dot pang at gmail dot com
 Reported by:tamas at ideaweb dot hu
 Summary:MYSQLND + PDO MySQL requires #define
 MYSQL_OPT_LOCAL_INFILE
 Status: Analyzed
 Type:   Bug
 Package:PDO related
 Operating System:   Linux
 PHP Version:5.3.5
 Assigned To:mysql
 Block user comment: N
 Private report: N

 New Comment:

As a workaround, I use PDO::ATTR_EMULATE_PREPARES. With 5.2.17 and 5.3.6
(using mysqlndb), both LOAD DATA INFILE and LOAD DATA LOCAL INFILE work
on my Ubuntu 10.04 box, using PDO_MYSQL and MYSQLI extensions.


Previous Comments:

[2011-03-04 10:21:43] and...@php.net

to be fixed after 5.3.6 is released


[2011-03-04 01:18:56] tamas at ideaweb dot hu

Description:

Hi,



On php 5.3.x PDO LOAD DATA LOCAL INFILE support seems broken. Running
the code below issues a warning: 



Warning: PDOStatement::execute(): LOAD DATA LOCAL INFILE forbidden in
/home/tamas/percona/load3.php on line 17  



This is coming from mysqlnd when CLIENT_LOCAL_FILES option is disabled.
Looking at the trace file, PDO doesn't call mysql_options
(set_client_option) to enable local infile support. I tracked down this
is caused by the following ifdef in ext/pdo_mysql/mysql_driver.c:



#ifdef MYSQL_OPT_LOCAL_INFILE

if (mysql_options(H-server, MYSQL_OPT_LOCAL_INFILE, (const char
*)local_infile)) {

pdo_mysql_error(dbh);

goto cleanup;

}

#endif



MYSQL_OPT_LOCAL_INFILE is undefined hence the whole block which would
enable local infile support is disabled. When the  ifdef/endif line is
commented out everything works. I also tested with mysqli, that is
unaffected and works as expected.



And a related bug to this one: http://bugs.php.net/46964



Configure Command =  './configure' 
'--prefix=/home/tamas/percona/php53dbg' '--disable-all'
'--with-pdo-mysql=mysqlnd' '--enable-debug' '--enable-pdo'
'--with-mysqli=mysqlnd' '--with-mysql=mysqlnd'



Thanks,



Tamas

Test script:
---
define('MYSQL_ALL_DSN','mysql:host=10.8.0.1;dbname=c');

define('MYSQL_ALL_USER','a');

define('MYSQL_ALL_PASS','b');





$sql =  'LOAD DATA LOCAL INFILE \'/home/tamas/percona/testLoad.data\'
INTO TABLE mail_message '.

'FIELDS TERMINATED BY \',\' OPTIONALLY ENCLOSED BY \'\' LINES
TERMINATED BY \'\n\' '.

'(priority, user_id, `to`, template_id, data, custom_text_hash,
spam)';



$con = new PDO(MYSQL_ALL_DSN, MYSQL_ALL_USER, MYSQL_ALL_PASS, 

   array( 

 PDO::MYSQL_ATTR_LOCAL_INFILE = 1, 

));

$stmt = $con-prepare($sql);  



$stmt-execute();







-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54158edit=1


Bug #54158 [Com]: MYSQLND + PDO MySQL requires #define MYSQL_OPT_LOCAL_INFILE

2011-04-02 Thread anthon dot pang at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=54158edit=1

 ID: 54158
 Comment by: anthon dot pang at gmail dot com
 Reported by:tamas at ideaweb dot hu
 Summary:MYSQLND + PDO MySQL requires #define
 MYSQL_OPT_LOCAL_INFILE
 Status: Analyzed
 Type:   Bug
 Package:PDO related
 Operating System:   Linux
 PHP Version:5.3.5
 Assigned To:mysql
 Block user comment: N
 Private report: N

 New Comment:

Sorry, you're right.  My workaround is actually because MySQL is
compiled with --enable-local-infile.


Previous Comments:

[2011-04-03 01:08:09] anthon dot pang at gmail dot com

As a workaround, I use PDO::ATTR_EMULATE_PREPARES. With 5.2.17 and 5.3.6
(using mysqlndb), both LOAD DATA INFILE and LOAD DATA LOCAL INFILE work
on my Ubuntu 10.04 box, using PDO_MYSQL and MYSQLI extensions.


[2011-03-04 10:21:43] and...@php.net

to be fixed after 5.3.6 is released


[2011-03-04 01:18:56] tamas at ideaweb dot hu

Description:

Hi,



On php 5.3.x PDO LOAD DATA LOCAL INFILE support seems broken. Running
the code below issues a warning: 



Warning: PDOStatement::execute(): LOAD DATA LOCAL INFILE forbidden in
/home/tamas/percona/load3.php on line 17  



This is coming from mysqlnd when CLIENT_LOCAL_FILES option is disabled.
Looking at the trace file, PDO doesn't call mysql_options
(set_client_option) to enable local infile support. I tracked down this
is caused by the following ifdef in ext/pdo_mysql/mysql_driver.c:



#ifdef MYSQL_OPT_LOCAL_INFILE

if (mysql_options(H-server, MYSQL_OPT_LOCAL_INFILE, (const char
*)local_infile)) {

pdo_mysql_error(dbh);

goto cleanup;

}

#endif



MYSQL_OPT_LOCAL_INFILE is undefined hence the whole block which would
enable local infile support is disabled. When the  ifdef/endif line is
commented out everything works. I also tested with mysqli, that is
unaffected and works as expected.



And a related bug to this one: http://bugs.php.net/46964



Configure Command =  './configure' 
'--prefix=/home/tamas/percona/php53dbg' '--disable-all'
'--with-pdo-mysql=mysqlnd' '--enable-debug' '--enable-pdo'
'--with-mysqli=mysqlnd' '--with-mysql=mysqlnd'



Thanks,



Tamas

Test script:
---
define('MYSQL_ALL_DSN','mysql:host=10.8.0.1;dbname=c');

define('MYSQL_ALL_USER','a');

define('MYSQL_ALL_PASS','b');





$sql =  'LOAD DATA LOCAL INFILE \'/home/tamas/percona/testLoad.data\'
INTO TABLE mail_message '.

'FIELDS TERMINATED BY \',\' OPTIONALLY ENCLOSED BY \'\' LINES
TERMINATED BY \'\n\' '.

'(priority, user_id, `to`, template_id, data, custom_text_hash,
spam)';



$con = new PDO(MYSQL_ALL_DSN, MYSQL_ALL_USER, MYSQL_ALL_PASS, 

   array( 

 PDO::MYSQL_ATTR_LOCAL_INFILE = 1, 

));

$stmt = $con-prepare($sql);  



$stmt-execute();







-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54158edit=1


Bug #53572 [Com]: Bug appeared in php 5.2.15, FastCGI

2011-01-18 Thread anthon dot pang at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=53572edit=1

 ID: 53572
 Comment by: anthon dot pang at gmail dot com
 Reported by:admin at xaker1 dot ru
 Summary:Bug appeared in php 5.2.15, FastCGI
 Status: Open
 Type:   Bug
 Package:Unknown/Other Function
 Operating System:   FreeBSD 8.1
 PHP Version:5.2.16
 Block user comment: N
 Private report: N

 New Comment:

Just an observation, but ini the php.ini for the affected account, the
open_basedir setting has spaces in the paths.


Previous Comments:

[2011-01-14 17:42:37] admin at xaker1 dot ru

Error disappears if you disable open_basedir


[2010-12-20 19:36:53] markusb at gmx dot at

Same probleme



We use php (cgi) and open_basedir  all php scrips  No input file
specified.


[2010-12-19 09:05:26] admin at xaker1 dot ru

The problem exists on php 5.2.15 and php 5.2.16.

I'm using php 5.2.14, as work is needed for all sites.



php.ini on the affected account:

register_globals = Off

display_errors = Off

log_errors = On

max_execution_time = 30

memory_limit = 128M

upload_max_filesize = 16M

post_max_size = 16M

session.save_path = / home/saki2/data/tmp

upload_tmp_dir = / home/saki2/data/tmp

open_basedir = / home/saki2: / tmp: / var / tmp



; [suhosin]

; suhosin.log.syslog = E_ALL  ~ S_SQL

; suhosin.log.sapi = E_ALL  ~ S_SQL

; suhosin.executor.include.max_traversal = 4

; suhosin.executor.func.blacklist = popen, dl, passthru, system, exec,
proc_open, shell_exec, proc_close, symlink



; WARNING

; Or eAccelerator or Zend!!!

; Not twice!!!



; [eAccelerator]

; zend_extension = / usr/local/lib/php/20060613/eaccelerator.so

; eaccelerator.cache_dir = / home/saki2/data/tmp

; eaccelerator.debug = 0

; eaccelerator.shm_size = 16



; [Zend]

; zend_optimizer.optimization_level = 15

; zend_extension_manager.optimizer = /
usr/local/lib/php/20060613/Optimizer

; zend_extension_manager.optimizer_ts = /
usr/local/lib/php/20060613/Optimizer_TS

; zend_extension = /
usr/local/lib/php/20060613/ZendExtensionManager.so

; zend_extension_ts = /
usr/local/lib/php/20060613/ZendExtensionManager_TS.so

php.ini in the working account:

register_globals= Off

display_errors= On

log_errors= On

max_execution_time= 900

memory_limit= 512M

upload_max_filesize= 16M

post_max_size = 16M

session.save_path = /home/bravohost/data/tmp

upload_tmp_dir=/home/bravohost/data/tmp

open_basedir = /home/bravohost:/tmp:/var/tmp



;[suhosin]

;suhosin.log.syslog = E_ALL  ~S_SQL

;suhosin.log.sapi = E_ALL  ~S_SQL

;suhosin.executor.include.max_traversal = 4

;suhosin.executor.func.blacklist =
popen,dl,passthru,system,exec,proc_open,shell_exec,proc_close,symlink



; WARNING

; or eAccelerator or Zend!!!

; not twice!!!



[eAccelerator]

zend_extension=/usr/local/lib/php/20060613/eaccelerator.so

eaccelerator.cache_dir=/home/bravohost/data/tmp

eaccelerator.debug=0

eaccelerator.shm_size=16





;[Zend]

;zend_optimizer.optimization_level=15

;zend_extension_manager.optimizer=/usr/local/lib/php/20060613/Optimizer

;zend_extension_manager.optimizer_ts=/usr/local/lib/php/20060613/Optimizer_TS

;zend_extension=/usr/local/lib/php/20060613/ZendExtensionManager.so

;zend_extension_ts=/usr/local/lib/php/20060613/ZendExtensionManager_TS.so

;extension = filter.so

php modules are used:

[PHP Modules]

bcmath

bz2

calendar

ctype

curl

date

dom

filter

gd

gettext

hash

iconv

imap

ionCube Loader

json

libxml

mbstring

mcrypt

mhash

mysql

mysqli

openssl

pcre

PDO

pdo_mysql

pdo_sqlite

posix

Reflection

session

SimpleXML

sockets

SPL

SQLite

standard

suhosin

tokenizer

xml

xmlreader

xmlwriter

Zend Optimizer

zip

zlib



[Zend Modules]

Zend Extension Manager

Zend Optimizer

the ionCube PHP Loader


[2010-12-18 22:14:48] cataphr...@php.net

We'd need more information than what you gave. First, are you using
5.2.15 or 5.2.16. If you're using 5.2.15, upgrade.



Then, what exactly is causing this (not a vague it may be root folder or
name/group or open_basedir) and, preferably, steps to reproduce, would
go a long way.



Thanks.


[2010-12-18 18:03:27] admin at xaker1 dot ru

If you downgrade to 5.2.14, the error disappears.

At the moment the causes of errors are found, ask for help.




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

http://bugs.php.net/bug.php?id=53572


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53572edit=1


Bug #53716 [Fbk-Opn]: segfault in $stmt-execute()

2011-01-12 Thread anthon dot pang at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=53716edit=1

 ID: 53716
 User updated by:anthon dot pang at gmail dot com
 Reported by:anthon dot pang at gmail dot com
 Summary:segfault in $stmt-execute()
-Status: Feedback
+Status: Open
 Type:   Bug
 Package:PDO related
 Operating System:   Ubuntu 10.04
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

I'm in the middle of a project.  For reference, the segfault occurs in
r3717:



http://dev.piwik.org/trac/changeset/3717/trunk?old_path=%2Fformat=zip



Please keep this ticket open until I have some free time to troubleshoot
and isolate a smaller test case.  (I can already tell you it'll require
database access and be more than the arbitrary 20 line limit.)



Additional info:



Same code doesn't crash when using MYSQLI or php 5.2.17. 
(Tested/segfaulted with 5.3.2, 5.3.3, 5.3.4, and 5.3.5.  These are all
vanilla builds using source downloads from php.net.)


Previous Comments:

[2011-01-12 12:00:33] paj...@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.




[2011-01-12 07:27:41] anthon dot pang at gmail dot com

Description:

The snippet of code shown used is a method from a class that subclasses
Zend_Db_Adapter_Abstract. We make a lot of query() calls, so caching
prepared statements reportedly gives us a 10% performance improvement.



#! /bin/sh

#

# Created by configure



'./configure' \

'--with-mysqli=mysqlnd' \

'--with-pdo-mysql=mysqlnd' \

'--with-zlib' \

'--enable-zip' \

'--with-gd' \

'--with-curl' \

'--enable-mbstring' \

'--enable-debug' \

$@





Test script:
---
public function query($sql, $bind = array())

{

static $cachePreparedStatement = array();



if(isset($cachePreparedStatement[$sql]))

{

if (!is_array($bind)) {

$bind = array($bind);

}

$stmt = $cachePreparedStatement[$sql];

$stmt-execute($bind);

return $stmt;

}



$stmt = parent::query($sql, $bind);

$cachePreparedStatement[$sql] = $stmt;

return $stmt;

}



Expected result:

No crash.

Actual result:
--
Program received signal SIGSEGV, Segmentation fault.

0x003c7816 in ?? () from /lib/tls/i686/cmov/libc.so.6

(gdb) bt

#0  0x003c7816 in ?? () from /lib/tls/i686/cmov/libc.so.6

#1  0x082818c6 in do_fetch (stmt=0x99cb938, do_bind=1,
return_value=0x8f5c78c, 

how=PDO_FETCH_ASSOC, ori=PDO_FETCH_ORI_NEXT, offset=0,
return_all=0x0)

at /home/apang/work/php/php-5.3.5/ext/pdo/pdo_stmt.c:1044

#2  0x082825a2 in zim_PDOStatement_fetch (ht=3, return_value=0x8f5c78c,


return_value_ptr=0x0, this_ptr=0xb7ecba54, return_value_used=1)

at /home/apang/work/php/php-5.3.5/ext/pdo/pdo_stmt.c:1316

#3  0x08501e58 in zend_do_fcall_common_helper_SPEC
(execute_data=0x8bd0dc0)

at /home/apang/work/php/php-5.3.5/Zend/zend_vm_execute.h:316

#4  0x08502415 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER
(execute_data=0x8bd0dc0)

at /home/apang/work/php/php-5.3.5/Zend/zend_vm_execute.h:421

#5  0x085014f5 in execute (op_array=0x971d190)

at /home/apang/work/php/php-5.3.5/Zend/zend_vm_execute.h:107

#6  0x084c6e07 in zend_call_function (fci=0xbfffce28,
fci_cache=0xbfffce4c)

at /home/apang/work/php/php-5.3.5/Zend/zend_execute_API.c:964

#7  0x083849e1 in zif_call_user_func_array (ht=2,
return_value=0x9a03db0, 

return_value_ptr=0x0, this_ptr=0x0, return_value_used=0)

at
/home/apang/work/php/php-5.3.5/ext/standard/basic_functions.c:4796

#8  0x08501e58 in zend_do_fcall_common_helper_SPEC
(execute_data=0x8bcffdc)

at /home/apang/work/php/php-5.3.5/Zend/zend_vm_execute.h:316

#9  0x08505918 in ZEND_DO_FCALL_SPEC_CONST_HANDLER
(execute_data=0x8bcffdc)

at /home/apang/work/php/php-5.3.5/Zend/zend_vm_execute.h:1606

#10 0x085014f5 in execute (op_array=0x8e7bd1c)

---Type return to continue, or q return to quit---

at /home/apang/work/php/php-5.3.5/Zend/zend_vm_execute.h:107

#11 0x084d488e in zend_execute_scripts (type=8, retval=0x0,
file_count=3)

at /home/apang/work/php/php-5.3.5/Zend/zend.c

[PHP-BUG] Bug #53716 [NEW]: segfault in $stmt-execute()

2011-01-11 Thread anthon dot pang at gmail dot com
From: 
Operating system: Ubuntu 10.04
PHP version:  5.3.5
Package:  PDO related
Bug Type: Bug
Bug description:segfault in $stmt-execute()

Description:

The snippet of code shown used is a method from a class that subclasses
Zend_Db_Adapter_Abstract. We make a lot of query() calls, so caching
prepared statements reportedly gives us a 10% performance improvement.



#! /bin/sh

#

# Created by configure



'./configure' \

'--with-mysqli=mysqlnd' \

'--with-pdo-mysql=mysqlnd' \

'--with-zlib' \

'--enable-zip' \

'--with-gd' \

'--with-curl' \

'--enable-mbstring' \

'--enable-debug' \

$@





Test script:
---
public function query($sql, $bind = array())

{

static $cachePreparedStatement = array();



if(isset($cachePreparedStatement[$sql]))

{

if (!is_array($bind)) {

$bind = array($bind);

}

$stmt = $cachePreparedStatement[$sql];

$stmt-execute($bind);

return $stmt;

}



$stmt = parent::query($sql, $bind);

$cachePreparedStatement[$sql] = $stmt;

return $stmt;

}



Expected result:

No crash.

Actual result:
--
Program received signal SIGSEGV, Segmentation fault.

0x003c7816 in ?? () from /lib/tls/i686/cmov/libc.so.6

(gdb) bt

#0  0x003c7816 in ?? () from /lib/tls/i686/cmov/libc.so.6

#1  0x082818c6 in do_fetch (stmt=0x99cb938, do_bind=1,
return_value=0x8f5c78c, 

how=PDO_FETCH_ASSOC, ori=PDO_FETCH_ORI_NEXT, offset=0, return_all=0x0)

at /home/apang/work/php/php-5.3.5/ext/pdo/pdo_stmt.c:1044

#2  0x082825a2 in zim_PDOStatement_fetch (ht=3, return_value=0x8f5c78c, 

return_value_ptr=0x0, this_ptr=0xb7ecba54, return_value_used=1)

at /home/apang/work/php/php-5.3.5/ext/pdo/pdo_stmt.c:1316

#3  0x08501e58 in zend_do_fcall_common_helper_SPEC
(execute_data=0x8bd0dc0)

at /home/apang/work/php/php-5.3.5/Zend/zend_vm_execute.h:316

#4  0x08502415 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER
(execute_data=0x8bd0dc0)

at /home/apang/work/php/php-5.3.5/Zend/zend_vm_execute.h:421

#5  0x085014f5 in execute (op_array=0x971d190)

at /home/apang/work/php/php-5.3.5/Zend/zend_vm_execute.h:107

#6  0x084c6e07 in zend_call_function (fci=0xbfffce28,
fci_cache=0xbfffce4c)

at /home/apang/work/php/php-5.3.5/Zend/zend_execute_API.c:964

#7  0x083849e1 in zif_call_user_func_array (ht=2, return_value=0x9a03db0, 

return_value_ptr=0x0, this_ptr=0x0, return_value_used=0)

at /home/apang/work/php/php-5.3.5/ext/standard/basic_functions.c:4796

#8  0x08501e58 in zend_do_fcall_common_helper_SPEC
(execute_data=0x8bcffdc)

at /home/apang/work/php/php-5.3.5/Zend/zend_vm_execute.h:316

#9  0x08505918 in ZEND_DO_FCALL_SPEC_CONST_HANDLER
(execute_data=0x8bcffdc)

at /home/apang/work/php/php-5.3.5/Zend/zend_vm_execute.h:1606

#10 0x085014f5 in execute (op_array=0x8e7bd1c)

---Type return to continue, or q return to quit---

at /home/apang/work/php/php-5.3.5/Zend/zend_vm_execute.h:107

#11 0x084d488e in zend_execute_scripts (type=8, retval=0x0, file_count=3)

at /home/apang/work/php/php-5.3.5/Zend/zend.c:1194

#12 0x0846a4ee in php_execute_script (primary_file=0xb2e4)

at /home/apang/work/php/php-5.3.5/main/main.c:2265

#13 0x08592c71 in main (argc=2, argv=0xb474)

at /home/apang/work/php/php-5.3.5/sapi/cli/php_cli.c:1193







-- 
Edit bug report at http://bugs.php.net/bug.php?id=53716edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=53716r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=53716r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=53716r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=53716r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=53716r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=53716r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=53716r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=53716r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=53716r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=53716r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=53716r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=53716r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=53716r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=53716r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=53716r=php4
Daylight Savings:

[PHP-BUG] Bug #53690 [NEW]: 5.2svn: swapped memset arguments in struct initialization

2011-01-07 Thread anthon dot pang at gmail dot com
From: 
Operating system: Linux
PHP version:  5.2SVN-2011-01-08 (SVN)
Package:  Zip Related
Bug Type: Bug
Bug description:5.2svn: swapped memset arguments in struct initialization

Description:

This is already fixed in 5.3svn (see bug #53568).



Please backport the fix to 5.2svn:



memset(tm, sizeof(tm), 0);



causes:



ext/zip/lib/zip_dirent.o: In function `memset':

/usr/include/bits/string3.h:83: warning: memset used with constant zero
length parameter; this could be due to transposed parameters






-- 
Edit bug report at http://bugs.php.net/bug.php?id=53690edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=53690r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=53690r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=53690r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=53690r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=53690r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=53690r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=53690r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=53690r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=53690r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=53690r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=53690r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=53690r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=53690r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=53690r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=53690r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=53690r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=53690r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=53690r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=53690r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=53690r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=53690r=mysqlcfg



[PHP-BUG] Req #53593 [NEW]: phpinfo() triggers system timezone warning

2010-12-21 Thread anthon dot pang at gmail dot com
From: 
Operating system: Ubuntu 10.04
PHP version:  5.3.4
Package:  Unknown/Other Function
Bug Type: Feature/Change Request
Bug description:phpinfo() triggers system timezone warning

Description:

phpinfo() should not output raw warning because:



1) it is redundant; the table already states: Default timezone
America/New_York



2) phpinfo() is not a date/time function, even if it uses one internally;
http://php.net/manual/en/function.date-default-timezone-set.php



3) the warning is emitted between rows of an HTML table, resulting in
invalid markup



Propose either suppressing the warning, or pretty printing it, so it
doesn't break the layout.



Test script:
---
?php phpinfo();

Actual result:
--
date



Warning: phpinfo() [function.phpinfo]: It is not safe to rely on the
system's timezone settings. You are *required* to use the date.timezone
setting or the date_default_timezone_set() function. In case you used any
of those methods and you are still getting this warning, you most likely
misspelled the timezone identifier. We selected 'America/New_York' for
'EST/-5.0/no DST' instead in /path_to_script/phpinfo.php on line 1

-- 
Edit bug report at http://bugs.php.net/bug.php?id=53593edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=53593r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=53593r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=53593r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=53593r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=53593r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=53593r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=53593r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=53593r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=53593r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=53593r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=53593r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=53593r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=53593r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=53593r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=53593r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=53593r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=53593r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=53593r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=53593r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=53593r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=53593r=mysqlcfg



Bug #52434 [Bgs]: mysqlnd: host cannot be localhost when connecting to tcp port

2010-09-16 Thread anthon dot pang at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=52434edit=1

 ID: 52434
 User updated by:anthon dot pang at gmail dot com
 Reported by:anthon dot pang at gmail dot com
 Summary:mysqlnd: host cannot be localhost when connecting
 to tcp port
 Status: Bogus
 Type:   Bug
 Package:MySQL related
 Operating System:   Ubuntu 10.04
 PHP Version:5.3.3
 Block user comment: N

 New Comment:

This doesn't have anything to do with the hosts file or DNS resolution.



mysqlnd (rightly or wrongly) specially interprets localhost to mean a
local 

socket, to mimic some of the behavior of MySQL command-line utilities.


Previous Comments:

[2010-09-17 03:50:57] neweracracker at gmail dot com

# localhost name resolution is handled within DNS itself.

#   127.0.0.1   localhost

#   ::1 localhost



Its disabled :)

Still no result hmm.



I blame Microsoft for this. lol


[2010-09-16 23:30:01] paj...@php.net

There are dozen of reports about that on Windows and it is unrelated to
this problem.



A work around for the windows issue will be present in 5.3.4, in the
meantime you can disable ::1 in your windows' host file.


[2010-09-16 23:01:03] neweracracker at gmail dot com

Hello.



I am able to reproduce this issue with:



Windows 7 build 7600 (Ultimate Edition) x86

PHP Version 5.3.3 MSVC6

mysqlnd 5.0.7-dev - 091210 - $Revision: 300533 $ 

MySQL 5.1.50



Steps to reproduce:

1. Download phpmyadmin

2. Extract on html/www/public_html (or similar)

3. Try to connect to mysql (example: login)

4. It won't work, stop php

5. Edit config.inc.php and change localhost to 127.0.0.1

6. No more errors. I guess this needs a fix


[2010-07-25 19:00:49] anthon dot pang at gmail dot com

Ok.  I'll open a Documentation bug for this compat buster.


[2010-07-25 18:33:43] johan...@php.net

The patch won't be added as then localhost has two meanings - one time
meaning use the unixdomain socket in the default location and one time
actually resolve localhost and use TCP as it is taught in many places
that localhost in MySQL has the first meaning we keep it there.




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

http://bugs.php.net/bug.php?id=52434


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=52434edit=1


Bug #52434 [Bgs]: mysqlnd: host cannot be localhost when connecting to tcp port

2010-07-25 Thread anthon dot pang at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=52434edit=1

 ID:   52434
 User updated by:  anthon dot pang at gmail dot com
 Reported by:  anthon dot pang at gmail dot com
-Summary:  mysqlnd: host cannot be a hostname
+Summary:  mysqlnd: host cannot be localhost when connecting to
   tcp port
 Status:   Bogus
 Type: Bug
 Package:  MySQL related
 Operating System: Ubuntu 10.04
 PHP Version:  5.3.3

 New Comment:

Seriously?



http://www.php.net/manual/en/ref.pdo-mysql.connection.php gives two
examples:



mysql:host=localhost;port=3307;dbname=testdb

mysql:unix_socket=/tmp/mysql.sock;dbname=testdb



And my DSN (constructed by Zend Framework) follows the first example. 
Where does it say I have to define the unix socket in php.ini if I
intend to connect using the tcp port?



Here's the fix:



--- mysqlnd.c.bak   2010-07-25 02:47:29.0 -0400

+++ mysqlnd.c   2010-07-25 02:49:37.0 -0400

@@ -635,7 +635,7 @@

char * transport = NULL;

int transport_len;

 #ifndef PHP_WIN32

-   if (host_len == sizeof(localhost) - 1 
!strncasecmp(host, localhost, host_len)) {

+   if (!port  host_len == sizeof(localhost) - 1 
!strncasecmp(host, localhost, host_len)) {

DBG_INF_FMT(socket=%s, socket? socket:n/a);

if (!socket) {

socket = /tmp/mysql.sock;


Previous Comments:

[2010-07-25 06:31:41] dtajchre...@php.net

Tell PHP where your mysql.sock file is via the DSN or
pdo_mysql.default_socket in 

the php.ini file and your error will go away. Your conclusion is way
off. 



http://www.php.net/manual/en/ref.pdo-mysql.connection.php


[2010-07-25 04:42:45] anthon dot pang at gmail dot com

Description:

With PDO_MYSQL, if PHP is linked with mysql client libraries (instead of
mysqlnd), the DSN can contain a host parameter with a hostname, e.g.,
host=localhost.



However, with mysqlnd, the host has to be an ip address, e.g.,
host=127.0.0.1.  This occurs for '--with-mysqli=mysqlnd' or
'--with-pdo-mysql=mysqlnd'.  It appears mysqlnd wants to use a Unix
socket even though the port is explictly specified,



This backward incompatibility surprises users migrating from php 5.2.x
and find their apps suddenly can't connect.



MySQL 5.1.41

Test script:
---
From Zend Framework 1.10.6:



$_isConnected = @mysqli_real_connect(

$this-_connection,

$this-_config['host'],

$this-_config['username'],

$this-_config['password'],

$this-_config['dbname'],

$port

);

Expected result:

Expect it to connect.



Actual result:
--
Warning: PDO::__construct() [pdo.--construct]: [2002] No such file or
directory (trying to connect via unix:///tmp/mysql.sock) in
/var/www/libs/Zend/Db/Adapter/Pdo/Abstract.php on line 129

SQLSTATE[HY000] [2002] No such file or directory






-- 
Edit this bug report at http://bugs.php.net/bug.php?id=52434edit=1


Bug #52434 [Bgs]: mysqlnd: host cannot be localhost when connecting to tcp port

2010-07-25 Thread anthon dot pang at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=52434edit=1

 ID:   52434
 User updated by:  anthon dot pang at gmail dot com
 Reported by:  anthon dot pang at gmail dot com
 Summary:  mysqlnd: host cannot be localhost when connecting to
   tcp port
 Status:   Bogus
 Type: Bug
 Package:  MySQL related
 Operating System: Ubuntu 10.04
 PHP Version:  5.3.3

 New Comment:

Ok.  I'll open a Documentation bug for this compat buster.


Previous Comments:

[2010-07-25 18:33:43] johan...@php.net

The patch won't be added as then localhost has two meanings - one time
meaning use the unixdomain socket in the default location and one time
actually resolve localhost and use TCP as it is taught in many places
that localhost in MySQL has the first meaning we keep it there.


[2010-07-25 09:05:29] anthon dot pang at gmail dot com

Seriously?



http://www.php.net/manual/en/ref.pdo-mysql.connection.php gives two
examples:



mysql:host=localhost;port=3307;dbname=testdb

mysql:unix_socket=/tmp/mysql.sock;dbname=testdb



And my DSN (constructed by Zend Framework) follows the first example. 
Where does it say I have to define the unix socket in php.ini if I
intend to connect using the tcp port?



Here's the fix:



--- mysqlnd.c.bak   2010-07-25 02:47:29.0 -0400

+++ mysqlnd.c   2010-07-25 02:49:37.0 -0400

@@ -635,7 +635,7 @@

char * transport = NULL;

int transport_len;

 #ifndef PHP_WIN32

-   if (host_len == sizeof(localhost) - 1 
!strncasecmp(host, localhost, host_len)) {

+   if (!port  host_len == sizeof(localhost) - 1 
!strncasecmp(host, localhost, host_len)) {

DBG_INF_FMT(socket=%s, socket? socket:n/a);

if (!socket) {

socket = /tmp/mysql.sock;


[2010-07-25 06:31:41] dtajchre...@php.net

Tell PHP where your mysql.sock file is via the DSN or
pdo_mysql.default_socket in 

the php.ini file and your error will go away. Your conclusion is way
off. 



http://www.php.net/manual/en/ref.pdo-mysql.connection.php


[2010-07-25 04:42:45] anthon dot pang at gmail dot com

Description:

With PDO_MYSQL, if PHP is linked with mysql client libraries (instead of
mysqlnd), the DSN can contain a host parameter with a hostname, e.g.,
host=localhost.



However, with mysqlnd, the host has to be an ip address, e.g.,
host=127.0.0.1.  This occurs for '--with-mysqli=mysqlnd' or
'--with-pdo-mysql=mysqlnd'.  It appears mysqlnd wants to use a Unix
socket even though the port is explictly specified,



This backward incompatibility surprises users migrating from php 5.2.x
and find their apps suddenly can't connect.



MySQL 5.1.41

Test script:
---
From Zend Framework 1.10.6:



$_isConnected = @mysqli_real_connect(

$this-_connection,

$this-_config['host'],

$this-_config['username'],

$this-_config['password'],

$this-_config['dbname'],

$port

);

Expected result:

Expect it to connect.



Actual result:
--
Warning: PDO::__construct() [pdo.--construct]: [2002] No such file or
directory (trying to connect via unix:///tmp/mysql.sock) in
/var/www/libs/Zend/Db/Adapter/Pdo/Abstract.php on line 129

SQLSTATE[HY000] [2002] No such file or directory






-- 
Edit this bug report at http://bugs.php.net/bug.php?id=52434edit=1


[PHP-BUG] Bug #52434 [NEW]: mysqlnd: host cannot be a hostname

2010-07-24 Thread anthon dot pang at gmail dot com
From: 
Operating system: Ubuntu 10.04
PHP version:  5.3.3
Package:  MySQL related
Bug Type: Bug
Bug description:mysqlnd: host cannot be a hostname

Description:

With PDO_MYSQL, if PHP is linked with mysql client libraries (instead of
mysqlnd), the DSN can contain a host parameter with a hostname, e.g.,
host=localhost.



However, with mysqlnd, the host has to be an ip address, e.g.,
host=127.0.0.1.  This occurs for '--with-mysqli=mysqlnd' or
'--with-pdo-mysql=mysqlnd'.  It appears mysqlnd wants to use a Unix socket
even though the port is explictly specified,



This backward incompatibility surprises users migrating from php 5.2.x and
find their apps suddenly can't connect.



MySQL 5.1.41

Test script:
---
From Zend Framework 1.10.6:



$_isConnected = @mysqli_real_connect(

$this-_connection,

$this-_config['host'],

$this-_config['username'],

$this-_config['password'],

$this-_config['dbname'],

$port

);

Expected result:

Expect it to connect.



Actual result:
--
Warning: PDO::__construct() [pdo.--construct]: [2002] No such file or
directory (trying to connect via unix:///tmp/mysql.sock) in
/var/www/libs/Zend/Db/Adapter/Pdo/Abstract.php on line 129

SQLSTATE[HY000] [2002] No such file or directory

-- 
Edit bug report at http://bugs.php.net/bug.php?id=52434edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52434r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52434r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=52434r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52434r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=52434r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52434r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=52434r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=52434r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=52434r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=52434r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=52434r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=52434r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=52434r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=52434r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=52434r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=52434r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=52434r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=52434r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=52434r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=52434r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=52434r=mysqlcfg



#50609 [Opn-Bgs]: Feature Request: mbstring - add mb_substr_replace

2010-01-17 Thread anthon dot pang at gmail dot com
 ID:  50609
 User updated by: anthon dot pang at gmail dot com
 Reported By: anthon dot pang at gmail dot com
-Status:  Open
+Status:  Bogus
 Bug Type:Feature/Change Request
 PHP Version: 5.2.12
 New Comment:

mbstring.func_overload is evil.


Previous Comments:


[2009-12-29 23:49:32] anthon dot pang at gmail dot com

Description:

For consistency, there should be a multibyte-aware version of
substr_replace.  At present, it's inconsistent (and can lead to
incorrect results) if strlen and strpos functions are overloaded, and
have those return values passed to substr_replace (which isn't
overloaded).






-- 
Edit this bug report at http://bugs.php.net/?id=50609edit=1



#50609 [NEW]: Feature Request: mbstring - add mb_substr_replace

2009-12-29 Thread anthon dot pang at gmail dot com
From: anthon dot pang at gmail dot com
Operating system: 
PHP version:  5.2.12
PHP Bug Type: Feature/Change Request
Bug description:  Feature Request: mbstring - add mb_substr_replace

Description:

For consistency, there should be a multibyte-aware version of
substr_replace.  At present, it's inconsistent (and can lead to incorrect
results) if strlen and strpos functions are overloaded, and have those
return values passed to substr_replace (which isn't overloaded).


-- 
Edit bug report at http://bugs.php.net/?id=50609edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=50609r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=50609r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=50609r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=50609r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=50609r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=50609r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=50609r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=50609r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=50609r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=50609r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=50609r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=50609r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=50609r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=50609r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=50609r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=50609r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=50609r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=50609r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=50609r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=50609r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=50609r=mysqlcfg