Page MenuHomePhabricator

Postgres SQL error comparing text and integer in getRangeCond() from includes/Block.php
Closed, InvalidPublic

Description

When using a Postgres database and calling getRangeCond() from includes/Block.php it will fail with the following error message:

SQL ERROR: ERROR:  operator does not exist: text <= integer
LINE 1: ...(ipb_range_start  LIKE '%' ) AND (ipb_range_start <= 0) AND ...
                                                             ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.

The reason for this is that ipb_range_start as well as ipb_range_end are declared as TEXT and compared to $start and end respectively which are integers.

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

AWak3N created this task.Feb 10 2015, 9:51 PM
AWak3N updated the task description. (Show Details)
AWak3N raised the priority of this task from to Needs Triage.
AWak3N added a project: MediaWiki-Database.
AWak3N added a subscriber: AWak3N.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 10 2015, 9:51 PM
AWak3N updated the task description. (Show Details)Feb 10 2015, 10:04 PM
AWak3N set Security to None.
Aklapper renamed this task from Postgres SQL error comparing text and integer to Postgres SQL error comparing text and integer in getRangeCond() from includes/Block.php.
Aklapper triaged this task as Low priority.
Jjanes added a subscriber: Jjanes.Feb 18 2015, 8:42 PM

Can you describe what actions I must take from the Web UI to get this code to be invoked? I've blocked a single IPv4, blocked a IPv4 /24 range, queried for blocked users after doing so, and tried to create an account from a blocked IP, and couldn't get the problem to appear.

Special:Block
Special:BlockList

Also, could you show the versions of mediawiki, php, an postresql from the Special:Version page?

Aklapper changed the task status from Open to Stalled.Mar 19 2015, 2:51 PM

@AWak3N: Please answer.

Jjanes closed this task as Invalid.Apr 8 2015, 5:09 PM
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

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