Possible bug in multi-db plugin

During troubleshooting of another plugin, backup scheduler, I discovered that multi-db was not able to find the requested table name for the following query. Please note this code works for both single and multisite as long as the multi-db is not used.

$entete .= $wpdb->get_var(“show create table “.$table[0], 1).”;”;

On inspection of the multi-db plugin file db.php I found that the handling of show create table was different than for the other sql that was working.

On line 512 of db.php the regex used to match and capture the table name is


Note the ? lazy operator.

In all the other working sql handlers, the regex used for the same task is the greedy version


When line 512 is edited to use the second regex then the show create table sql in backup scheduler succeeds.