Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #35337 : prepare update into longtext column broken
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 24th April 10:30
php-bugs
External User
 
Posts: 1
Default #35337 : prepare update into longtext column broken



From: bill dot finn at sellingsource dot com
Operating system: Gentoo 2.6.9
PHP version: 6CVS-2005-11-19 (snap)
PHP Bug Type: MySQLi related
Bug description: prepare update into longtext column broken

Description:
------------
Performing an update into a non-null longtext column using prepare syntax.
Example code works in php 5.0.x. Upgraded to 5.1.x and it started
entering variations of empty strings, 0, or 0000-00-00 depending on how
much data I was trying to enter. In a test that allows null values, it
enters null.


(mysql 5.0.13 && mysql 5.0.15)

Reproduce code:
---------------
CREATE TABLE test (col1 longtext not null);
<?php
$data = "whatever, some string";
$mysqli = new mysqli( HOST, USER, PASS, DB, PORT );
$query = "INSERT INTO test SET col1 = ?";
$prepared = $mysqli->prepare( $query );
$prepared->bind_param('s', $data );
$prepared->execute();
$prepared->close();
?>

Expected result:
----------------
contents of $data inserted into col1 of table.

Actual result:
--------------
SELECT col1 FROM test
shows one of three things:
0000-00-00
0
empty string

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


  sponsored links


2 24th April 14:05
External User
 
Posts: 1
Default #35337 : prepare update into longtext column broken



ID: 35337
Updated by: tony2001@php.net
Reported By: bill dot finn at sellingsource dot com
-Status: Open
+Status: Feedback
Bug Type: MySQLi related
Operating System: Gentoo 2.6.9
PHP Version: 6CVS-2005-11-19 (snap)
New Comment:

Please try using this CVS snapshot:

http://snaps.php.net/php5-latest.tar.gz

For Windows:

http://snaps.php.net/win32/php5-win32-latest.zip


Previous Comments:
------------------------------------------------------------------------

[2005-11-22 19:43:44] bill dot finn at sellingsource dot com

Description:
------------
Performing an update into a non-null longtext column using prepare
syntax. Example code works in php 5.0.x. Upgraded to 5.1.x and it
started entering variations of empty strings, 0, or 0000-00-00
depending on how much data I was trying to enter. In a test that
allows null values, it enters null.


(mysql 5.0.13 && mysql 5.0.15)

Reproduce code:
---------------
CREATE TABLE test (col1 longtext not null);
<?php
$data = "whatever, some string";
$mysqli = new mysqli( HOST, USER, PASS, DB, PORT );
$query = "INSERT INTO test SET col1 = ?";
$prepared = $mysqli->prepare( $query );
$prepared->bind_param('s', $data );
$prepared->execute();
$prepared->close();
?>

Expected result:
----------------
contents of $data inserted into col1 of table.

Actual result:
--------------
SELECT col1 FROM test
shows one of three things:
0000-00-00
0
empty string


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


--
Edit this bug report at http://bugs.php.net/?id=35337&edit=1
  Reply With Quote
3 29th April 08:47
php-bugs
External User
 
Posts: 1
Default #35337 : prepare update into longtext column broken


ID: 35337
User updated by: bill dot finn at sellingsource dot com
Reported By: bill dot finn at sellingsource dot com
-Status: No Feedback
+Status: Closed
Bug Type: MySQLi related
Operating System: Gentoo 2.6.9
PHP Version: 6CVS-2005-11-19 (snap)
New Comment:

tested with 2005-11-29, works.


Previous Comments:
------------------------------------------------------------------------

[2005-11-30 01:00:10] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

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

[2005-11-22 22:31:31] tony2001@php.net

Please try using this CVS snapshot:

http://snaps.php.net/php5-latest.tar.gz

For Windows:

http://snaps.php.net/win32/php5-win32-latest.zip

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

[2005-11-22 19:43:44] bill dot finn at sellingsource dot com

Description:
------------
Performing an update into a non-null longtext column using prepare
syntax. Example code works in php 5.0.x. Upgraded to 5.1.x and it
started entering variations of empty strings, 0, or 0000-00-00
depending on how much data I was trying to enter. In a test that
allows null values, it enters null.


(mysql 5.0.13 && mysql 5.0.15)

Reproduce code:
---------------
CREATE TABLE test (col1 longtext not null);
<?php
$data = "whatever, some string";
$mysqli = new mysqli( HOST, USER, PASS, DB, PORT );
$query = "INSERT INTO test SET col1 = ?";
$prepared = $mysqli->prepare( $query );
$prepared->bind_param('s', $data );
$prepared->execute();
$prepared->close();
?>

Expected result:
----------------
contents of $data inserted into col1 of table.

Actual result:
--------------
SELECT col1 FROM test
shows one of three things:
0000-00-00
0
empty string


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


--
Edit this bug report at http://bugs.php.net/?id=35337&edit=1
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666