diff --git a/lib/gitlab/database/migration_helpers.rb b/lib/gitlab/database/migration_helpers.rb
index 9b662d163f017f79e0519ccdbfc3b995348f617c..1fe6c1143d5cf67c72c20e19792d76d431a69260 100644
--- a/lib/gitlab/database/migration_helpers.rb
+++ b/lib/gitlab/database/migration_helpers.rb
@@ -39,7 +39,8 @@ module Gitlab
       def update_column_in_batches(table, column, value)
         quoted_table = quote_table_name(table)
         quoted_column = quote_column_name(column)
-        quoted_value = quote(value)
+        # workaround for #17711
+        quoted_value = connection.quote(value)
         processed = 0
 
         total = exec_query("SELECT COUNT(*) AS count FROM #{quoted_table}").