                                    expand-user-query
                                    (convert-to-plan query-rec paging-options)
                                    extract-all-params)
-        sql (-> plan fix-plan-in-expr-multi-comparisons plan->sql)
+        sql (plan->sql plan)
         paged-sql (jdbc/paged-sql sql paging-options)]
     (cond-> {:results-query (apply vector paged-sql params)}
       include_total (assoc :count-query (apply vector (jdbc/count-sql sql) params)))))

              (create-extract-node* cols expr))
      (create-extract-node* query-rec cols expr))))

(defn- fv-variant [x]
  (case x
    :integer {:type :integer
              :field :fv.value_integer}
    :float {:type :float
            :field :fv.value_float}
    :string {:type :string
             :field :fv.value_string}
    :boolean {:type :boolean
              :field :fv.value_boolean}))

(defn user-node->plan-node
  "Create a query plan for `node` in the context of the given query (as `query-rec`)"
  [query-rec node]

                                         :value (su/array-to-param "timestamp"
                                                                   java.sql.Timestamp
                                                                   (map to-timestamp value))})
                :integer
                (map->InArrayExpression {:column cinfo
                                         :value (su/array-to-param "bigint"
