[eluser]Unknown[/eluser]
Hi there,
just in case someone hits this problem:
I had double escapings on underscores in like statements. Example on a rendered query:
SELECT field FROM table WHERE field LIKE 'VALUE!!_%' escape '!'
The problem lies in /system/database/drivers/oci8/oci8_driver line 411 - 413:
Code:
$str = str_replace( array('%', '_', $this->_like_escape_chr),
array($this->_like_escape_chr.'%', $this->_like_escape_chr.'_', $this->_like_escape_chr.$this->_like_escape_chr),
$str);
The order for replacing chars is wrong. Within the replacement, _ is going to be escaped to !_, which is then replaced to !!_.
Solution:
Code:
$str = str_replace( array($this->_like_escape_chr, '%', '_'),
array( $this->_like_escape_chr.$this->_like_escape_chr, $this->_like_escape_chr.'%', $this->_like_escape_chr.'_'),
$str);
This problem seems to be fixed in the current github-Version. The escaping order seems to be correct there.
Hope it helps anyone.