Commit Graph

1732 Commits

Author SHA1 Message Date
Douglas Danger Manley 13f96f7a15
Spelling fix for "condtion" -> "condition" (#3042)
This fixes a spelling error in the word "condition"; in particular,
the `BuildCondtion` function should be named `BuildCondition`.
2020-06-08 11:38:51 +08:00
Jinzhu 8f8d549ca3 Refactor merge where exprs 2020-06-08 09:13:34 +08:00
Douglas Danger Manley 72d0fa6196 Fix Statement Where clone array corruption in v2
Method-chaining in gorm is predicated on a `Clause`'s `MergeClause`
method ensuring that the two clauses are disconnected in terms of
pointers (at least in the Wherec case).

However, the original Where implementation used `append`, which
only returns a new instance if the backing array needs to be resized.
In some cases, this is true.  Practically, go doubles the size of the
slice once it gets full, so the following slice `append` calls would
result in a new slice:

* 0 -> 1
* 1 -> 2
* 2 -> 4
* 4 -> 8
* and so on.

So, when the number of "where" conditions was 0, 1, 2, or 4, method-chaining
would work as expected.  However, when it was 3, 5, 6, or 7, modifying the
copy would modify the original.

This also updates the "order by", "group by" and "set" clauses.
2020-06-07 16:54:01 -04:00
Jinzhu e7b2e92ce3 Remove RecordNotFound method 2020-06-07 22:03:45 +08:00
Jinzhu 31a0553b82 Fix FileWithLineNum on windows 2020-06-07 18:37:05 +08:00
Jinzhu d11c424334 Fix typo 2020-06-07 15:26:43 +08:00
Jinzhu 4a4b8234de Update issues template 2020-06-07 13:16:09 +08:00
Jinzhu 82d55b1054 Add OnConflict DoUpdates test 2020-06-07 12:50:00 +08:00
Jinzhu 93043334c3
Create FUNDING.yml 2020-06-07 12:47:26 +08:00
Jinzhu 6937d713c3 Refactor clauses 2020-06-06 22:52:08 +08:00
Jinzhu 38d1cd2bf1 Replace For with Locking 2020-06-06 21:35:28 +08:00
Jinzhu 52b763aab3 Add convert map Assignments helper 2020-06-06 17:47:30 +08:00
Jinzhu 1acbb34406 Update wercker.yml 2020-06-06 15:05:24 +08:00
Jinzhu ebb8511d59 Add go.sum 2020-06-06 14:28:59 +08:00
Jinzhu edd4be3fcb Update README 2020-06-06 14:23:47 +08:00
Jinzhu a954d772d7 Support customize gorm field type 2020-06-06 10:47:32 +08:00
Jinzhu 1490a062db Refactor codebase and add benchmark test 2020-06-05 23:26:56 +08:00
Jinzhu 163200d05f Test Hooks 2020-06-05 20:24:15 +08:00
Jinzhu eda2f023b0 Add Distinct support 2020-06-05 19:19:12 +08:00
Jinzhu d50879cc28 Add field permission test 2020-06-05 19:18:22 +08:00
Jinzhu c8e7878b3e Add PrepareStmt support 2020-06-05 11:40:24 +08:00
Jinzhu 9934207c42 Fix logger panic on windows 2020-06-03 14:39:36 +08:00
Jinzhu b32658358c Fix can't scan null value into normal data types 2020-06-03 09:00:20 +08:00
Jinzhu 94685d1024 Fix can't scan null value into normal data types 2020-06-02 23:30:26 +08:00
Jinzhu 2218e32999 Allow customize table name with TableName 2020-06-02 15:48:19 +08:00
Jinzhu e959a67f87 Fix callbacks with Match 2020-06-02 12:46:55 +08:00
Jinzhu 669ce48f19 Fix order by primary key if it is not defined 2020-06-02 11:30:21 +08:00
Jinzhu 64ed645e4d Returns ping error 2020-06-02 11:09:17 +08:00
Jinzhu 8bb05a5a69 Refactor tests files 2020-06-02 10:50:38 +08:00
Jinzhu 5790ba9ef4 Fix package path 2020-06-02 09:25:55 +08:00
Jinzhu e986371a42 Rename package name 2020-06-02 09:18:01 +08:00
Jinzhu 5ecbf25b22 Drop table with CASCADE option 2020-06-02 07:56:53 +08:00
Jinzhu b71171dd92 Add more preload tests 2020-06-02 01:34:00 +08:00
Jinzhu bc01eb28ad Fix tests script 2020-06-02 00:24:16 +08:00
Jinzhu 9807fffdbc Fix mssql tests 2020-06-02 00:03:38 +08:00
Jinzhu e490e09db5 Add SetupJoinTable support 2020-06-01 23:58:22 +08:00
Jinzhu db03616993 Add customize column test 2020-06-01 21:39:08 +08:00
Jinzhu 4e147e1256 Test SubQuery 2020-06-01 21:26:23 +08:00
Jinzhu 1559fe24e5 Add more updates test 2020-06-01 19:41:33 +08:00
Jinzhu dffc2713f0 Add mores tests for query 2020-06-01 10:54:32 +08:00
Jinzhu 76b8e78dcb Add multi primary keys test 2020-06-01 08:13:16 +08:00
Jinzhu a02cb39a45 Add more tests 2020-06-01 00:36:18 +08:00
Jinzhu befef0c9a9 Improve Hooks 2020-06-01 00:12:20 +08:00
Jinzhu 95a6539331 Test Pluck 2020-05-31 21:11:20 +08:00
Jinzhu e26abb84b3 Test block global update/delete 2020-05-31 20:42:07 +08:00
Jinzhu 5b1d3e4a77 Test Joins 2020-05-31 20:21:52 +08:00
Jinzhu 749ca37eb0 Add sql builder test 2020-05-31 19:23:32 +08:00
Jinzhu 5457fe88e6 Test Transactions 2020-05-31 18:51:43 +08:00
Jinzhu ae9e4f1dd8 Fix change log level 2020-05-31 17:49:31 +08:00
Jinzhu 49310d0974 Test override foreign key, reference 2020-05-31 17:42:21 +08:00