Commit Graph

1783 Commits

Author SHA1 Message Date
CyJaySong d35a3e00b9 Fix code 2023-10-28 15:34:48 +08:00
CyJaySong f758792496 Merge branch 'master' into main2
# Conflicts:
#	tests/session_insert_test.go
2023-10-28 15:25:15 +08:00
CyJaySong 6f9df57c50 Fix code 2023-10-28 15:19:43 +08:00
CyJaySong 747a357ea9 Fix the issue of incorrect insertion of data in non UTC time zone zero for numeric types 2023-10-28 15:18:48 +08:00
CyJaySong 0311205d4d Fix the issue of incorrect insertion of data in non UTC time zone zero for numeric types 2023-10-28 10:13:11 +08:00
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
Lunny Xiao 37fd7d3c15 some refactors for write functions (#2342)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2342
(cherry picked from commit 0f085408af)
2023-10-28 10:05:02 +08:00
zzdboy 9dc48367c8 fix KingbaseES version (#2335)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2335
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zzdboy <28206697@qq.com>
Co-committed-by: zzdboy <28206697@qq.com>
(cherry picked from commit 3eda0f7805)
2023-10-28 09:53:11 +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
Ryan Liu be88b18a8e fix the error in mysql: unknown colType UNSIGNED FLOAT (#2143)
Error: unknown colType UNSIGNED FLOAT
in mysql 5.6.27 or 5.7.32

Fix #2123

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2143
Co-authored-by: Ryan Liu <azhai@126.com>
Co-committed-by: Ryan Liu <azhai@126.com>
(cherry picked from commit ac88a5705a)
2023-10-28 09:53:07 +08:00
6543 13120b6d55 Remove dead code from session.SyncWithOptions() (#2323)
db7c264062/sync.go (L229-L231)

as oriIndex only is **not** nil if index.Equal(index2)

and index.Equal(index2) check if `oriIndex.Type == index.Type` ... so it always is false

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2323
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-committed-by: 6543 <6543@obermui.de>
(cherry picked from commit e5be0f4129)
2023-10-28 09:53:04 +08:00
zzdboy d98f626ae7 fix PostgreSQL version (#2332)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2332
Co-authored-by: zzdboy <28206697@qq.com>
Co-committed-by: zzdboy <28206697@qq.com>
(cherry picked from commit 2885c88b77)
2023-10-28 09:53:02 +08:00
Lunny Xiao 6a9b4ef926 Add test for max ( id ) (#2316)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2316
(cherry picked from commit 407375c9b4)
2023-10-28 09:53:00 +08:00
Lunny Xiao 6b554f8b74 Fix ci (#2330)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2330
(cherry picked from commit eeacd22674)
2023-10-28 09:52:51 +08:00
CyJaySong ad73876977 Merge remote-tracking branch 'cyjay/master' 2023-10-28 09:51:12 +08:00
CyJaySong 24540c9e23 Fix the issue of incorrect insertion of data in non UTC time zone zero for numeric types 2023-10-28 09:49:51 +08:00
Lunny Xiao 6ef0a7798f Fix bug when join with alias start with `a` (#2343)
Fix #2331

Reviewed-on: https://gitea.com/xorm/xorm/pulls/2343
2023-10-25 11:01:46 +00:00
Lunny Xiao 0f085408af some refactors for write functions (#2342)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2342
2023-10-25 07:11:18 +00:00
lng2020 dbe499091a Revert "Fix deleted tag attribute zeroTime is not DatabaseTZ (#2299)" (#2341)
Related #2339

Reviewed-on: https://gitea.com/xorm/xorm/pulls/2341
Co-authored-by: lng2020 <nanguanlin6@gmail.com>
Co-committed-by: lng2020 <nanguanlin6@gmail.com>
2023-10-17 09:41:42 +00:00
zzdboy 3eda0f7805 fix KingbaseES version (#2335)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2335
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zzdboy <28206697@qq.com>
Co-committed-by: zzdboy <28206697@qq.com>
2023-09-24 03:52:50 +00:00
FlyingOnion 551de3767c 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>
2023-09-20 02:07:03 +00:00
Ryan Liu ac88a5705a fix the error in mysql: unknown colType UNSIGNED FLOAT (#2143)
Error: unknown colType UNSIGNED FLOAT
in mysql 5.6.27 or 5.7.32

Fix #2123

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2143
Co-authored-by: Ryan Liu <azhai@126.com>
Co-committed-by: Ryan Liu <azhai@126.com>
2023-09-16 15:43:12 +00:00
6543 e5be0f4129 Remove dead code from session.SyncWithOptions() (#2323)
db7c264062/sync.go (L229-L231)

as oriIndex only is **not** nil if index.Equal(index2)

and index.Equal(index2) check if `oriIndex.Type == index.Type` ... so it always is false

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2323
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-committed-by: 6543 <6543@obermui.de>
2023-09-16 14:41:02 +00:00
zzdboy 2885c88b77 fix PostgreSQL version (#2332)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2332
Co-authored-by: zzdboy <28206697@qq.com>
Co-committed-by: zzdboy <28206697@qq.com>
2023-09-16 13:49:19 +00:00
Lunny Xiao 407375c9b4 Add test for max ( id ) (#2316)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2316
2023-09-16 13:48:49 +00:00
Lunny Xiao eeacd22674 Fix ci (#2330)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2330
2023-09-13 02:02:12 +00:00
CyJaySong 37eadc847c Merge pull request 'merge xorm:master' (#2) from xorm/xorm:master into master
Reviewed-on: https://gitea.com/CyJaySong/xorm/pulls/2
2023-08-18 07:10:33 +00:00
6543 db7c264062 Add Sync options to ignore constrains and indices (#2320)
needed for https://github.com/woodpecker-ci/woodpecker/pull/2117

Reviewed-on: https://gitea.com/xorm/xorm/pulls/2320
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-committed-by: 6543 <6543@obermui.de>
2023-08-09 03:28:52 +00:00
Lunny Xiao ac84217e14 Exec support conversion data (#1970)
Fix #1803

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1970
2023-08-07 10:54:57 +00:00
CyJaySong 620074d751 Merge remote-tracking branch 'cyjay/master' 2023-08-07 13:38:05 +08:00
CyJaySong 2d9e07360a Merge branch 'master'
# Conflicts:
#	tests/session_insert_test.go
2023-08-07 13:36:42 +08:00
CyJaySong 94882e39df Fix deleted tag attribute zeroTime is not DatabaseTZ (#2299)
Co-authored-by: CyJay <cyjay@MacBook-Pro.lan>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2299
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: CyJaySong <CyJaySong@gmail.com>
Co-committed-by: CyJaySong <CyJaySong@gmail.com>
2023-08-07 04:28:55 +00:00
Lunny Xiao d9f3ee63ef
improve tests 2023-08-07 11:53:36 +08:00
CyJaySong fff2adbf77 fix code 2023-07-27 18:00:03 +08:00
CyJaySong 6c8799fdea SQL Server database, default mapping of time type to DATETIME2 2023-07-27 17:22:07 +08:00
CyJaySong 3396c4cbba fix String2Time 2023-07-27 16:42:17 +08:00
CyJaySong 64ad1ac161 fix String2Time 2023-07-27 16:31:09 +08:00
CyJaySong 0c82bad52b Merge branch 'master' 2023-07-27 14:57:43 +08:00
Lunny Xiao c622cdaf89
Add ignore 2023-07-26 18:46:36 +08:00
Lunny Xiao e2af77de3b
remove unused files 2023-07-26 18:45:28 +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
CyJaySong 4b458f1c75 Merge remote-tracking branch 'cyjay/master' 2023-07-26 15:51:21 +08:00
CyJaySong 82327cba2f fix code 2023-07-26 15:51:03 +08:00
CyJaySong 9e362d7913 Merge branch 'master'
# Conflicts:
#	convert/time.go
2023-07-26 15:35:54 +08:00
Lunny Xiao 47003ff937 Delete Limit with start will return error because it's not supported by database (#1895)
Fix #1894

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1895
2023-07-26 06:58:55 +00:00
Lunny Xiao 12ec038853 Add test for get customized types (#2194)
Fix #2097

Reviewed-on: https://gitea.com/xorm/xorm/pulls/2194
2023-07-26 03:03:01 +00:00
Lunny Xiao b75df472e4 Merge branch 'master' of gitea.com:CyJaySong/xorm into CyJaySong-master 2023-07-26 09:47:36 +08:00
takumin 1572367155 Add dialects/time_test.go (#2169)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2169
Co-authored-by: takumin <takumiiinn@gmail.com>
Co-committed-by: takumin <takumiiinn@gmail.com>
2023-07-26 00:57:40 +00:00
Lunny Xiao 59b727260d Check orderby validate (#2313)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2313
2023-07-25 14:02:38 +00:00
Lunny Xiao cb4f310151 Refactor write update (#2310)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2310
2023-07-25 10:49:55 +00:00