80_bug42783.phpt 622 B

12345678910111213141516171819202122232425262728293031323334
  1. --TEST--
  2. Bug #42783 (pg_insert() does not support an empty value array)
  3. --SKIPIF--
  4. <?php
  5. require_once('skipif.inc');
  6. ?>
  7. --FILE--
  8. <?php
  9. require_once('config.inc');
  10. $dbh = @pg_connect($conn_str);
  11. if (!$dbh) {
  12. die ("Could not connect to the server");
  13. }
  14. pg_query("CREATE TABLE php_test (id SERIAL PRIMARY KEY, time TIMESTAMP NOT NULL DEFAULT now())");
  15. pg_insert($dbh, 'php_test', array());
  16. var_dump(pg_fetch_assoc(pg_query("SELECT * FROM php_test")));
  17. pg_query($dbh, "DROP TABLE php_test");
  18. pg_close($dbh);
  19. ?>
  20. ===DONE===
  21. --EXPECTF--
  22. array(2) {
  23. ["id"]=>
  24. string(%d) "%d"
  25. ["time"]=>
  26. string(%d) "%s"
  27. }
  28. ===DONE===