Bugzilla – Attachment 99395 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.39 KB, created by
Martin Renvoize (ashimema)
on 2020-02-21 16:20:27 UTC
(
hide
)
Description:
Bug 13897: Surround columns with backticks
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-02-21 16:20:27 UTC
Size:
1.39 KB
patch
obsolete
>From 877b741f30d1521cae3d5cc7e89f882773e29405 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) > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Installer.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/C4/Installer.pm b/C4/Installer.pm >index 2e096279d3..012bc1c3cd 100644 >--- a/C4/Installer.pm >+++ b/C4/Installer.pm >@@ -486,7 +486,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.20.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 13897
:
37165
|
75930
|
75931
|
95884
|
96370
|
96397
|
96539
|
96591
|
96592
|
96754
|
96755
|
97068
|
97069
|
98507
|
98741
|
99392
|
99393
|
99394
|
99395
|
100340
|
100341
|
100342
|
100343