#43708 [Fbk->Opn]: mysqli_stmt_affected_rows return values don't match documentation

2008-02-25 Thread mo at modejong dot com
 ID:   43708
 User updated by:  mo at modejong dot com
 Reported By:  mo at modejong dot com
-Status:   Feedback
+Status:   Open
 Bug Type: MySQLi related
 Operating System: WinXP
 PHP Version:  5.2.5
 New Comment:

The server version is reported as:

5.0.45-community-nt-log

I don't know how to determine what the version of
libmysql.dll is for this install. I got it as part
of xampplite 1.6.4.


Previous Comments:


[2008-02-18 15:23:45] [EMAIL PROTECTED]

What MySQL version are you using and what version of the libmysql (I
assume you do not use mysqlnd, do you) do you use? 

I'm asking because of http://bugs.mysql.com/bug.php?id=23383 . 

Ulf



[2007-12-29 21:32:26] mo at modejong dot com

Description:

The mysqli_stmt_affected_rows implementation does not
match the documentation for this function WRT return
values when no rows are matched or when a SQL error
is found. If you run the source code below, it should
output:

1 (a)
2 (b)
mysqli_stmt_affected_rows(): int(1)
1 (b)
2 (b)
mysqli_stmt_affected_rows(): int(2)
1 (c)
2 (c)
mysqli_stmt_affected_rows(): int(0)
mysqli_stmt_affected_rows(): int(-1)

When run in PHP 5.2.4, the final two lines are:

mysqli_stmt_affected_rows(): int(-1)
mysqli_stmt_affected_rows(): NULL

The docs explicitly state that 0 will be returned
when no rows match and -1 will be returned when
an SQL error is found. The PHP impl should match
the documentation.

Reproduce code:
---


Expected result:

See description

Actual result:
--
See description





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


#43914 [NEW]: Invalid invocation of non-static class function

2008-01-22 Thread mo at modejong dot com
From: mo at modejong dot com
Operating system: WinXP
PHP version:  5.2.5
PHP Bug Type: Class/Object related
Bug description:  Invalid invocation of non-static class function

Description:

PHP allows invocation of an instance method in a class that
is unrelated to the current class. I would think that the
correct thing to do in this case is to generate an error
at runtime when this specific case is detected.

Reproduce code:
---
class One {
  function foo() {
$isnull = ($this == NULL) ? "TRUE" : "FALSE";
$instanceof = ($this instanceof One) ? "TRUE" : "FALSE";
print "One::foo is \$this null ($isnull) : is instanceof One
($instanceof)\n";
  }
}

class Two {
  function foo() {
$isnull = ($this == NULL) ? "TRUE" : "FALSE";
$instanceof = ($this instanceof Two) ? "TRUE" : "FALSE";
print "Two::foo is \$this null ($isnull) : is instanceof Two
($instanceof)\n";
return One::foo();
  }
}

$obj = new Two;
$obj->foo();


Expected result:

When executed, PHP prints:

Two::foo is $this null (FALSE) : is instanceof Two (TRUE)
One::foo is $this null (FALSE) : is instanceof One (FALSE)

It should generate an error here since Two is unrelated
to class One. This check should be done when invoking
the instance method, if the $this ref is not NULL then
the type of $this should be checked before the instance
method can be invoked in One.

I already read bug 42559, it seems to have been rejected
as "not a bug", but this issue is clearly a bug. Use of
a method call like CLASS::METHOD inside a class def does
not mean the method being invoked is static.


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


#43742 [NEW]: mysql_field_name does not return FALSE on error

2008-01-03 Thread mo at modejong dot com
From: mo at modejong dot com
Operating system: WinXP
PHP version:  5.2.5
PHP Bug Type: MSSQL related
Bug description:  mysql_field_name does not return FALSE on error

Description:

The mysql_field_name API should return FALSE on errror,
that is what the docs state, but the impl returns NULL.

Here is what the current code returns:

mysql_field_name($res):
Warning: Wrong parameter count for mysql_field_name() in
C:\caucho_dev\trunk\qa\php\f.qa on line 11
NULL

Reproduce code:
---




Expected result:

Should return FALSE.


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


#43708 [NEW]: mysqli_stmt_affected_rows return values don't match documentation

2007-12-29 Thread mo at modejong dot com
From: mo at modejong dot com
Operating system: WinXP
PHP version:  5.2.5
PHP Bug Type: MySQLi related
Bug description:  mysqli_stmt_affected_rows return values don't match 
documentation

Description:

The mysqli_stmt_affected_rows implementation does not
match the documentation for this function WRT return
values when no rows are matched or when a SQL error
is found. If you run the source code below, it should
output:

1 (a)
2 (b)
mysqli_stmt_affected_rows(): int(1)
1 (b)
2 (b)
mysqli_stmt_affected_rows(): int(2)
1 (c)
2 (c)
mysqli_stmt_affected_rows(): int(0)
mysqli_stmt_affected_rows(): int(-1)

When run in PHP 5.2.4, the final two lines are:

mysqli_stmt_affected_rows(): int(-1)
mysqli_stmt_affected_rows(): NULL

The docs explicitly state that 0 will be returned
when no rows match and -1 will be returned when
an SQL error is found. The PHP impl should match
the documentation.

Reproduce code:
---


Expected result:

See description

Actual result:
--
See description

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