Subject: | weird debugging output (SV = IV(0x102458e38) at 0x102458e48) |
Hello,
I think I've tracked down the source of the weird debugging output
mentioned in the FAQ. The problem is that a schema with a live database
handle is being serialized into 001-auto.yml and 001-auto__VERSION.yml.
When SQLT::Parser::YAML runs Load() on this file, it seems to be
creating a phantom DBI object that produces the output when it gets
destroyed. I was able to test this by adding the following at the end
of DBICDH::DeployMethod::SQL::Translator::prepare_protoschema()
use Test::More;
diag "Ctrl-Z now! file is: $filename";
sleep 10;
I then ran the DBIC::Migration tests, Ctrl-Z'd it when I got the
message, and manually deleted the translator.parser_args.package.storage
key from the file. When I did this the weird output never showed up.
As for the fix.... um, I dunno. DBICDH avoids this in its tests by never
calling prepare_protoschema() with a connected schema. I see four
possibilities:
1. DBIC::Migration::prepare should not connect the schema before
calling prepare_install()
2. DBICDH should warn or clone a schema before handing it off to SQLT::DBIC
3. SQLT::Parser::DBIC shouldn't serialize a live DBIC::Schema::Storage
object
4. I am an insane person and way off base.
I lean towards (3) since I can't imagine what use a serialized DBI
connection would be, but I don't know any of these modules well enough
to say. I'm submitting it to your bug queue, b/c I figured you would
know better. I'd be happy to resubmit it somewhere else if that would
be appropriate.
Thank you for your code and have a great day!
Cheers,
Fitz