Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simpletest Tests Failing with Postgresql Database #58

Open
ghost opened this issue Dec 13, 2012 · 0 comments
Open

Simpletest Tests Failing with Postgresql Database #58

ghost opened this issue Dec 13, 2012 · 0 comments

Comments

@ghost
Copy link

ghost commented Dec 13, 2012

As of pressflow-6-72361f3 master of 13/12/2012, SimpleTest tests fail when using Posgresql database (8.4) because of a difference between Mysql and Postgres in the way they handle the data type Serial. The following patch to system.install resolves the issue and fixes all the tests.

diff -r -u /tmp/pressflow-6-72361f3/modules/system/system.install ./modules/system/system.install
--- /tmp/pressflow-6-72361f3/modules/system/system.install      2012-05-02 23:59:43.000000000 +0000
+++ ./modules/system/system.install     2012-12-13 05:13:33.000000000 +0000
@@ -379,13 +379,13 @@
   // uid 2 which is not what we want. So we insert the first user here, the
   // anonymous user. uid is 1 here for now, but very soon it will be changed
   // to 0.
-  db_query("INSERT INTO {users} (uid, name, mail) VALUES(%d, '%s', '%s')", 1, '', '');
+  db_query("INSERT INTO {users} (name, mail) VALUES('%s', '%s')", '', '');
 
   // We need some placeholders here as name and mail are uniques and data is
   // presumed to be a serialized array. Install will change uid 1 immediately
   // anyways. So we insert the superuser here, the uid is 2 here for now, but
   // very soon it will be changed to 1.
-  db_query("INSERT INTO {users} (uid, name, mail, created, data) VALUES(%d, '%s', '%s', %d, '%s')", 2, 'placeholder-for-uid-1', 'placeholder-for-uid-1', time(), serialize(array()));
+  db_query("INSERT INTO {users} (name, mail, created, data) VALUES('%s', '%s', %d, '%s')",'placeholder-for-uid-1', 'placeholder-for-uid-1', time(), serialize(array()));
 
   // This sets the above two users uid 0 (anonymous). We avoid an explicit 0
   // otherwise MySQL might insert the next auto_increment value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants