GUACAMOLE-525: Remove LIMIT and use TOP in SQL Server module.

This commit is contained in:
Nick Couchman
2018-03-13 17:47:35 -04:00
parent b8a5f0bd22
commit cb580c4ae9
2 changed files with 3 additions and 8 deletions

View File

@@ -34,7 +34,7 @@
<!-- Select all password records for a given user --> <!-- Select all password records for a given user -->
<select id="select" resultMap="PasswordRecordResultMap"> <select id="select" resultMap="PasswordRecordResultMap">
SELECT SELECT TOP (#{maxHistorySize,jdbcType=INTEGER})
[guacamole_user_password_history].user_id, [guacamole_user_password_history].user_id,
[guacamole_user_password_history].password_hash, [guacamole_user_password_history].password_hash,
[guacamole_user_password_history].password_salt, [guacamole_user_password_history].password_salt,
@@ -45,7 +45,6 @@
[guacamole_user].username = #{username,jdbcType=VARCHAR} [guacamole_user].username = #{username,jdbcType=VARCHAR}
ORDER BY ORDER BY
[guacamole_user_password_history].password_date DESC [guacamole_user_password_history].password_date DESC
LIMIT #{maxHistorySize}
</select> </select>

View File

@@ -89,7 +89,7 @@
<!-- Search for specific user records --> <!-- Search for specific user records -->
<select id="search" resultMap="UserRecordResultMap"> <select id="search" resultMap="UserRecordResultMap">
SELECT SELECT TOP (#{limit,jdbcType=INTEGER})
[guacamole_user_history].remote_host, [guacamole_user_history].remote_host,
[guacamole_user_history].user_id, [guacamole_user_history].user_id,
[guacamole_user_history].username, [guacamole_user_history].username,
@@ -128,14 +128,12 @@
<if test="sortPredicate.descending">DESC</if> <if test="sortPredicate.descending">DESC</if>
</foreach> </foreach>
LIMIT #{limit,jdbcType=INTEGER}
</select> </select>
<!-- Search for specific user records --> <!-- Search for specific user records -->
<select id="searchReadable" resultMap="UserRecordResultMap"> <select id="searchReadable" resultMap="UserRecordResultMap">
SELECT SELECT TOP (#{limit,jdbcType=INTEGER})
[guacamole_user_history].remote_host, [guacamole_user_history].remote_host,
[guacamole_user_history].user_id, [guacamole_user_history].user_id,
[guacamole_user_history].username, [guacamole_user_history].username,
@@ -180,8 +178,6 @@
<if test="sortPredicate.descending">DESC</if> <if test="sortPredicate.descending">DESC</if>
</foreach> </foreach>
LIMIT #{limit,jdbcType=INTEGER}
</select> </select>
</mapper> </mapper>