Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
b588280b
Commit
b588280b
authored
Nov 21, 2014
by
Matija Obreza
Browse files
BUG: single null values in filter are ignored
parent
6840cb46
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/service/impl/DirectMysqlQuery.java
View file @
b588280b
...
...
@@ -173,7 +173,7 @@ public class DirectMysqlQuery {
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"Parameter count: "
+
params
.
size
());
LOG
.
debug
(
"Count query:\n"
+
sb
.
toString
());
LOG
.
debug
(
"Count query:\n"
+
sb
.
toString
()
+
" "
+
whereBuffer
.
toString
()
);
}
return
this
;
...
...
@@ -214,11 +214,11 @@ public class DirectMysqlQuery {
LOG
.
debug
(
"Handling "
+
dbName
);
}
if
(
appliedFilter
!=
null
&&
appliedFilter
.
getValues
().
size
()
>
0
)
{
if
(
appliedFilter
!=
null
&&
appliedFilter
.
size
()
>
0
)
{
Set
<
FilterValue
>
filterValues
=
appliedFilter
.
getValues
();
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"Adding "
+
appliedFilter
+
" sz="
+
filterValues
.
size
()
+
" t="
+
appliedFilter
.
getClass
().
getSimpleName
());
LOG
.
debug
(
"Adding "
+
appliedFilter
+
" sz="
+
appliedFilter
.
size
()
+
" t="
+
appliedFilter
.
getClass
().
getSimpleName
());
}
if
(
sb
.
length
()
==
0
)
{
...
...
@@ -226,7 +226,7 @@ public class DirectMysqlQuery {
}
else
{
sb
.
append
(
" and "
);
}
// Opening
if
(
appliedFilter
.
isInverse
())
{
sb
.
append
(
" NOT "
);
...
...
@@ -234,12 +234,8 @@ public class DirectMysqlQuery {
sb
.
append
(
" ( "
);
// A filter value can be (a) explicit value or (b) an operation
int
toHandle
=
filterValues
.
size
();
if
(
appliedFilter
.
getWithNull
())
{
toHandle
++;
}
int
toHandle
=
appliedFilter
.
size
();
// (a) explicit values are handled by =? or by IN (?,?,..)
int
handledCount
=
handleExplicitValues
(
sb
,
dbName
,
filterValues
,
params
);
...
...
src/main/java/org/genesys2/server/service/impl/FilterHandler.java
View file @
b588280b
...
...
@@ -485,7 +485,15 @@ public class FilterHandler {
return
true
;
}
/**
* Returns the number of applied values, +1 when null is included
*
* @return
*/
public
int
size
()
{
if
(
withNull
)
{
return
values
.
size
()
+
1
;
}
return
values
.
size
();
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment