Page MenuHomePhabricator

TestORMRowTest::testConstructor with data set #0 (array('Foobar', 42, 9000.1, true, array(13, 11, 7, 5, 3, 2), stdClass), true)
Closed, ResolvedPublic

Description

Author: overlordq

Description:
DBQueryError: A database error has occurred. Did you forget to run maintenance/update.php after upgrading? See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script
Query: CREATE TABLE IF NOT EXISTS "unittest_orm_test"(

				test_id                    INT unsigned        NOT NULL auto_increment PRIMARY KEY,
				test_name                  VARCHAR(255)        NOT NULL,
				test_age                   TINYINT unsigned    NOT NULL,
				test_height                FLOAT               NOT NULL,
				test_awesome               TINYINT unsigned    NOT NULL,
				test_stuff                 BLOB                NOT NULL,
				test_moarstuff             BLOB                NOT NULL,
				test_time                  varbinary(14)       NOT NULL
			);

Function: DatabaseBase::safeQuery
Error: 42601 ERROR: syntax error at or near "unsigned"
LINE 2: test_id INT unsigned NOT NULL ...


Version: unspecified
Severity: normal

Details

Reference
bz38930

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 12:50 AM
bzimport set Reference to bz38930.
bzimport added a subscriber: Unknown Object (MLST).

overlordq wrote:

^

/var/www/thedarkcitadel.com/w/includes/db/Database.php:972
/var/www/thedarkcitadel.com/w/includes/db/DatabasePostgres.php:468
/var/www/thedarkcitadel.com/w/includes/db/Database.php:939
/var/www/thedarkcitadel.com/w/includes/db/Database.php:1025
/var/www/thedarkcitadel.com/w/includes/db/Database.php:1050
/var/www/thedarkcitadel.com/w/tests/phpunit/includes/db/TestORMRowTest.php:82
/var/www/thedarkcitadel.com/w/tests/phpunit/MediaWikiTestCase.php:75
/var/www/thedarkcitadel.com/w/tests/phpunit/MediaWikiPHPUnitCommand.php:45
/var/www/thedarkcitadel.com/w/tests/phpunit/phpunit.php:103

(Forgot second part of error)

Which database backend (and version) are you using?

I am CCing Jeroen De Dauw who wrote the ORM stuff.

overlordq wrote:

Postgres, as given the postgres keyword tag, marking it a blocker of the postgres tracking bug, and the second line of the backtrace which is DatabasePostgres.php

Version is generally unimportant in this case, as the main issue is the datatypes in the CREATE statement which have been fairly invariant for the basic types. Although for giggles it's 9.1.4

INT unsigned => INT
varchar(255) => TEXT
TINYINT unsigned => SMALLINT
FLOAT => REAL
BLOB => BYTEA
varbinary(14) => BYTEA

I think are the general mappings.

  • This bug has been marked as a duplicate of bug 37601 ***
Jdforrester-WMF subscribed.

Migrating from the old tracking task to a tag for PostgreSQL-related tasks.