0
votes

I'm trying to use

$query = $this->db->query("YOUR QUERY");
$fields = $query->field_data();

which is documented at the bottom of this manual page http://ellislab.com/codeigniter/user-guide/database/fields.html

but I get a list of errors (more than a 100 of these) with any query, even a simple select * from tablename.

I am using CodeIgniter 2, PHP Version 5.4.10, MySQL version 5.5.29

Does anyone know why this is happening?

$sql = "SELECT * FROM `article`";
$query = $this->db->query($sql);
$fields = $query->field_data();

Error list (first couple of them):

A PHP Error was encountered Severity: Notice Message: Undefined property: stdClass::$Type Filename: mysqli/mysqli_result.php Line Number: 89

A PHP Error was encountered Severity: Notice Message: Undefined property: stdClass::$Field Filename: mysqli/mysqli_result.php Line Number: 95

A PHP Error was encountered Severity: Notice Message: Undefined property: stdClass::$Default Filename: mysqli/mysqli_result.php Line Number: 97

A PHP Error was encountered Severity: Notice Message: Undefined property: stdClass::$Key Filename: mysqli/mysqli_result.php Line Number: 99

1
The error appears in lines where framework tried to generate an object from field meta-data. Try to execute select * from performance_schema.rwlock_instances where write_locked_by_thread_id is not null or read_locked_by_count is not null; select * from performance_schema.mutex_instances where locked_by_thread_id is not null; Maybe mysql locks meta-data i guessAndrei Zhamoida

1 Answers

1
votes

Seemed to be bug in codeIgniter, they fixed it in the developer branch https://github.com/EllisLab/CodeIgniter/commit/effd0133b3fa805e21ec934196e8e7d75608ba00