Bugzilla – Attachment 4092 Details for
Bug 5860
Adding duplicate stocknumber will fail silently
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Follow up patch
0001-Bug-5860-Attempted-follow-up-patch-to-fix-itemstockn.patch (text/plain), 1.42 KB, created by
Chris Cormack
on 2011-05-13 02:03:54 UTC
(
hide
)
Description:
Follow up patch
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2011-05-13 02:03:54 UTC
Size:
1.42 KB
patch
obsolete
>From 4e0df0698bedc280d62ef7ff1c527276bb13312a Mon Sep 17 00:00:00 2001 >From: Chris Cormack <chrisc@catalyst.net.nz> >Date: Fri, 13 May 2011 14:01:43 +1200 >Subject: [PATCH] Bug 5860 - Attempted follow up patch to fix itemstocknumberindex > >--- > installer/data/mysql/updatedatabase.pl | 9 ++++++++- > 1 files changed, 8 insertions(+), 1 deletions(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 52951e7..07bffb5 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -4217,7 +4217,14 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > > $DBversion = '3.03.00.042'; > if (C4::Context->preference("Version") < TransformToNum($DBversion) && $original_version < TransformToNum("3.02.06.001")) { >- $dbh->do("ALTER TABLE `items` DROP INDEX `itemsstocknumberidx`;"); >+ my $sth = $dbh->prepare("SELECT index_name FROM information_schema.statistics WHERE index_name ='itemsstocknumberidx'"); >+ $sth->execute(); >+ if (my $rows = $sth->fetchrows_hashref()){ >+ $dbh->do("ALTER TABLE `items` DROP INDEX `itemsstocknumberidx`;"); >+ } >+ else { >+ $dbh->do("ALTER TABLE `items` DROP INDEX `itemstocknumberidx`;"); >+ } > $dbh->do("ALTER TABLE items ADD INDEX itemstocknumberidx (stocknumber);"); > print "Upgrade to $DBversion done (Change items.stocknumber to be not unique)\n"; > SetVersion ($DBversion); >-- >1.7.4.1 >
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 5860
:
3506
|
3615
|
4092
|
4103
|
4121
|
4122
|
4123
|
4141
|
4143
|
4144