Skip to Content.
Sympa Menu

freetds - [freetds] Weird SP behaviour

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Arnar Birgisson" <ArnarB AT oddi.is>
  • To: <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Weird SP behaviour
  • Date: Thu, 03 Jul 2003 08:56:10 +0000

Hello there..

I've been having some very strange problems for the last few days. Let
me start by noting that this is the case with freetds 0.61, 0.61.1 and
the snapshot as of 2003-07-02.

First of all, only one procedure behaves in this way. The procedures
are being run from a web page, that on each load executes several
procedures and commands. All of them work, except for my latest
addition. This is a straight forward procedure, that simply looks at it
inputs, takes some action and returns 0 on success, or an errorcode
otherwise.

Now.. first of all, I forgot to give the user execute permission on the
procedure. This would normally show up as an error and I could recive
the error message throught php's mssql_get_last_message(). But in the
case of this procedure, no errors at all are returned (I tried
triggering other errors, f.x. leaving out required parameters, same
thing).

The worst problem though, is that the parameters I send don't show up
correctly at the server end! I checked many times and assured myself
that PHP sends these parameters: 1, 0, 'Test string'. SQL profiler
revelast that the sp was called (in 0.61 and 0.61.1) with two very high
numbers, and the contents of some buffer I've never seen, usually
containing "true<controlchar>" or some random string with null bytes.
After upgrading to the snapshot, the parameters changed to 1,1 and the
third one simply not passed at all!

Also.. the procedure was never run, so the changes it should have made
didn't come through. I looked at tdsdump and it showed that it was
iterating through dbresults several times. The procedure doesn't return
any result sets, so I added "select 1" to the top of it. That made the
procedure run and the changes were made, but the parameters were still
passed as 1,1 although I asked for 1,0,'Test string'.

In all cases, the connection seems to be dropped after this fiasco, but
silently, no error messages show up anywhere, in my script, in tdsdump
or in the SQL Server logs.

I'm simply stumped here and I don't know what to do next. Any ideas?

Arnar




Archive powered by MHonArc 2.6.24.

Top of Page