Welcome Guest, Not a member yet? Register   Sign In
Annoying DB_Driver behaviour
#1

[eluser]Bjørn Børresen[/eluser]
Don't know if this is a bug or not but it's kinda annoying.

Whenever I have a typo in my table name (or someting similar wrong with the SQL) I get this:

Code:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in \wwwdocs\system\codeigniter\system\database\DB_driver.php on line 1176

The line causing it:

Code:
$this->EE->db->get('lol');

Of course, running the same code in the mysql shell will tell me:

Code:
Table 'lol' doesn't exist

It's this code in DB_Driver.php that fails:

Code:
$trace = debug_backtrace();

        foreach($trace as $call)
        {
            if (isset($call['file']) && strpos($call['file'], BASEPATH.'database') === FALSE)
            {
                // Found it - use a relative path for safety
                $message[] = 'Filename: '.str_replace(array(BASEPATH, APPPATH), '', $call['file']);
                $message[] = 'Line Number: '.$call['line'];

                break;
            }
        }

This might be EE related cause the information returned by debug_backtrace() is so huge that it will consume all server memory.

Anyone else experiencing this?
#2

[eluser]Eric Barnes[/eluser]
This changed recently in CI2. Could you try to find a prechanged DB_Driver.php and see if that makes a difference?
#3

[eluser]Eric Barnes[/eluser]
Here is the changeset - https://bitbucket.org/ellislab/codeignit...7d6d1e9311
#4

[eluser]Bjørn Børresen[/eluser]
Hmm, thanks but that code in the changeset looks exactly like the code in my DB_Driver.php .. I think.
#5

[eluser]Eric Barnes[/eluser]
Yea, sorry I wasn't clear. In your file delete everything that is in Green from that changeset. Then it will be back to the way it was before. Then test and see if that error goes away.
#6

[eluser]Bjørn Børresen[/eluser]
Aha, yeah that will fix the error.

But don't want to make core hacks like this. So I'm pondering if I should report it as a bug or something ..
#7

[eluser]Eric Barnes[/eluser]
Totally agree and I would report it as a bug. Since it is a core file this could affect many others outside EE however I can't think of an easy solution right now.




Theme © iAndrew 2016 - Forum software by © MyBB