Skip to Content.
Sympa Menu

freetds - Re: [freetds] PHP script dies when performing a query containing CASTor CONVERT

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "" <Murray.Elliot AT sac.co.uk>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>, "Thompson, Bill D (London)" <bill_d_thompson AT ml.com>
  • Subject: Re: [freetds] PHP script dies when performing a query containing CASTor CONVERT
  • Date: Fri, 14 Oct 2005 16:43:27 +0000

Hi Bill

Yes, the log stops there. It should go on to the next row... and the next -
ad nauseam.
Something in the return appears to be killing PHP, but I can see no reason
for it.

I'm completely stumped as I have no idea how PHP calls the dblibrary
functions either!

Having looked through the logs from a successful query, I can see no calls to
dbbind.

Regards
Murray

> ...And the log stops there ?
>
> I suspect it's not the cast that's the problem, it's the resulting
> float datatype. You are happily getting results back from the server,
> just not processing them correctly.
>
> I can't see any call to dbbind(), which you would have to make to get
> the returned value back into your program. dbbind would usually be
> called between dbresults() and dbnextrow() I don't know how PHP calls
> the various dblibrary functions though.
>
> Is this a clue ?
>
> Bill
>
>
>
> -----Original Message-----
> From: freetds-bounces AT lists.ibiblio.org
> [mailto:freetds-bounces AT lists.ibiblio.org]
> Sent: 14 October 2005 17:06
> To: freetds AT lists.ibiblio.org
> Subject: [freetds] PHP script dies when performing a query containing
> CASTor CONVERT
>
>
> I have a rather frustrating problem with php/freetds
>
> freetds: 0.63
> php: 4.4.0
> apache: 2.0.54
> Web Platform: Solaris 9
> DB Platform: SQL 2000 on Windows NT OS
>
> Symptom:
>
> performing a query such as
>
> SELECT AVG(cast(wr.gstage as float)) as gstage from WeekReport wr
>
> kills the script stone dead (resulting in a "the page cannot be
> displayed" browser
> message).
>
> Whereas SELECT AVG(wr.cplant) as cplant from WeekReport wr
>
> works fine (I DO need to do the cast).
>
> The log looks like this:
>
> 15:59:26.134524 Sending packet
> 0000 01 01 00 5a 00 00 00 00-53 45 4c 45 43 54 20 61 |...Z.... SELECT
> a| 0010 76 67 28 63 61 73 74 28-77 72 2e 67 73 74 61 67 |vg(cast(
> wr.gstag| 0020 65 20 61 73 20 66 6c 6f-61 74 29 29 20 61 73 20 |e as
> flo at)) as | 0030 67 73 74 61 67 65 0d 0a-20 20 20 20 20 20 20 20
> |gstage.. | 0040 20 20 20 20 20 20 20 20-66 72 6f 6d 20 57 65
> 65 | from Wee| 0050 6b 52 65 70 6f 72 74 20-77 72
> |kReport wr|
>
> 15:59:26.134660 in dbsqlok()
> 15:59:26.161323 Received header
> 0000 04 01 00 2e 00 35 01 00- |.....5..|
>
> 15:59:26.161357 Received packet
> 0000 a0 00 07 06 67 73 74 61-67 65 a1 00 06 00 0e 00 |....gsta
> ge......| 0010 09 6d 08 d1 08 40 45 e5-7b 75 a9 d4 5a fd 00 10
> |.m...@E. {u..Z...| 0020 00 c1 00 00 00 01 -
> |......|
>
> 15:59:26.161409 dbsqlok() marker is a0
> 15:59:26.161421 dbsqlok() found result token
> 15:59:26.161432 dbresults()
> 15:59:26.161441 tds_free_all_results()
> 15:59:26.161452 processing result tokens. marker is a0(COLNAME)
> 15:59:26.161464 tds_get_string: reading 6 from wire to give 6 to
> client. 15:59:26.161475 tds_free_all_results() 15:59:26.161492
> processing result tokens. marker is a1(COLFMT) 15:59:26.161505
> processing result. type = 109(float-null), varint_size 1
> 15:59:26.161517 dbresults() process_result_tokens returned result_type
> = 4049 retcode = 1 15:59:26.161528 processing result tokens. marker
> is d1(ROW) 15:59:26.161538 dbresults() process_result_tokens returned
> result_type = 4040 retcode = 1 15:59:26.161548 dbnextrow()
> 15:59:26.161558 dbnextrow() dbresults_state = 2 15:59:26.161567
> processing row tokens. marker is d1(ROW) 15:59:26.161578 processing
> row. column is 0 varint size = 1 15:59:26.161588 processing row.
> column size is 8 15:59:26.161598 clearing column 0 NULL bit
> 15:59:26.161609 leaving dbnextrow() returning -1 15:59:26.161623
> dbdatlen() type = 109 15:59:26.161633 leaving dbdatlen() returning 8
>
> Any help would be gratefully received as this is driving me mad..
>
> Thanks in advance
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
> --------------------------------------------------------
>
> If you are not an intended recipient of this e-mail, please notify the
> sender, delete it and do not read, act upon, print, disclose, copy,
> retain or redistribute it. Click here for important additional terms
> relating to this e-mail. http://www.ml.com/email_terms/
> --------------------------------------------------------


Murray Elliot
IS Development Manager
Scottish Agricultural College, King's Buildings,
Edinburgh, EH9 3JG, Tel: 0131 535 4108

This e-mail message is confidential and for use by the addressee only. If the
message
is received by anyone other than the addressee, please return the message to
the
sender by replying to it and then delete the message from your computer.
Internet e-
mails are not necessarily secure. SAC does not accept responsibility for
changes made
to this message after it was sent.

Whilst all reasonable care has been taken to avoid the transmission of
viruses, it is the
responsibility of the recipient to ensure that the onward transmission,
opening or use of
this message and any attachments will not adversely affect its systems or
data. No
responsibility is accepted by SAC in this regard and the recipient should
carry out such
virus and other checks as it considers appropriate.




Archive powered by MHonArc 2.6.24.

Top of Page