Commit Graph

3 Commits

Author SHA1 Message Date
Lunny Xiao 9c82535c2e Fix bug when join with alias start with `a` (#2343)
Fix #2331

Reviewed-on: https://gitea.com/xorm/xorm/pulls/2343
(cherry picked from commit 6ef0a7798f)
2023-10-28 10:05:05 +08:00
FlyingOnion c73fc585bb modify limit offset implement (#2188)
Oracle and SQLServer specific: When `LIMIT OFFSET` function is needed, use `OFFSET <offset> ROWS FETCH NEXT <limit> ROWS ONLY` to replace legacy subquery.

SQLServer specific: When `ORDER BY` is not set and `OFFSET FETCH` is set, set `statement.orderStr` to `1` (`ORDER BY 1`). See [here](https://learn.microsoft.com/zh-cn/sql/t-sql/queries/select-order-by-clause-transact-sql?view=sql-server-ver16).

MySQL specific: When limit is 0 and offset > 0, use `LIMIT 9223372036854775807` ($2^{63}-1$). See comments [here](15d171ea55/internal/statements/query.go (L314)).

Reviewed-on: https://gitea.com/xorm/xorm/pulls/2188
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: FlyingOnion <731677080@qq.com>
Co-committed-by: FlyingOnion <731677080@qq.com>
(cherry picked from commit 551de3767c)
2023-10-28 09:53:09 +08:00
Lunny Xiao ed1a37b1c5 Move integrations -> tests (#2314)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2314
2023-07-26 10:44:41 +00:00