Welcome Guest, Not a member yet? Register   Sign In
odbc driver undefined property for active record like function
#1

[eluser]umefarooq[/eluser]
i found the following error while using active record like function for a query using odbc driver for oracle its meaning odbc driver is not updated, im using CI 1.7.2

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: CI_DB_odbc_driver::$_like_escape_char

Filename: database/DB_active_rec.php

Line Number: 728

i compare odbc driver class with mysql driver class just found on line number 39

Code:
var $_like_escape_str = " {escape '%s'} ";

and query with like will be like this

SELECT * FROM (table) WHERE my_field LIKE 'g00%' {escape ''}

which is wrong SQL statement

error above just because of this $_like_escape_str because its not empty and its checking inside if condition and getting undefined property error and this _like_escape_char is not part of any other database driver calls property even.
#2

[eluser]stuckinphp[/eluser]
Just came to report this bug so thanks for saving me the effort.

It is plainly a typo of the _like_escape_chr variable name on line 728 of DB_active_rec.php,

Currently reading

$like_statement = $like_statement.sprintf($this->_like_escape_str, $this->_like_escape_char);

Should be

$like_statement = $like_statement.sprintf($this->_like_escape_str, $this->_like_escape_chr);

Each of the driver class files have the variables _like_escape_str and _like_escape_chr but no _like_escape_char.


PS Who tested this? And why the fuck on earth aren't you testing string escaping?!!!!




Theme © iAndrew 2016 - Forum software by © MyBB