Subject: | Wildcard '%' value for db_schema does not work in MySQL |
Setting the loader option 'db_schema' to the documented wildcard value of '%' - which is supposed to mean "All Schemas" - does not work in MySQL. It causes all schemas (same as databases for MySQL) to show up as table names and fail.
This broken behavior can also be seen by calling:
$self->dbh->tables(undef, '%')
Which returns a list of quoted schema names...
Ref: https://metacpan.org/pod/DBIx::Class::Schema::Loader::Base#db_schema
Convo from IRC:
=====================
<--snip-->
<vanstyn> Should I expect Schema::Loader's db_schema option
to work when set to '%' in MySQL ?
<vanstyn> ilmari: ^^
<vanstyn> when I use it, it looks like it is seeing the
database names as table names, and elsewhere is
trying to use the literal string '%' .... I get
errors like this:
https://gist.github.com/vanstyn/312faa9f03a3ef4eaf92
<vanstyn> I know I'm entering the param correctly, because
when I supply a real name it works as expected
<ilmari> vanstyn: it should, that's clearly a bug
<ilmari> vanstyn: care to file it in RT
<ilmari> ?
<ilmari> vanstyn: does it work if you specify an arrayref
of schema names?
<vanstyn> ilmari: I'll try that (and I'll also file an RT)
<vanstyn> ilmari: yes, it works as expected with an arrayref
of valid schema names....
<ilmari> and what does $dbh->tables(undef, '%') return?
<ilmari> nevermind, I can do that myeslf
<ilmari> that returns a list of quoted schema names
<ilmari> which is what ->table_info(undef, '%', undef) is
documented to return
<ilmari> how did that ever work?
<ilmari> ah, that's one of the "special cases [which] may
also be supported by some drivers"
<ilmari> ffs
<ilmari> I'll have a look at it later <--snip-->