View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
189 | Composr | core_database_drivers | public | 2010-07-14 17:08 | 2010-07-15 18:41 |
Reporter | Guest | Assigned To | Chris Graham | ||
Priority | normal | Severity | major | ||
Status | resolved | Resolution | fixed | ||
Summary | 189: Issued non postgresql friendly sql in installation | ||||
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.] | ||||
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. | ||||
Tags | No tags attached. | ||||
Attach Tags | |||||
Time estimation (hours) | |||||
Sponsorship open | |||||
|
Working blind, I think this must actually due to the auto-increment coming back as a string instead of an integer. Fix is changing: return $seq_array[0]; to: return intval($seq_array[0]); in the driver. |
|
LIKE was probably required for comparisons on blob fields or something like that at the time of the driver development, so I'd prefer to keep that. But regardless Composr tries to be type-strict, so shouldn't be doing a string compare anyway. |