#189 - Issued non postgresql friendly sql in installation

  • By
  • Added
  • 16 views
Identifier #189
Issue type Major issue (breaks an entire feature)
Title Issued non postgresql friendly sql in installation
Status Completed
Handling member Chris Graham
Addon core_database_drivers
Description Install error:

Unfortunately a query has failed [SELECT t_is_open,t_pt_from,t_pt_to,t_forum_id,t_cache_last_member_id,t_cache_first_title FROM cms4_f_topics WHERE (id LIKE '1') LIMIT 1] [ERROR: operator does not exist: integer ~~ unknown LINE 1: ...,t_cache_first_title FROM cms4_f_topics WHERE (id LIKE '1') ... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.]
Steps to reproduce

Additional information In sources/database/postgresql.php you have

function db_string_equal_to($attribute,$compare)
{
return $attribute." LIKE '".$this->db_escape_string($compare)."'";
}

Change to

function db_string_equal_to($attribute,$compare)
{
return $attribute." = '".$this->db_escape_string($compare)."'";
}

Unless the db_escape_string() function adds some wildcards it should be fine.

Otherwise you may need to distinguish which fields are text strings (where LIKE) is fine, and which are not, like INTEGER.

In which case things get a little more complicated, because you need to know the column type the $attribute refers to.

The change did allow installation to proceed.
Funded? No
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".

Rating

Unrated