Search

Error in long query crashes PHP-interpreter (MSSQL PDO driver) by Radiant1

Closed
as Won't Fix Help for as Won't Fix

1
0
Sign in
to vote
Type: Bug
ID: 774119
Opened: 12/12/2012 5:56:24 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
Using the "Microsoft Drivers 3.0 for PHP for SQL Server", PHP 5.4 (NTS), PDO, Windows 8, SQL Server Express 2012.

With PDO attribute ATTR_ERRMODE set to ERRMODE_WARNING and executing a long statement (longer than 256 characters), the memory of the PHP interpreter will be corrupted, causing random behaviour, weird messages and crashes.

This makes debugging long statements impossible.
Details (expand)

Product Language

English

Version

SQL Server 2012 - Express Edition

Category

SQL Express

Operating System

Other

Operating System Language

English

Steps to Reproduce

<?php
    $db = new PDO("sqlsrv:Server=WS30\\SQLEXPRESS;Database=testdb", 'test', 'test');
    $db->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING );
    
    $q = $db->prepare(str_repeat('test', 33));
    $q->execute();
?>

Actual Results

PHP Warning: ░Ëê☺░Ëê☺t*ù☺ in test.php on line 6

Warning: ░Ëê☺░Ëê☺t*ù☺ in test.php on line 6

Expected Results

PHP Warning: PDOStatement::execute(): SQLSTATE[42000]: Syntax error or access v
iolation: 2812 [Microsoft][SQL Server Native Client 11.0][SQL Server]Could not f
ind stored procedure 'testtesttesttesttesttesttesttesttesttesttesttesttesttestte
sttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest'. in test.php on line 6

Platform

X64

Virtualization

 
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 3/22/2013 at 2:41 PM
Thanks for your feedback. Unfortunately we will not be able to address this because of other priority work.
Posted by Microsoft on 1/7/2013 at 2:16 PM
Thanks, we will investigate this.
Sign in to post a workaround.