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/pdo_mysql_stmt_nextrowset.phpt ('MySQL PDOStatement->nextRowSet()')

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:     
MySQLPDOTest::createTestTable($db);
7:
8:     
$stmt $db->query('SELECT id FROM test');
9:     if (
false !== ($tmp $stmt->nextRowSet()))
10:         
printf("[002] Expecting false got %s\n"var_export($tmptrue));
11:
12:     
// TODO: should give a warning, but its PDO, let's ignore the missing warning for now
13:     
if (false !== ($tmp $stmt->nextRowSet(1)))
14:         
printf("[003] Expecting false got %s\n"var_export($tmptrue));
15:
16:     function 
test_proc1($db) {
17:
18:         
$stmt $db->query('SELECT @VERSION as _version');
19:         
$tmp $stmt->fetch(PDO::FETCH_ASSOC);
20:         
assert($tmp['_version'] === NULL);
21:         while (
$stmt->fetch()) ;
22:
23:         
$db->exec('DROP PROCEDURE IF EXISTS p');
24:         
$db->exec('CREATE PROCEDURE p(OUT ver_param VARCHAR(25)) BEGIN SELECT VERSION() INTO ver_param; END;');
25:         
$db->exec('CALL p(@VERSION)');
26:         
$stmt $db->query('SELECT @VERSION as _version');
27:         
var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
28:         
var_dump($stmt->nextRowSet());
29:
30:     }
31:
32:     function 
test_proc2($db) {
33:
34:         
$db->exec('DROP PROCEDURE IF EXISTS p');
35:         
$db->exec('CREATE PROCEDURE p() BEGIN SELECT id FROM test ORDER BY id ASC LIMIT 3; SELECT id, label FROM test WHERE id < 4 ORDER BY id DESC LIMIT 3; END;');
36:         
$stmt $db->query('CALL p()');
37:         do {
38:             
var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
39:         } while (
$stmt->nextRowSet());
40:         
var_dump($stmt->nextRowSet());
41:
42:     }
43:
44:     try {
45:
46:         
// Emulated PS
47:         
printf("Emulated PS...\n");
48:         
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES1);
49:
50:         
$db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY1);
51:         
test_proc1($db);
52:         
test_proc2($db);
53:
54:         
$db MySQLPDOTest::factory();
55:         
$db->setAttribute(PDO::ATTR_STRINGIFY_FETCHEStrue);
56:         
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES1);
57:         
$db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY0);
58:         
test_proc1($db);
59:         
test_proc2($db);
60:
61:         
// Native PS
62:         
printf("Native PS...\n");
63:         
$db MySQLPDOTest::factory();
64:         
$db->setAttribute(PDO::ATTR_STRINGIFY_FETCHEStrue);
65:         
$db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY1);
66:         
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES0);
67:         
test_proc1($db);
68:         
test_proc2($db);
69:
70:         
$db MySQLPDOTest::factory();
71:         
$db->setAttribute(PDO::ATTR_STRINGIFY_FETCHEStrue);
72:         
$db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY0);
73:         
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES0);
74:
75:         
test_proc1($db);
76:         
test_proc2($db);
77:
78:         @
$db->exec('DROP PROCEDURE IF EXISTS p');
79:
80:     } catch (
PDOException $e) {
81:         
printf("[001] %s [%s] %s\n",
82:             
$e->getMessage(), $db->errorCode(), implode(' '$db->errorInfo()));
83:     }
84:
85:     print 
"done!";
86:
?>
87:

Expected

