Bugzilla – Attachment 98741 Details for
Bug 13897
Use YAML files for installer data
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13897: Surround columns with backticks
Bug-13897-Surround-columns-with-backticks.patch (text/plain), 1.32 KB, created by
Jonathan Druart
on 2020-02-12 10:28:50 UTC
(
hide
)
Description:
Bug 13897: Surround columns with backticks
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-02-12 10:28:50 UTC
Size:
1.32 KB
patch
obsolete
>From fda562a28a672089d65ba35714cb6e885ac73cc0 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 12 Feb 2020 11:27:39 +0100 >Subject: [PATCH] Bug 13897: Surround columns with backticks > >We have some column's names that need to be surrounded by ` as they are >protected keywords ('rows' for instance) >--- > C4/Installer.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/C4/Installer.pm b/C4/Installer.pm >index 02a72552ed..b8131c8a5b 100644 >--- a/C4/Installer.pm >+++ b/C4/Installer.pm >@@ -487,7 +487,7 @@ sub load_sql { > my $table_name = ( keys %$table )[0]; # table name > my @rows = @{ $table->{$table_name}->{rows} }; # > my @columns = ( sort keys %{$rows[0]} ); # column names >- my $fields = join ",", @columns; # idem, joined >+ my $fields = join ",", map{sprintf("`%s`", $_)} @columns; # idem, joined > my $placeholders = join ",", map { "?" } @columns; # '?,..,?' string > my $query = "INSERT INTO $table_name ( $fields ) VALUES ( $placeholders )"; > my $sth = $dbh->prepare($query); >-- >2.11.0
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 13897
:
37165
|
75930
|
75931
|
95884
|
96370
|
96397
|
96539
|
96591
|
96592
|
96754
|
96755
|
97068
|
97069
|
98507
|
98741
|
99392
|
99393
|
99394
|
99395
|
100340
|
100341
|
100342
|
100343