necouchman commented on a change in pull request #546:
URL: https://github.com/apache/guacamole-client/pull/546#discussion_r514359987



##########
File path: 
extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/src/main/resources/org/apache/guacamole/auth/jdbc/connection/ConnectionRecordMapper.xml
##########
@@ -108,28 +108,35 @@
         LEFT JOIN guacamole_user       ON guacamole_connection_history.user_id 
      = guacamole_user.user_id
 
         <!-- Search terms -->
-        <foreach collection="terms" item="term"
-                 open="WHERE " separator=" AND ">
-            (
-
-                guacamole_connection_history.user_id IN (
-                    SELECT user_id
-                    FROM guacamole_user
-                    WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN username) 
> 0
-                )
+        <where>
+            
+            <if test="identifier != null">
+                guacamole_connection_history.connection_id = 
#{identifier,jdbcType=VARCHAR}
+            </if>
+            
+            <foreach collection="terms" item="term" separator=" AND ">

Review comment:
       Hmmmm...well, I thought it would, but looking at the documentation, now, 
I'm not so sure.  I'll dig in and do some testing, and maybe add an extra `AND` 
above the `<foreach>` just for kicks. The documentation does say that it knows 
to trim extra ones, so adding an `AND` would probably be the safest route if 
I'm unable to determine exactly how it is designed to behave.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to