PHP  
 PHP_5_4
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/pdo_mysql/tests/bug_39858.phpt ('Bug #39858 (Lost connection to MySQL server during query by a repeated call stored proced)')

Script

1: <?php
2:
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR 'mysql_pdo_test.inc');
3:
$db MySQLPDOTest::factory();
4:
$db->setAttribute(PDO::ATTR_STRINGIFY_FETCHEStrue);
5:
6: function 
bug_39858($db) {
7:
8:     
$db->exec("DROP PROCEDURE IF EXISTS p");
9:     
$db->exec("
10:         CREATE PROCEDURE p()
11:             NOT DETERMINISTIC
12:             CONTAINS SQL
13:             SQL SECURITY DEFINER
14:             COMMENT ''
15:         BEGIN
16:             SELECT 2 * 2;
17:         END;"
);
18:
19:     
$stmt $db->prepare("CALL p()");
20:     
$stmt->execute();
21:     do {
22:         
var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
23:     } while (
$stmt->nextRowset());
24:
25:     
$stmt $db->prepare("CALL p()");
26:     
$stmt->execute();
27:     do {
28:         
var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
29:     } while (
$stmt->nextRowset());
30:     
$stmt->closeCursor();
31:
32: }
33:
34:
printf("Emulated Prepared Statements...\n");
35:
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES1);
36:
bug_39858($db);
37:
38:
printf("Native Prepared Statements...\n");
39:
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES0);
40:
bug_39858($db);
41:
42: print 
"done!";
43:
?>
44:

Expected

Emulated Prepared Statements...
array(1) {
  [0]=>
  array(1) {
    [%u|b%"2 * 2"]=>
    %unicode|string%(1) "4"
  }
}
array(1) {
  [0]=>
  array(1) {
    [%u|b%"2 * 2"]=>
    %unicode|string%(1) "4"
  }
}
Native Prepared Statements...
array(1) {
  [0]=>
  array(1) {
    [%u|b%"2 * 2"]=>
    %unicode|string%(1) "4"
  }
}
array(1) {
  [0]=>
  array(1) {
    [%u|b%"2 * 2"]=>
    %unicode|string%(1) "4"
  }
}
done!

Output

Emulated Prepared Statements...
array(1) {
  [0]=>
  array(1) {
    ["2 * 2"]=>
    string(1) "4"
  }
}

Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error in /var/php_gcov/PHP_5_4/ext/pdo_mysql/tests/bug_39858.php on line 22
array(0) {
}
array(1) {
  [0]=>
  array(1) {
    ["2 * 2"]=>
    string(1) "4"
  }
}

Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error in /var/php_gcov/PHP_5_4/ext/pdo_mysql/tests/bug_39858.php on line 28
array(0) {
}
Native Prepared Statements...
array(1) {
  [0]=>
  array(1) {
    ["2 * 2"]=>
    string(1) "4"
  }
}
array(1) {
  [0]=>
  array(1) {
    ["2 * 2"]=>
    string(1) "4"
  }
}
done!

Diff

009+ 
010+ Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error in /var/php_gcov/PHP_5_4/ext/pdo_mysql/tests/bug_39858.php on line 22
011+ array(0) {
012+ }
020+ 
021+ Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error in /var/php_gcov/PHP_5_4/ext/pdo_mysql/tests/bug_39858.php on line 28
022+ array(0) {
023+ }

 

Generated at Thu, 16 Oct 2014 05:27:17 +0000 (6 days ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.