Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

.DS_Store
21 changes: 13 additions & 8 deletions MySQLDriver.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -860,7 +861,7 @@
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand Down Expand Up @@ -913,7 +914,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand Down Expand Up @@ -962,6 +963,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand Down Expand Up @@ -1000,6 +1002,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down Expand Up @@ -1055,7 +1058,7 @@
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -1106,7 +1109,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -1159,7 +1162,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand Down Expand Up @@ -1200,7 +1203,7 @@
PRODUCT_BUNDLE_IDENTIFIER = mcorega.MySQLDriveriOSTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand Down Expand Up @@ -1253,6 +1256,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand Down Expand Up @@ -1297,6 +1301,7 @@
PRODUCT_BUNDLE_IDENTIFIER = mcorega.MySQLSampleiOS;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
Expand Down Expand Up @@ -1341,7 +1346,7 @@
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand Down Expand Up @@ -1377,7 +1382,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = macosx;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>MySQLDriver.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
</dict>
<key>MySQLDriveriOS.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>3</integer>
</dict>
<key>MySQLSampleOSX.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
<key>MySQLSampleiOS.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
</dict>
</dict>
</plist>
6 changes: 3 additions & 3 deletions MySqlSwiftNative.podspec
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Pod::Spec.new do |s|

s.name = "MySqlSwiftNative"
s.version = "1.0.10"
s.version = "1.4.1"
s.summary = "MySQL Native Swift Driver."
s.homepage = "https://github.com/mcorega/MySqlSwiftNative"
s.license = { :type => 'Copyright', :file => 'LICENSE' }
s.author = { "Marius Corega" => "mcorega@gmail.com" }
s.ios.deployment_target = "8.0"
s.osx.deployment_target = "10.9"
s.source = { :git => "https://github.com/mcorega/MySqlSwiftNative.git", :tag => "1.0.10" }
s.source_files = 'Sources/MySqlSwiftNative/*.{h,m,swift}'
s.source = { :git => "https://github.com/mcorega/MySqlSwiftNative.git", :tag => "1.4.1" }
s.source_files = 'Sources/MySQLDriver/*.{h,m,swift}'

end
4 changes: 2 additions & 2 deletions Sources/MySQLDriver/Statement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ public extension MySQL {
break

case let str as String:
if str.characters.count < MySQL.maxPackAllowed - 1024*1024 {
let lenArr = MySQL.Utils.lenEncIntArray(UInt64(str.characters.count))
if str.count < MySQL.maxPackAllowed - 1024*1024 {
let lenArr = MySQL.Utils.lenEncIntArray(UInt64(str.count))
dataTypeArr += [UInt8].UInt16Array(UInt16(MysqlTypes.MYSQL_TYPE_STRING))
argsArr += lenArr
argsArr += [UInt8](str.utf8)
Expand Down
13 changes: 6 additions & 7 deletions Sources/MySQLDriver/Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ extension MySQL {

static func encPasswd(_ pwd:String, scramble:[UInt8]) -> [UInt8]{

if pwd.characters.count == 0 {
if pwd.count == 0 {
return [UInt8]()
}

Expand Down Expand Up @@ -386,12 +386,11 @@ public extension Date
static var dateStringFormatter : DateFormatter? = nil
static var token : Int = 0
}

// dispatch_once(&statDFT.token) {
statDFT.dateStringFormatter = DateFormatter()
statDFT.dateStringFormatter!.dateFormat = "yyyy-MM-dd HH:mm:ss.SSSSSS"
statDFT.dateStringFormatter!.locale = Locale(identifier: "en_US_POSIX")
// }

statDFT.dateStringFormatter = DateFormatter()
statDFT.dateStringFormatter!.dateFormat = "yyyy-MM-dd HH:mm:ss.SSSSSS"
statDFT.dateStringFormatter!.timeZone = TimeZone(abbreviation: "UTC")
statDFT.dateStringFormatter!.locale = Locale(identifier: "en_US_POSIX")

if let d = statDFT.dateStringFormatter!.date(from: dateTimeStringUsec) {
self.init(timeInterval:0, since:d)
Expand Down
4 changes: 2 additions & 2 deletions Sources/MySQLDriver/sha1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ func arrayOfBytes<T: BinaryInteger>(_ value: T, length totalBytes: Int = MemoryL
bytes[totalBytes - 1 - j] = (bytesPointer + j).pointee
}

valuePointer.deinitialize()
valuePointer.deallocate(capacity: 1)
valuePointer.deinitialize(count: 1)
valuePointer.deallocate()

return bytes
}
Expand Down