https://bugzilla.wikimedia.org/show_bug.cgi?id=43475

Marcin Cieślak <marcin.cies...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|PATCH_TO_REVIEW             |NEW

--- Comment #15 from Marcin Cieślak <marcin.cies...@gmail.com> ---
Gerrit change 58422 got merged, but that didn't help. After a bit of fighting
with some other bugs I came to the following result:


1) TestORMRowTest::testSaveAndRemove with data set #0 (array('Foobar',
'2012-01-01 02:02:02 GMT', 42, 9000.1, true, array(13, 11, 7, 5, 3, 2),
stdClass), true)
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: INSERT INTO "unittest_orm_test"
(test_id,test_name,test_age,test_height,test_awesome,test_stuff,test_moarstuff,test_time)
VALUES
(NULL,'Foobar','42','9000.1',1,'a:6:{i:0;i:13;i:1;i:11;i:2;i:7;i:3;i:5;i:4;i:3;i:5;i:2;}','O:8:"stdClass":3:{s:3:"foo";s:3:"bar";s:3:"bar";a:2:{i:0;i:4;i:1;i:2;}s:3:"baz";b:1;}','2012-01-01
02:02:02 GMT')
Function: ORMTable::insertRow
Error: 23502 ERROR:  null value in column "test_id" violates not-null
constraint



/usr/home/saper/test/mytest/includes/db/Database.php:1111
/usr/home/saper/test/mytest/includes/db/DatabasePostgres.php:511
/usr/home/saper/test/mytest/includes/db/Database.php:1077
/usr/home/saper/test/mytest/includes/db/DatabasePostgres.php:871
/usr/home/saper/test/mytest/includes/db/ORMTable.php:1015
/usr/home/saper/test/mytest/includes/db/ORMRow.php:352
/usr/home/saper/test/mytest/tests/phpunit/includes/db/ORMRowTest.php:143
/usr/home/saper/test/mytest/tests/phpunit/MediaWikiTestCase.php:123
/usr/home/saper/test/mytest/tests/phpunit/MediaWikiPHPUnitCommand.php:80
/usr/home/saper/test/mytest/tests/phpunit/MediaWikiPHPUnitCommand.php:64
/usr/home/saper/test/mytest/tests/phpunit/phpunit.php:119


Still inserting NULL in the SERIAL field is wrong:

minitest=# create table a (id serial primary key, s int);
NOTICE:  CREATE TABLE will create implicit sequence "a_id_seq" for serial
column "a.id"
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "a_pkey" for
table "a"
CREATE TABLE
minitest=# insert into a (id,s) values (null, 2);
ERROR:  null value in column "id" violates not-null constraint


Can't we come up with proper handling of sequences/ids? Nobody said writing
"ORM" is easy...

Reseting back to NEW as the change merged does not solve the problem.

This causes SiteSQLStoreTest::testSaveSites to fail, among others.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to