diff options
| author | Damien Regad <dregad@mantisbt.org> | 2014-04-16 02:34:01 +0200 |
|---|---|---|
| committer | Damien Regad <dregad@mantisbt.org> | 2014-04-16 02:48:06 +0200 |
| commit | 341e6a38c901d49e79b69e883da481a8e330c10b (patch) | |
| tree | 854614daba466e3f3c6a10ca751fccf6c2ffe201 /tests/testdatabases.inc.php | |
| parent | 2d0d5d9786b3d3b9343ce72ef4f8112a579205a3 (diff) | |
| download | adodb-341e6a38c901d49e79b69e883da481a8e330c10b.tar.gz adodb-341e6a38c901d49e79b69e883da481a8e330c10b.tar.bz2 adodb-341e6a38c901d49e79b69e883da481a8e330c10b.zip | |
Postgres tests: added serial column
This is a workaround to prevent tests from failing with the new
_insertid() method relying on lastval() instead of OID.
Diffstat (limited to 'tests/testdatabases.inc.php')
| -rw-r--r-- | tests/testdatabases.inc.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/testdatabases.inc.php b/tests/testdatabases.inc.php index e0a2e3c2..1dd49b23 100644 --- a/tests/testdatabases.inc.php +++ b/tests/testdatabases.inc.php @@ -79,6 +79,8 @@ function ADOLoadCode2($d) flush(); +// dregad 2014-04-15 added serial field to avoid error with lastval() +$pg_test_table = "create table ADOXYZ (id integer, firstname char(24), lastname varchar,created date, ser serial)"; $pg_hostname = 'localhost'; $pg_user = 'tester'; $pg_password = 'test'; @@ -92,7 +94,7 @@ if (!empty($testpostgres)) { $db = ADONewConnection('postgres'); print "<h1>Connecting $db->databaseType...</h1>"; if ($db->Connect($pg_hostname, $pg_user, $pg_password, $pg_database)) { - testdb($db,"create table ADOXYZ (id integer, firstname char(24), lastname varchar,created date)"); + testdb($db, $pg_test_table); } else { print $pg_errmsg . $db->ErrorMsg(); } @@ -104,9 +106,10 @@ if (!empty($testpostgres9)) { $db = ADONewConnection('postgres9'); print "<h1>Connecting $db->databaseType...</h1>"; if ($db->Connect($pg_hostname, $pg_user, $pg_password, $pg_database)) { - testdb($db,"create table ADOXYZ (id integer, firstname char(24), lastname varchar,created date)"); - }else + testdb($db, $pg_test_table); + } else { print $pg_errmsg . $db->ErrorMsg(); + } } if (!empty($testpgodbc)) { |
