Page MenuHomePhabricator

VoteNY extension is using zero date in own schema and failing in strict mode
Closed, ResolvedPublic


Since the CI is running mysql in strict mode (T119371) the tests for this extension fails with:
Error: 1067 Invalid default value for 'vote_date'

The problem is '0000-00-00 00:00:00' as default value.
mediawiki/core is using varchars for timestamps

  -- Internal ID to identify between different vote tags on different pages
  `vote_id` int(11) NOT NULL PRIMARY KEY auto_increment,
  -- Username (if any) of the person who voted
  `username` varchar(255) NOT NULL default '0',
  -- User ID of the person who voted
  `vote_user_id` int(11) NOT NULL default '0',
  -- ID of the page where the vote tag is in
  `vote_page_id` int(11) NOT NULL default '0',
  -- Value of the vote (ranging from 1 to 5)
  `vote_value` char(1) character set latin1 collate latin1_bin NOT NULL default '',
  -- Timestamp when the vote was cast
  `vote_date` datetime NOT NULL default '0000-00-00 00:00:00',
  -- IP address of the user who voted
  `vote_ip` varchar(45) NOT NULL default ''
) /*$wgDBTableOptions*/;

Event Timeline

Restricted Application added a project: Social-Tools. · View Herald TranscriptApr 13 2019, 10:52 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
ashley closed this task as Resolved.Jul 30 2019, 10:01 AM
ashley assigned this task to Paladox.
ashley added subscribers: Paladox, ashley.