Bug 23289: Quote new 'rows' MariaDB reserved word
Since MariaDB 10.2.4 rows is a reserved word: https://mariadb.com/kb/en/library/mariadb-1024-release-notes/ """ New reserved word: ROWS. This can no longer be used as an identifier without being quoted. """ Test plan: With MariaDB >= 10.2.4, create a new label template. Also, prove t/db_dependent/Labels/t_Template.t Without this patch you will get the following SQL error: DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'rows, creator, template_code, page_height, Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
60ce66b6b6
commit
aede6896dd
|
|
@ -166,7 +166,7 @@ sub save {
|
|||
foreach my $key (keys %{$self}) {
|
||||
next if ($key eq 'template_id') || ($key eq 'template_stat') || ($key eq 'creator');
|
||||
push (@params, $self->{$key});
|
||||
$query .= "$key=?, ";
|
||||
$query .= "`$key`=?, ";
|
||||
}
|
||||
$query = substr($query, 0, (length($query)-2));
|
||||
push (@params, $self->{'template_id'}, $self->{'creator'});
|
||||
|
|
@ -186,7 +186,7 @@ sub save {
|
|||
foreach my $key (keys %{$self}) {
|
||||
next if $key eq 'template_stat';
|
||||
push (@params, $self->{$key});
|
||||
$query .= "$key, ";
|
||||
$query .= "`$key`, ";
|
||||
}
|
||||
$query = substr($query, 0, (length($query)-2));
|
||||
$query .= ") VALUES (";
|
||||
|
|
|
|||
Loading…
Reference in New Issue