don't use + on a numeric value when you want to do a concat !!!

This commit is contained in:
tipaul 2006-03-30 14:20:03 +00:00
parent be932a1661
commit c5f0936d89
1 changed files with 8 additions and 5 deletions

View File

@ -268,7 +268,7 @@ sub create_request {
$sql_tables .= "auth_subfield_table as m$nb_table,";
$sql_where1 .= "(m1.subfieldvalue like ".$dbh->quote("@$value[$i]%");
if (@$tags[$i]) {
$sql_where1 .=" and m1.tag+m1.subfieldcode in (@$tags[$i])";
$sql_where1 .=" and concat(m1.tag,m1.subfieldcode) in (@$tags[$i])";
}
$sql_where1.=")";
} elsif (@$operator[$i] eq "contains") {
@ -283,7 +283,7 @@ sub create_request {
$sql_tables .= "auth_subfield_table as m$nb_table,";
$sql_where1 .= "(m1.subfieldvalue @$operator[$i] ".$dbh->quote("@$value[$i]");
if (@$tags[$i]) {
$sql_where1 .=" and m1.tag+m1.subfieldcode in (@$tags[$i])";
$sql_where1 .=" and concat(m1.tag,m1.subfieldcode) in (@$tags[$i])";
}
$sql_where1.=")";
}
@ -293,7 +293,7 @@ sub create_request {
$sql_tables .= "auth_subfield_table as m$nb_table,";
$sql_where1 .= "@$and_or[$i] (m$nb_table.subfieldvalue like ".$dbh->quote("@$value[$i]%");
if (@$tags[$i]) {
$sql_where1 .=" and m$nb_table.tag+m$nb_table.subfieldcode in (@$tags[$i])";
$sql_where1 .=" and concat(m$nb_table.tag,m$nb_table.subfieldcode) in (@$tags[$i])";
}
$sql_where1.=")";
$sql_where2 .= "m1.authid=m$nb_table.authid and ";
@ -310,7 +310,7 @@ sub create_request {
} else {
$sql_where1 .= "@$and_or[$i] (m$nb_table.word like ".$dbh->quote("@$value[$i]%");
if (@$tags[$i]) {
$sql_where1 .=" and m$nb_table.tag+m$nb_table.subfieldid in (@$tags[$i])";
$sql_where1 .=" and concat(m$nb_table.tag,m$nb_table.subfieldid) in (@$tags[$i])";
}
$sql_where1.=")";
$sql_where2 .= "m1.authid=m$nb_table.authid and ";
@ -320,7 +320,7 @@ sub create_request {
$sql_tables .= "auth_subfield_table as m$nb_table,";
$sql_where1 .= "@$and_or[$i] (m$nb_table.subfieldvalue @$operator[$i] ".$dbh->quote(@$value[$i]);
if (@$tags[$i]) {
$sql_where1 .=" and m$nb_table.tag+m$nb_table.subfieldcode in (@$tags[$i])";
$sql_where1 .=" and concat(m$nb_table.tag,m$nb_table.subfieldcode) in (@$tags[$i])";
}
$sql_where2 .= "m1.authid=m$nb_table.authid and ";
$sql_where1.=")";
@ -1045,6 +1045,9 @@ Paul POULAIN paul.poulain@free.fr
# $Id$
# $Log$
# Revision 1.9.2.15 2006/03/30 14:20:03 tipaul
# don't use + on a numeric value when you want to do a concat !!!
#
# Revision 1.9.2.14 2006/03/15 15:10:29 tipaul
# added a new feature in summary building (for an authority)
# If you enter [XXX*] ([250*] for example), the whole field will be displayed as it's saved. This will solve the problem with reordered subfields.