Emulated PS...
array(1) {
  [0]=>
  array(1) {
    [%u|b%"_version"]=>
    %unicode|string%(%d) "%s"
  }
}
bool(false)
array(3) {
  [0]=>
  array(1) {
    [%u|b%"id"]=>
    %unicode|string%(1) "1"
  }
  [1]=>
  array(1) {
    [%u|b%"id"]=>
    %unicode|string%(1) "2"
  }
  [2]=>
  array(1) {
    [%u|b%"id"]=>
    %unicode|string%(1) "3"
  }
}
array(3) {
  [0]=>
  array(2) {
    [%u|b%"id"]=>
    %unicode|string%(1) "3"
    [%u|b%"label"]=>
    %unicode|string%(1) "c"
  }
  [1]=>
  array(2) {
    [%u|b%"id"]=>
    %unicode|string%(1) "2"
    [%u|b%"label"]=>
    %unicode|string%(1) "b"
  }
  [2]=>
  array(2) {
    [%u|b%"id"]=>
    %unicode|string%(1) "1"
    [%u|b%"label"]=>
    %unicode|string%(1) "a"
  }
}
bool(false)
array(1) {
  [0]=>
  array(1) {
    [%u|b%"_version"]=>
    %unicode|string%(%d) "%s"
  }
}
bool(false)
array(3) {
  [0]=>
  array(1) {
    [%u|b%"id"]=>
    %unicode|string%(1) "1"
  }
  [1]=>
  array(1) {
    [%u|b%"id"]=>
    %unicode|string%(1) "2"
  }
  [2]=>
  array(1) {
    [%u|b%"id"]=>
    %unicode|string%(1) "3"
  }
}
array(3) {
  [0]=>
  array(2) {
    [%u|b%"id"]=>
    %unicode|string%(1) "3"
    [%u|b%"label"]=>
    %unicode|string%(1) "c"
  }
  [1]=>
  array(2) {
    [%u|b%"id"]=>
    %unicode|string%(1) "2"
    [%u|b%"label"]=>
    %unicode|string%(1) "b"
  }
  [2]=>
  array(2) {
    [%u|b%"id"]=>
    %unicode|string%(1) "1"
    [%u|b%"label"]=>
    %unicode|string%(1) "a"
  }
}
bool(false)
Native PS...
array(1) {
  [0]=>
  array(1) {
    [%u|b%"_version"]=>
    %unicode|string%(%d) "%s"
  }
}
bool(false)
array(3) {
  [0]=>
  array(1) {
    [%u|b%"id"]=>
    %unicode|string%(1) "1"
  }
  [1]=>
  array(1) {
    [%u|b%"id"]=>
    %unicode|string%(1) "2"
  }
  [2]=>
  array(1) {
    [%u|b%"id"]=>
    %unicode|string%(1) "3"
  }
}
array(3) {
  [0]=>
  array(2) {
    [%u|b%"id"]=>
    %unicode|string%(1) "3"
    [%u|b%"label"]=>
    %unicode|string%(1) "c"
  }
  [1]=>
  array(2) {
    [%u|b%"id"]=>
    %unicode|string%(1) "2"
    [%u|b%"label"]=>
    %unicode|string%(1) "b"
  }
  [2]=>
  array(2) {
    [%u|b%"id"]=>
    %unicode|string%(1) "1"
    [%u|b%"label"]=>
    %unicode|string%(1) "a"
  }
}
bool(false)
array(1) {
  [0]=>
  array(1) {
    [%u|b%"_version"]=>
    %unicode|string%(%d) "%s"
  }
}
bool(false)
array(3) {
  [0]=>
  array(1) {
    [%u|b%"id"]=>
    %unicode|string%(1) "1"
  }
  [1]=>
  array(1) {
    [%u|b%"id"]=>
    %unicode|string%(1) "2"
  }
  [2]=>
  array(1) {
    [%u|b%"id"]=>
    %unicode|string%(1) "3"
  }
}
array(3) {
  [0]=>
  array(2) {
    [%u|b%"id"]=>
    %unicode|string%(1) "3"
    [%u|b%"label"]=>
    %unicode|string%(1) "c"
  }
  [1]=>
  array(2) {
    [%u|b%"id"]=>
    %unicode|string%(1) "2"
    [%u|b%"label"]=>
    %unicode|string%(1) "b"
  }
  [2]=>
  array(2) {
    [%u|b%"id"]=>
    %unicode|string%(1) "1"
    [%u|b%"label"]=>
    %unicode|string%(1) "a"
  }
}
bool(false)
done!

