Skip to content

Commit 03f9797

Browse files
committed
Merge origin/3 into 3
2 parents 2dc9267 + 3d0381b commit 03f9797

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

Tests/MySQLTests/MySQLTests.swift

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,22 @@ class MySQLTests: XCTestCase {
196196
let client = try MySQLConnection.makeTest()
197197
defer { client.close(done: nil) }
198198

199+
if
200+
let version: MySQLData = try client.simpleQuery("SELECT @@version").wait()[0]["@@version"],
201+
let numbers: [String] = version.string()?.split(separator: ".").map(String.init),
202+
let major: Int = Int(numbers[0]),
203+
let minor: Int = Int(numbers[1]),
204+
major <= 5, minor <= 6
205+
{
206+
print("Exiting .testSaveJSON test case. JSON is not supported in the current version of MySQL")
207+
return
208+
}
209+
210+
199211
try client.drop(table: Nested.self).ifExists().run().wait()
200212
try client.create(table: Nested.self)
201-
.column(for: \Nested.id, .notNull, .primaryKey, .unique())
202-
.column(for: \Nested.data, .notNull)
213+
.column(for: \Nested.id, type: .bigint, .notNull, .primaryKey, .unique())
214+
.column(for: \Nested.data, type: .json, .notNull)
203215
.run().wait()
204216

205217
try client.insert(into: Nested.self).value(Nested(id: 1, data: ["description": "JSON data"])).run().wait()

0 commit comments

Comments
 (0)