Page MenuHomePhabricator

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


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 raised the priority of this task from to Needs Triage.
AWak3N updated the task description. (Show Details)
AWak3N added a project: MediaWiki-libs-Rdbms.
AWak3N added a subscriber: AWak3N.
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.Feb 16 2015, 10:04 AM
Aklapper triaged this task as Low priority.

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.


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.

Jdforrester-WMF added a subscriber: Jdforrester-WMF.

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