Bugzilla – Attachment 6244 Details for
Bug 7188
case-insensitive grep of /mysql/ in C4::Context
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7188: C4::Context::db_scheme2dbi does case-insensitive grep
Bug-7188-C4Contextdbscheme2dbi-does-case-insensiti.patch (text/plain), 1.41 KB, created by
Ian Walls
on 2011-11-06 11:22:59 UTC
(
hide
)
Description:
Bug 7188: C4::Context::db_scheme2dbi does case-insensitive grep
Filename:
MIME Type:
Creator:
Ian Walls
Created:
2011-11-06 11:22:59 UTC
Size:
1.41 KB
patch
obsolete
>From d890bb1df9855d7263c36b90d31bf55f5394bfbc Mon Sep 17 00:00:00 2001 >From: Paul Poulain <paul.poulain@biblibre.com> >Date: Sat, 17 Sep 2011 00:58:41 +0200 >Subject: [PATCH] Bug 7188: C4::Context::db_scheme2dbi does case-insensitive grep > >Checking NYTProf in C4::Context, it appears that the /i flag is highly time-consumming >As we don't support anything outside from mysql, returning directly mysql directly > >If in a future version PostgresSQL works, then we will have to update this sub. But if an ORM is introduced, this code will be removed completly anyway > >Testing note: >Drops execution time of the line from 300ms to 20 microseconds (in my testing). >--- > C4/Context.pm | 7 ++++--- > 1 files changed, 4 insertions(+), 3 deletions(-) > >diff --git a/C4/Context.pm b/C4/Context.pm >index 85d1c18..68ed85a 100644 >--- a/C4/Context.pm >+++ b/C4/Context.pm >@@ -237,12 +237,13 @@ sub read_config_file { # Pass argument naming config file to read > # > sub db_scheme2dbi { > my $name = shift; >- >+ # for instance, we support only mysql, so don't care checking >+ return "mysql"; > for ($name) { > # FIXME - Should have other databases. >- if (/mysql/i) { return("mysql"); } >+ if (/mysql/) { return("mysql"); } > if (/Postgres|Pg|PostgresSQL/) { return("Pg"); } >- if (/oracle/i) { return("Oracle"); } >+ if (/oracle/) { return("Oracle"); } > } > return undef; # Just in case > } >-- >1.7.2.5
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 7188
: 6244