bug_38955.phpt 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. --TEST--
  2. PDO_DBLIB driver does not support transactions
  3. --SKIPIF--
  4. <?php
  5. if (!extension_loaded('pdo_dblib')) die('skip not loaded');
  6. require dirname(__FILE__) . '/config.inc';
  7. ?>
  8. --FILE--
  9. <?php
  10. require dirname(__FILE__) . '/config.inc';
  11. /*We see these rows */
  12. $db->query("CREATE table php_test(val int)");
  13. $db->beginTransaction();
  14. $db->query("INSERT INTO php_test(val) values(1)");
  15. $db->query("INSERT INTO php_test(val) values(2)");
  16. $db->query("INSERT INTO php_test(val) values(3)");
  17. $db->query("INSERT INTO php_test(val) values(4)");
  18. $db->commit();
  19. /*We don't see these rows */
  20. $db->beginTransaction();
  21. $db->query("INSERT INTO php_test(val) values(5)");
  22. $db->query("INSERT INTO php_test(val) values(6)");
  23. $db->query("INSERT INTO php_test(val) values(7)");
  24. $db->query("INSERT INTO php_test(val) values(8)");
  25. $db->rollback();
  26. $rs = $db->query("SELECT * FROM php_test");
  27. $rows = $rs->fetchAll(PDO::FETCH_ASSOC);
  28. var_dump($rows);
  29. $db->query("DROP table php_test");
  30. ?>
  31. --EXPECT--
  32. array(4) {
  33. [0]=>
  34. array(1) {
  35. ["val"]=>
  36. string(1) "1"
  37. }
  38. [1]=>
  39. array(1) {
  40. ["val"]=>
  41. string(1) "2"
  42. }
  43. [2]=>
  44. array(1) {
  45. ["val"]=>
  46. string(1) "3"
  47. }
  48. [3]=>
  49. array(1) {
  50. ["val"]=>
  51. string(1) "4"
  52. }
  53. }