Last modified: 2014-10-22 13:08:25 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T73022, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 71022 - Installation to Oracle backend fails with a ORA-00947 'Not Enough Values'
Installation to Oracle backend fails with a ORA-00947 'Not Enough Values'
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Installer (Other open bugs)
1.24rc
All All
: Unprioritized blocker (vote)
: 1.24.0 release
Assigned To: Bill Traynor
:
Depends on:
Blocks: oracle
  Show dependency treegraph
 
Reported: 2014-09-18 20:14 UTC by Bill Traynor
Modified: 2014-10-22 13:08 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Bill Traynor 2014-09-18 20:14:55 UTC
Oracle installation fails at the Creating Tables step with the following Error:

Creating tables... 
A database query error has occurred. This may indicate a bug in the software.

Query: 
INSERT INTO page VALUES (0, 0, ' ', NULL, 0, 0, 0, 0, current_timestamp, NULL, 0, 0, NULL) 
Function: DatabaseOracle::doQuery
Error: 947 ORA-00947: not enough values
Backtrace:

#0 /u1/MediaWiki/includes/db/DatabaseOracle.php(422): DatabaseOracle->reportQueryError('ORA-00947: not ...', 947, 'INSERT INTO pag...', 'DatabaseOracle:...')
#1 /u1/MediaWiki/includes/db/DatabaseOracle.php(1240): DatabaseOracle->doQuery('INSERT INTO pag...')
#2 /u1/MediaWiki/includes/db/Database.php(3860): DatabaseOracle->sourceStream(Resource id #158, false, false, 'DatabaseBase::s...', false)
#3 /u1/MediaWiki/includes/installer/DatabaseInstaller.php(196): DatabaseBase->sourceFile('/u1/MediaWiki/m...')
#4 /u1/MediaWiki/includes/installer/DatabaseInstaller.php(218): DatabaseInstaller->stepApplySourceFile('getSchemaPath', 'install', true)
#5 /u1/MediaWiki/includes/installer/OracleInstaller.php(287): DatabaseInstaller->createTables()
#6 [internal function]: OracleInstaller->createTables(Object(OracleInstaller))
#7 /u1/MediaWiki/includes/installer/Installer.php(1584): call_user_func(Array, Object(OracleInstaller))
#8 /u1/MediaWiki/includes/installer/WebInstallerPage.php(1418): Installer->performInstallation(Array, Array)
#9 /u1/MediaWiki/includes/installer/WebInstaller.php(280): WebInstallerInstall->execute()
#10 /u1/MediaWiki/mw-config/index.php(79): WebInstaller->execute(Array)
#11 /u1/MediaWiki/mw-config/index.php(38): wfInstallerMain()
#12 {main}
Comment 1 Andre Klapper 2014-09-18 22:35:45 UTC
Thanks for taking the time to report this!

