feat(DBI): fill in more DBI internals used by test suite#545
Closed
fglock wants to merge 1 commit intofix/dbi-install-driverfrom
Closed
feat(DBI): fill in more DBI internals used by test suite#545fglock wants to merge 1 commit intofix/dbi-install-driverfrom
fglock wants to merge 1 commit intofix/dbi-install-driverfrom
Conversation
Phase 3 first batch of the DBI test-parity plan: add the methods
the DBI self-tests and the bundled pure-Perl DBDs
(DBD::File / DBD::DBM / DBD::Sponge / DBD::Mem / DBI::DBD::SqlEngine)
call on DBI and on handles.
Top-level DBI methods / helpers:
* DBI->internal (fake DBD::Switch::dr drh, isa('DBI::dr'))
* DBI->parse_dsn
* DBI->driver_prefix (accepts both 'File' and 'DBD::File')
* DBI->dbixs_revision
* DBI->install_method / DBI->_install_method
* DBI::hash (ported from DBI::PurePerl)
* DBI::_concat_hash_sorted
* DBI::dbi_profile / dbi_profile_merge / dbi_profile_merge_nodes
* DBI->data_sources now accepts "dbi:DRIVER:" form.
Trace fix in DBI.pm:
* DBI->trace / DBI->trace_msg now work as class methods
(previously crashed on strict refs when the invocant was "DBI").
DBD::_::db base class:
* do, prepare_cached
* selectrow_array / _arrayref / _hashref
* selectall_arrayref / _hashref
* selectcol_arrayref
* type_info stub
DBD::_::st base class:
* fetchall_arrayref (plain / slice / hash)
* fetchall_hashref
* _get_fbav
* FETCH override computing NAME_lc / NAME_uc / NAME_hash /
NAME_lc_hash / NAME_uc_hash from NAME when called via
$sth->FETCH(...). Direct $sth->{NAME_lc} access still requires
tied-hash semantics, which we do not provide.
DBD::_::common base class:
* FETCH_many, debug, dbixs_revision, install_method, dump_handle.
Effect on `jcpan -t DBI` (stacked on #544):
before: 200 files, 1600 subtests, 1240 passing, 360 failing
after: 200 files, 5610 subtests, 3978 passing, 1632 failing
=> +2738 subtests now pass (+4010 more executed). 4 fewer test
files fail overall. The remaining 166 files are dominated by
(a) DBD::File / DBD::DBM-specific methods not yet wired and
(b) tied-hash-dependent attribute access.
Cumulative across the four stacked PRs (#540, #542, #544, this one):
master: 562 subtests, 308 passing
now: 5610 subtests, 3978 passing (~13× more passes)
See dev/modules/dbi_test_parity.md.
Generated with [Devin](https://cli.devin.ai/docs)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Owner
Author
|
Superseded by unified PR (see new PR). All four commits rebased into a single branch targeting master. |
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 3 first batch of the DBI test-parity plan. Adds the methods the DBI self-tests and the bundled pure-Perl DBDs (
DBD::File,DBD::DBM,DBD::Sponge,DBD::Mem,DBI::DBD::SqlEngine) call onDBIand on handles. Nothing architecturally new — it's all straight ports of existing real-DBI logic into the Perl-side glue we started in #544.What's added
Top-level
DBImethods / helpers:DBI->internal(fakeDBD::Switch::drdrh thatisa('DBI::dr'))DBI->parse_dsnDBI->driver_prefix(accepts both'File'and'DBD::File')DBI->dbixs_revisionDBI->install_method/DBI->_install_methodDBI::hash(ported fromDBI::PurePerl)DBI::_concat_hash_sortedDBI::dbi_profile/dbi_profile_merge/dbi_profile_merge_nodesDBI->data_sourcesnow also accepts the"dbi:DRIVER:"form.Trace fix in
DBI.pm:DBI->trace/DBI->trace_msgnow work as class methods (previously crashed onstrict refswhen the invocant was"DBI").DBD::_::dbbase class:do,prepare_cached,selectrow_array/_arrayref/_hashref,selectall_arrayref/_hashref,selectcol_arrayref,type_infostub.DBD::_::stbase class:fetchall_arrayref(plain / slice / hash),fetchall_hashref,_get_fbav, and aFETCHoverride computingNAME_lc/NAME_uc/NAME_hash/NAME_lc_hash/NAME_uc_hashfromNAMEwhen called via$sth->FETCH(...). Direct$sth->{NAME_lc}access still requires tied-hash semantics, which we don't provide.DBD::_::commonbase class:FETCH_many,debug,dbixs_revision,install_method,dump_handle.Effect on
jcpan -t DBI(stacked on #544)+2738 subtests now pass (+4010 more executed). 4 fewer test files fail overall. The remaining 166 files are dominated by (a) DBD::File / DBD::DBM-specific methods not yet wired and (b) tied-hash-dependent attribute access.
Cumulative across stacked PRs
~13× more subtests passing than master.
Depends on
Test plan
make(full unit tests) passes../jperl ~/.cpan/build/DBI-1.647-5/t/01basics.truns 94+ subtests (was 78)../jperl ~/.cpan/build/DBI-1.647-5/t/02dbidrv.truns 54 subtests (was 37)../jperl ~/.cpan/build/DBI-1.647-5/t/48dbi_dbd_sqlengine.truns 22 subtests with 21 passing.jcpan -t DBIbaseline matches the table above.Generated with Devin