Bug #71294 [Csd->Nab]: real_escape_string(0) -> NULL

From: Date: Wed, 06 Jan 2016 19:32:36 +0000
Subject: Bug #71294 [Csd->Nab]: real_escape_string(0) -> NULL
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-198454@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71294&edit=1

 ID:                 71294
 Updated by:         requinix@php.net
 Reported by:        sasf54 at gmail dot com
 Summary:            real_escape_string(0) -> NULL
-Status:             Closed
+Status:             Not a bug
 Type:               Bug
 Package:            MySQLi related
 Operating System:   Linux - Gentoo
 PHP Version:        5.6.16
 Block user comment: N
 Private report:     N

 New Comment:

.


Previous Comments:
------------------------------------------------------------------------
[2016-01-06 07:22:52] sasf54 at gmail dot com

Sorry for bothering, found the bug in my DB access code....

------------------------------------------------------------------------
[2016-01-06 07:14:33] sasf54 at gmail dot com

requinix@php.net: No, the output is NULL (not string)
Mysql error: column XXX cannot be NULL
as generated the full sql:
update TABLE set VAL1=NULL, VAL2="valid' where id=123;
(VAL1 cannot be null (for example, boolean, tinyint(1)))

------------------------------------------------------------------------
[2016-01-06 06:39:30] requinix@php.net

because it sounds like you're saying the output is the string "NULL".

------------------------------------------------------------------------
[2016-01-06 06:38:02] requinix@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.



------------------------------------------------------------------------
[2016-01-06 06:24:09] sasf54 at gmail dot com

Description:
------------
$CONNECTION = new mysqli($this->CFG->db_host, $this->CFG->db_user,
$this->CFG->db_pass, $this->CFG->db_dbname, $this->CFG->db_port);
echo $CONNECTION->real_escape_string(0);

Expected result:
----------------
real_escape_string(0) => 0

Actual result:
--------------
real_escape_string(0) => NULL
(Mysql server has issues with this, if used in update)


------------------------------------------------------------------------



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


Thread (6 messages)

« previous php.bugs (#198454) next »