php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50811 mssql_bind fails to bind parameters greater than 256 characters long
Submitted: 2010-01-20 23:05 UTC Modified: 2013-02-18 00:34 UTC
Votes:7
Avg. Score:4.6 ± 0.5
Reproduced:7 of 7 (100.0%)
Same Version:4 (57.1%)
Same OS:3 (42.9%)
From: paul at dezinnia dot com Assigned:
Status: No Feedback Package: MSSQL related
PHP Version: 5.2.12 OS: Windows Vista
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: paul at dezinnia dot com
New email:
PHP Version: OS:

 

 [2010-01-20 23:05 UTC] paul at dezinnia dot com
Description:
------------
using the mssql database extension, i am attempting to bind a parameter 
of type nvarchar(1999) to a stored procedure.  Everything works as 
expected except when the length of the parameter exceeds 256 chracters.  

In the case of a parameter length in excess of 256 characters the 
following message is returned by the DB server.  "Procedure or function 
'FunctionName' expects parameter '@ParameterName', which was not 
supplied."



Reproduce code:
---------------
---
From manual page: function.mssql-bind
---

this code won't reproduce the bug since you don't have access to my database...but i'm including it here so you you can be sure i'm not just getting a syntax error...

$sp = mssql_init("dbo.AddSnippet", $db);

$b = mssql_bind($sp, "@SnippetName", $snippetName, SQLVARCHAR, false, false, 120);
$b = mssql_bind($sp, "@SnippetDescription", $snippetDescription, SQLVARCHAR, false, false, 480);
$b = mssql_bind($sp, "@SnippetContent", $snippetContent, SQLVARCHAR, false, false, 1999);
$b = mssql_bind($sp, "@tagstring", $tagstring, SQLVARCHAR, false, false, 1999);
$b = mssql_bind($sp, "@TagUserID", $tagUserID, SQLINT4);

mssql_execute($sp);

Expected result:
----------------
The stored procedure should add a record to the database and is designed 
to store nvarchar values of lengths up to 1999 characters.

Actual result:
--------------
When the parameter length exceeds 256 characters, an error occurs.  

When the parameter length is <=256 characters, no error occurs.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-03-18 16:40 UTC] kalle@php.net
-Status: Open +Status: Feedback
 [2010-03-18 16:40 UTC] kalle@php.net
Does mssql_bind() issue any warning or return false?
 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Feb 02 17:03:42 2023 UTC