Output

Emulated PS...
array(1) {
  [0]=>
  array(1) {
    ["_version"]=>
    string(6) "5.1.73"
  }
}
bool(false)
array(3) {
  [0]=>
  array(1) {
    ["id"]=>
    string(1) "1"
  }
  [1]=>
  array(1) {
    ["id"]=>
    string(1) "2"
  }
  [2]=>
  array(1) {
    ["id"]=>
    string(1) "3"
  }
}
array(3) {
  [0]=>
  array(2) {
    ["id"]=>
    string(1) "3"
    ["label"]=>
    string(1) "c"
  }
  [1]=>
  array(2) {
    ["id"]=>
    string(1) "2"
    ["label"]=>
    string(1) "b"
  }
  [2]=>
  array(2) {
    ["id"]=>
    string(1) "1"
    ["label"]=>
    string(1) "a"
  }
}

Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error in /var/php_gcov/PHP_5_4/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.php on line 38
array(0) {
}
bool(false)
array(1) {
  [0]=>
  array(1) {
    ["_version"]=>
    string(6) "5.1.73"
  }
}
bool(false)
array(3) {
  [0]=>
  array(1) {
    ["id"]=>
    string(1) "1"
  }
  [1]=>
  array(1) {
    ["id"]=>
    string(1) "2"
  }
  [2]=>
  array(1) {
    ["id"]=>
    string(1) "3"
  }
}
array(3) {
  [0]=>
  array(2) {
    ["id"]=>
    string(1) "3"
    ["label"]=>
    string(1) "c"
  }
  [1]=>
  array(2) {
    ["id"]=>
    string(1) "2"
    ["label"]=>
    string(1) "b"
  }
  [2]=>
  array(2) {
    ["id"]=>
    string(1) "1"
    ["label"]=>
    string(1) "a"
  }
}

Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error in /var/php_gcov/PHP_5_4/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.php on line 38
array(0) {
}
bool(false)
Native PS...
array(1) {
  [0]=>
  array(1) {
    ["_version"]=>
    string(6) "5.1.73"
  }
}
bool(false)
array(3) {
  [0]=>
  array(1) {
    ["id"]=>
    string(1) "1"
  }
  [1]=>
  array(1) {
    ["id"]=>
    string(1) "2"
  }
  [2]=>
  array(1) {
    ["id"]=>
    string(1) "3"
  }
}
array(3) {
  [0]=>
  array(2) {
    ["id"]=>
    string(1) "3"
    ["label"]=>
    string(1) "c"
  }
  [1]=>
  array(2) {
    ["id"]=>
    string(1) "2"
    ["label"]=>
    string(1) "b"
  }
  [2]=>
  array(2) {
    ["id"]=>
    string(1) "1"
    ["label"]=>
    string(1) "a"
  }
}
bool(false)
array(1) {
  [0]=>
  array(1) {
    ["_version"]=>
    string(6) "5.1.73"
  }
}
bool(false)
array(3) {
  [0]=>
  array(1) {
    ["id"]=>
    string(1) "1"
  }
  [1]=>
  array(1) {
    ["id"]=>
    string(1) "2"
  }
  [2]=>
  array(1) {
    ["id"]=>
    string(1) "3"
  }
}
array(3) {
  [0]=>
  array(2) {
    ["id"]=>
    string(1) "3"
    ["label"]=>
    string(1) "c"
  }
  [1]=>
  array(2) {
    ["id"]=>
    string(1) "2"
    ["label"]=>
    string(1) "b"
  }
  [2]=>
  array(2) {
    ["id"]=>
    string(1) "1"
    ["label"]=>
    string(1) "a"
  }
}
bool(false)
done!

Diff

050+ 
051+ Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error in /var/php_gcov/PHP_5_4/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.php on line 38
052+ array(0) {
053+ }
103+ 
104+ Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error in /var/php_gcov/PHP_5_4/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.php on line 38
105+ array(0) {
106+ }

 

Generated at Sat, 15 Nov 2014 06:19:47 +0000 (7 days ago)

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