Bugzilla – Attachment 59870 Details for
Bug 18014
AddAuthority should respect AUTO_INCREMENT
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18014: Add test to AuthoritiesMarc.t to expose problem in AddAuthority
Bug-18014-Add-test-to-AuthoritiesMarct-to-expose-p.patch (text/plain), 1.71 KB, created by
Nick Clemens (kidclamp)
on 2017-02-03 10:51:46 UTC
(
hide
)
Description:
Bug 18014: Add test to AuthoritiesMarc.t to expose problem in AddAuthority
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2017-02-03 10:51:46 UTC
Size:
1.71 KB
patch
obsolete
>From 562d7d17bae5366d0a76500db5b2bfed8a72eb30 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Tue, 31 Jan 2017 09:11:05 +0100 >Subject: [PATCH] Bug 18014: Add test to AuthoritiesMarc.t to expose problem in > AddAuthority > >Since AddAuthority uses max(id)+1 logic to produce the next authid, >authority id's will be reused when you delete the last record. This may >be a source of problems and will be addressed on the next patch. > >This patch add a test to expose the problem. > >Test plan: >[1] Run t/db_dependent/AuthoritiesMarc.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/db_dependent/AuthoritiesMarc.t | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/AuthoritiesMarc.t b/t/db_dependent/AuthoritiesMarc.t >index da8241d..91025cf 100755 >--- a/t/db_dependent/AuthoritiesMarc.t >+++ b/t/db_dependent/AuthoritiesMarc.t >@@ -5,7 +5,7 @@ > > use Modern::Perl; > >-use Test::More tests => 8; >+use Test::More tests => 9; > use Test::MockModule; > use Test::Warn; > use MARC::Record; >@@ -191,4 +191,16 @@ is_deeply( > 'test BuildSummary for UNIMARC' > ); > >+subtest 'AddAuthority should respect AUTO_INCREMENT (BZ 18104)' => sub { >+ plan tests => 1; >+ >+ t::lib::Mocks::mock_preference( 'marcflavour', 'MARC21' ); >+ my $record = C4::AuthoritiesMarc::GetAuthority(1); >+ my $id1 = AddAuthority( $record, undef, 'GEOGR_NAME' ); >+ DelAuthority( $id1 ); >+ my $id2 = AddAuthority( $record, undef, 'GEOGR_NAME' ); >+ is( $id1, $id2, 'FIXME: Got the same id back, let\'s fix that behavior' ); >+ >+}; >+ > $schema->storage->txn_rollback; >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18014
:
59663
|
59664
|
59665
|
59667
|
59668
|
59669
|
59700
|
59701
|
59702
|
59869
| 59870 |
59871
|
59880
|
59881
|
59882
|
59883