Welcome Guest, Not a member yet? Register   Sign In
Migration stopped working after v3.1.11

(This post was last modified: 10-05-2019, 12:53 AM by bartMommens.)

(10-04-2019, 08:09 PM)dave friend Wrote:
(10-04-2019, 02:38 PM)jreklund Wrote: @davefriend: It haven't always been there, look at the commit. It just got added to system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php

And it won't be able to append $this->database as it's been (probably) left out in @bartMommens script.

You're partly correct - it hasn't always been there since CI v3.0.0

From CodeIgniter version 2.1.3 (the oldest I have handy) pdo_driver.php

PHP Code:
function _list_tables($prefix_limit FALSE)
    $sql "SHOW TABLES FROM `".$this->database."`";

    if ($prefix_limit !== FALSE AND $this->dbprefix != '')
    //$sql .= " LIKE '".$this->escape_like_str($this->dbprefix)."%' ".sprintf($this->_like_escape_str, $this->_like_escape_chr);
      return FALSE// not currently supported
    return $sql;

So, it was there and then it wasn't and now it is again.

For PDO the database name need not be included in the query, but it isn't wrong to provide it. (Though it does need to be a useful value.)

I cannot see that the database property would get set from a DSN string. It seems only to get a value from the /config/database.php file.

If PDO is being used (meaning the connection is via 'dsn') then the connection settings might have 'database' => '', and that might be why the "incorrect database name '' " error is happening.

We don't know if he's using PDO anyway though it seems likely.

It might be possible to stick with CI v3.1.11 by setting a database name in the config.

Hey Guys,

Thank you all for your replies, and you are correct i am using the PDO Driver so i use the DSN string in the cofing/database.php.
I'm going to change from PDO to MYSQLi and hopefully everything keeps working.

Thanks for the help!

i Can confirm that switching over to MYSQLi drivers works, so this means that several other users might be affected by this issue and be unaware of it.
Reported this issue on the github of CI.

Thank you guys for your insights, i'm now going to test the rest of my application to check that all the other things keep working after database driver switch Smile

Best regards,

Messages In This Thread
RE: Migration stopped working after v3.1.11 - by bartMommens - 10-05-2019, 12:39 AM

Theme © iAndrew 2016 - Forum software by © MyBB