Hi,
Attached is a new test case for the 71mysql.t file that tests the
proper initialization of the sql_maker in the ::Storage::DBI class.
If the first query immediately after a connect is a find(), the code
path will call sql_maker() before calling _determine_driver(), and so,
any ::Storage::DBI subclass that updates sql_maker_class() will be
unable to use the specific SQLHacks class. This a side effect of the
code path that find() uses: it calls single() as a fast path, and that
path doesn't call _determine_driver().
The patch covers only the MySQL database because, of those that have a
SQLHacks subclass, thats the only one that I have access to.
Equivalent tests could/should be done on the Oracle and MSSQL cases.
A probable solution would be to add something like this
to ::Storage::DBI::select_single():
# redispatch to update method of storage we reblessed into, if
necessary
if (not $self->_driver_determined) {
$self->_determine_driver;
goto $self->can('select_single');
}
but for some obscure reason I cannot get it to work.
Best regards,
_______________________________________________
List:
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-classIRC: irc.perl.org#dbix-class
SVN:
http://dev.catalyst.perl.org/repos/bast/DBIx-Class/Searchable Archive:
http://www.grokbase.com/group/dbix-class@...