PHP PDO (MSSQL) inserts control characters around offset 0x0235
<p>I'm using PDO (php5-sybase) (say) like so:</p>
<blockquote>
<p>$stmt = $pdoMSSQL-&gt;prepare(&quot;INSERT INTO table (field) VALUES :val&quot;);
$stmt-&gt;bindValue(&quot;:val&quot;,'whatever');</p>
<p>$stmt-&gt;execute();</p>
</blockquote>
<p>Assume the actual SQL is much longer (and this happens with ANY SQL, not just INSERT)</p>
<p>When looking at a packet capture (of a NON fragmented packet, &lt; 1000 data bytes) containing the SQL whilst enroute to TCP 1433 of the MSSQL server there is invariably a set of ?control? characters like \x01 \x01 \x00 \xa8 \x00 \x00 \x00 \x00 at offset 0x235, in the middle of the query text.</p>
<p>If the query isn't big enough to reach 0x235 then the original text is verbatim per the prepare and bind statements, no wierd string.</p>
<p>Does any one know if this is controlled by a setting somewhere?  (I only have php clients that I can packet capture from, I've confirmed the above on more than one environment)</p>
<p>Dave</p>