Skip to content

Commit

Permalink
Fix select issue with block-break (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
PotatoPresident committed Jun 28, 2021
1 parent 5ac0ba0 commit 458802d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ import org.jetbrains.exposed.sql.Op
import org.jetbrains.exposed.sql.Query
import org.jetbrains.exposed.sql.SchemaUtils
import org.jetbrains.exposed.sql.SortOrder
import org.jetbrains.exposed.sql.StdOutSqlLogger
import org.jetbrains.exposed.sql.Transaction
import org.jetbrains.exposed.sql.addLogger
import org.jetbrains.exposed.sql.alias
import org.jetbrains.exposed.sql.andWhere
import org.jetbrains.exposed.sql.batchInsert
Expand Down Expand Up @@ -223,7 +225,7 @@ object DatabaseManager {
) {
if (paramSet.isNullOrEmpty()) return

var operator = Op.build { column eq paramSet.first() }
var operator = Op.build { column eq paramSet.first() or (orColumn eq paramSet.first()) }

paramSet.stream().skip(1).forEach { param ->
operator = operator.or { column eq param or (orColumn eq param) }
Expand Down Expand Up @@ -320,6 +322,7 @@ object DatabaseManager {
private fun Transaction.selectActionsSearch(params: ActionSearchParams, page: Int): SearchResults {
val actionTypes = mutableListOf<ActionType>()
var totalActions: Long = 0
addLogger(StdOutSqlLogger)

var query = buildQuery(params)

Expand Down

0 comments on commit 458802d

Please sign in to comment.