From fba1b4f4930390bbbe63b5e5b59b29f1f437e3fa Mon Sep 17 00:00:00 2001 From: Freakolowsky Date: Fri, 23 Aug 2013 10:48:59 +0200 Subject: [PATCH] Fix Oracle installation SQL The starting and minimal values of sequences on Oracle are both '1' by default. We want a user with id of 0 (used for anonymous edits), so these were both set to '0' and the user was inserted with its id being the next value in the sequence. However, due to some low level caching settings you can miss the first value in a sequence. It makes no difference to other sequences, but it does with this one, as it must be 0 to maintain foreign key validity. Therefore let's just set the sequence to default starting value of '1' and insert the user with hardcoded id=0. Bug: 38411 Change-Id: Ic9a17b92d6052fbdc24dd431726e4d82dbf48034 --- maintenance/oracle/tables.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maintenance/oracle/tables.sql b/maintenance/oracle/tables.sql index acfabc339a..607d7b94ef 100644 --- a/maintenance/oracle/tables.sql +++ b/maintenance/oracle/tables.sql @@ -2,7 +2,7 @@ define mw_prefix='{$wgDBprefix}'; -CREATE SEQUENCE user_user_id_seq MINVALUE 0 START WITH 0; +CREATE SEQUENCE user_user_id_seq; CREATE TABLE &mw_prefix.mwuser ( -- replace reserved word 'user' user_id NUMBER NOT NULL, user_name VARCHAR2(255) NOT NULL, @@ -27,7 +27,7 @@ CREATE INDEX &mw_prefix.mwuser_i02 ON &mw_prefix.mwuser (user_email, user_name); -- Create a dummy user to satisfy fk contraints especially with revisions INSERT INTO &mw_prefix.mwuser - VALUES (user_user_id_seq.nextval,'Anonymous',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, '', current_timestamp, current_timestamp, 0); + VALUES (0,'Anonymous',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, '', current_timestamp, current_timestamp, 0); CREATE TABLE &mw_prefix.user_groups ( ug_user NUMBER DEFAULT 0 NOT NULL, -- 2.20.1