Is this a fresh installation, or on an existing database / upgrade?
Which Oracle version is this? I assume this is MediaWiki git master?
Comment 2 Bill Traynor 2014-09-18 23:41:03 UTC
(In reply to Andre Klapper from comment #1)
> Thanks for taking the time to report this!
> 
> Is this a fresh installation, or on an existing database / upgrade?
> Which Oracle version is this? I assume this is MediaWiki git master?

Hi Andre,

Yes, this is a fresh installation of MediaWiki git master.  I will find out the Oracle version tomorrow for you.

In my investigation, it would appear that in ../maintenance/oracle/tables.sql the there are 14 columns defined in the Page table, but immediately following the definition the insert statement only contains 13 values.  I think one of the timestamp values is missing.
Comment 3 Bill Traynor 2014-09-18 23:44:22 UTC
(In reply to Bill Traynor from comment #2)
> (In reply to Andre Klapper from comment #1)
> > Thanks for taking the time to report this!
> > 
> > Is this a fresh installation, or on an existing database / upgrade?
> > Which Oracle version is this? I assume this is MediaWiki git master?
> 
> Hi Andre,
> 
> Yes, this is a fresh installation of MediaWiki git master.  I will find out
> the Oracle version tomorrow for you.
> 
> In my investigation, it would appear that in
> ../maintenance/oracle/tables.sql the there are 14 columns defined in the
> Page table, but immediately following the definition the insert statement
> only contains 13 values.  I think one of the timestamp values is missing.

Here's the code I was referring to:

CREATE SEQUENCE page_page_id_seq;
CREATE TABLE &mw_prefix.page (
  page_id            NUMBER        NOT NULL,
  page_namespace     NUMBER       DEFAULT 0 NOT NULL,
  page_title         VARCHAR2(255)           NOT NULL,
  page_restrictions  VARCHAR2(255),
  page_counter       NUMBER         DEFAULT 0 NOT NULL,
  page_is_redirect   CHAR(1)           DEFAULT '0' NOT NULL,
  page_is_new        CHAR(1)           DEFAULT '0' NOT NULL,
  page_random        NUMBER(15,14) NOT NULL,
  page_touched       TIMESTAMP(6) WITH TIME ZONE,
  page_links_updated TIMESTAMP(6) WITH TIME ZONE,
  page_latest        NUMBER        DEFAULT 0 NOT NULL, -- FK?
  page_len           NUMBER        DEFAULT 0 NOT NULL,
  page_content_model VARCHAR2(32),
  page_lang VARCHAR2(35) DEFAULT NULL
);
ALTER TABLE &mw_prefix.page ADD CONSTRAINT &mw_prefix.page_pk PRIMARY
KEY (page_id);
CREATE UNIQUE INDEX &mw_prefix.page_u01 ON &mw_prefix.page
(page_namespace,page_title);
CREATE INDEX &mw_prefix.page_i01 ON &mw_prefix.page (page_random);
CREATE INDEX &mw_prefix.page_i02 ON &mw_prefix.page (page_len);
CREATE INDEX &mw_prefix.page_i03 ON &mw_prefix.page (page_is_redirect,
page_namespace, page_len);

-- Create a dummy page to satisfy fk contraints especially with revisions
INSERT INTO &mw_prefix.page
  VALUES (0, 0, ' ', NULL, 0, 0, 0, 0, current_timestamp, NULL, 0, 0, NULL);


I see 14 columns defined, but only 13 values being passed.  How can
this ever work?
Comment 4 Bill Traynor 2014-09-19 13:37:48 UTC
In looking closer at the code, I think the Create a dummy page to satisfy fk constraints is missing a NULL value at the end of:

INSERT INTO &mw_prefix.page
  VALUES (0, 0, ' ', NULL, 0, 0, 0, 0, current_timestamp, NULL, 0, 0, NULL);

Testing today.
Comment 5 Bill Traynor 2014-09-19 15:04:41 UTC
Adding a NULL to the end of:

INSERT INTO &mw_prefix.page
  VALUES (0, 0, ' ', NULL, 0, 0, 0, 0, current_timestamp, NULL, 0, 0, NULL);

Fixed this error.

I will make a note to submit a patch for this.
Comment 6 Gerrit Notification Bot 2014-09-19 18:01:07 UTC
Change 161485 had a related patch set uploaded by Brian Wolff:
Added missing NULL value to sql insert statement.

https://gerrit.wikimedia.org/r/161485
Comment 7 Gerrit Notification Bot 2014-09-19 19:12:57 UTC
Change 161485 merged by jenkins-bot:
Added missing NULL value to sql insert statement.

https://gerrit.wikimedia.org/r/161485
Comment 8 Umherirrender 2014-09-19 19:15:06 UTC
successfully merged
Comment 9 Andre Klapper 2014-09-19 21:05:03 UTC
Was that only broken in git master, or also in 1.23 tarballs (-> consider backporting)?
Comment 10 Umherirrender 2014-09-19 21:10:22 UTC
(In reply to Andre Klapper from comment #9)
> Was that only broken in git master, or also in 1.23 tarballs (-> consider
> backporting)?

The new column was added with Gerrit change #135312, which is 1.24 -> no backporting
Comment 11 Umherirrender 2014-09-19 21:24:41 UTC
(In reply to Umherirrender from comment #10)
> (In reply to Andre Klapper from comment #9)
> > Was that only broken in git master, or also in 1.23 tarballs (-> consider
> > backporting)?
> 
> The new column was added with Gerrit change #135312, which is 1.24 -> no
> backporting

The release branch is not created yet, maybe it needs backporting there.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links