tina4ruby 3.13.45 → 3.13.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/tina4/drivers/mssql_driver.rb +7 -1
- data/lib/tina4/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 46946847036ae1f2e6a3fede0084ffe84ab4144b7ec7a16570048b70994a7bee
|
|
4
|
+
data.tar.gz: db9caef85f32313bf13190f4ed5c3501c7783e82a155b5e59b7f21a6f87bd2f9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: decedd4ef3df3a7ee7243e64975ecc76471c763ec18fe2f8d024e683e02e3329c016baeff41c680cc75747c90cda61b4581fd7370ce34629a141f3fd6faf8489
|
|
7
|
+
data.tar.gz: fd1c3e6b602d540388a56b2a0288d903adafc4e137b232645e7ee3e871c20885edadc531528ce443bd800045c175734666db312efed827cb8cef4c550dcd9cb1
|
|
@@ -76,7 +76,13 @@ module Tina4
|
|
|
76
76
|
end
|
|
77
77
|
|
|
78
78
|
def apply_limit(sql, limit, offset = 0)
|
|
79
|
-
|
|
79
|
+
# SQL Server's OFFSET/FETCH paging REQUIRES an ORDER BY. A query with
|
|
80
|
+
# none (a fetch_one aggregate like "SELECT COUNT(*)" / "SELECT MAX(id)",
|
|
81
|
+
# or any unordered SELECT given a limit) otherwise raises "Incorrect
|
|
82
|
+
# syntax near '0'" at the OFFSET. Append a no-op ORDER BY (SELECT NULL)
|
|
83
|
+
# when the SQL has no ORDER BY, mirroring the Python master (mssql.py).
|
|
84
|
+
ordered = sql =~ /\bORDER\s+BY\b/i ? sql : "#{sql} ORDER BY (SELECT NULL)"
|
|
85
|
+
"#{ordered} OFFSET #{offset} ROWS FETCH NEXT #{limit} ROWS ONLY"
|
|
80
86
|
end
|
|
81
87
|
|
|
82
88
|
def begin_transaction
|
data/lib/tina4/version.rb
CHANGED