diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-08-24 17:13:55 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-08-24 17:13:55 +0200 |
commit | ff3950866c0f756a5b6f379b9f95f01fff4a9ec7 (patch) | |
tree | 1171b1c1ecd9cffc5022d34d8d411846b98adf09 /pgsql | |
parent | 1fca8273447e0048941bbfe8ca23466f103c42f3 (diff) |
Make tests use unique table prefixes
Diffstat (limited to 'pgsql')
-rw-r--r-- | pgsql/native/driver.cxx | 18 | ||||
-rw-r--r-- | pgsql/template/makefile | 3 | ||||
-rw-r--r-- | pgsql/truncation/makefile | 2 | ||||
-rw-r--r-- | pgsql/types/makefile | 4 |
4 files changed, 17 insertions, 10 deletions
diff --git a/pgsql/native/driver.cxx b/pgsql/native/driver.cxx index 30e707c..7fc63f6 100644 --- a/pgsql/native/driver.cxx +++ b/pgsql/native/driver.cxx @@ -29,8 +29,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - db->execute ("DROP TABLE IF EXISTS test"); - db->execute ("CREATE TABLE test (n INT PRIMARY KEY)"); + db->execute ("DROP TABLE IF EXISTS pgsql_native_test"); + db->execute ("CREATE TABLE pgsql_native_test (n INT PRIMARY KEY)"); t.commit (); } @@ -40,8 +40,11 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - assert (db->execute ("INSERT INTO test (n) VALUES (1)") == 1); - assert (db->execute ("INSERT INTO test (n) VALUES (2)") == 1); + assert ( + db->execute ("INSERT INTO pgsql_native_test (n) VALUES (1)") == 1); + + assert ( + db->execute ("INSERT INTO pgsql_native_test (n) VALUES (2)") == 1); t.commit (); } @@ -51,8 +54,11 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - assert (db->execute ("SELECT n FROM test WHERE n < 3") == 2); - assert (db->execute ("SELECT n FROM test WHERE n > 3") == 0); + assert ( + db->execute ("SELECT n FROM pgsql_native_test WHERE n < 3") == 2); + + assert ( + db->execute ("SELECT n FROM pgsql_native_test WHERE n > 3") == 0); t.commit (); } diff --git a/pgsql/template/makefile b/pgsql/template/makefile index 518cab0..bf6b9c3 100644 --- a/pgsql/template/makefile +++ b/pgsql/template/makefile @@ -35,7 +35,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database pgsql --generate-schema +$(gen) $(dist): export odb_options += --database pgsql --generate-schema \ +--table-prefix pgsql_template_ #@@ CHANGE THIS $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/pgsql/truncation/makefile b/pgsql/truncation/makefile index a94639d..6bfe835 100644 --- a/pgsql/truncation/makefile +++ b/pgsql/truncation/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database pgsql --generate-query \ ---generate-schema +--generate-schema --table-prefix pgsql_truncation_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/pgsql/types/makefile b/pgsql/types/makefile index bdc00ea..0ba6bec 100644 --- a/pgsql/types/makefile +++ b/pgsql/types/makefile @@ -36,8 +36,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database pgsql --generate-schema \ ---generate-query --cxx-prologue '\#include "traits.hxx"' - +--generate-query --cxx-prologue '\#include "traits.hxx"' \ +--table-prefix pgsql_types_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) |