aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m
Commit message (Collapse)AuthorAgeFilesLines
* Replace all non-cyclic NSAutoreleasepools with @autoreleasepoolMax2018-05-031-143/+135
|
* * More formatting changesMax2018-05-021-27/+21
| | | | | | * Fix an unintended switch/case fallthrough (the error got caught soon afterwards, so this never really caused problems) * Fix a typo in the mysql fallback charset mappings (119 should’ve been 199) * Fix a charset confusion issue (SPMySQL’s compiled-in C strings are in UTF-8, not the connection encoding of the mysql connection)
* * Formatting and minor code changesMax2018-04-291-12/+9
| | | | * Fixed a memory leak in CF code
* Reapply changes from rolled back commit that are common to master and ↵Max2018-02-281-14/+9
| | | | | | callback-auth branches This includes 3a944d7867c750c29e02e2619d72694bdbfb0b2a, 770c18901f82696d1233e0139e9bb3c4fbbcb90b, ca864a1f887feaf7ac6d35eeb55b265f3e630a09
* Manually roll back all changes for #2979Max2018-02-271-93/+27
| | | | Those will be moved to a different branch for the time being since other stuff needs to be changed first
* Move utility function ot a different fileMax2018-02-251-29/+2
|
* #2979, #2437, #2247, #1836: Enable mysql cleartext auth without access to ↵Max2018-02-241-2/+8
| | | | keychain and with a warning to the user
* #2979: Rename a method, because it is no longer limited to keychainMax2018-02-231-2/+2
|
* Remove some (near-)duplicate codeMax2018-02-211-11/+4
|
* Next step in the #2979 experimentMax2018-02-181-16/+34
|
* Restore support for Mac OS X < 10.9 that broke in the previous commitMax2018-02-141-2/+27
|
* Experiment with #2979Max Lohrmann2018-02-141-17/+68
| | | | | * Updated libmysqlclient from 5.5.56 -> 5.5.59 * Changed the way the connection password is passed between SPMySQL and libmysqlclient
* Swap two lines of code so that if a connection attempt is cancelled, SP does ↵Max2017-11-021-2/+2
| | | | not try to open another connection to cancel the pending connection (#2909)
* SPMySQL will now enforce SSL connections when requested (#2499)Max Lohrmann2017-05-211-0/+19
| | | | Previously we could only *request* SSL, but if the server didn’t support it, libmysqlclient would go ahead anyway. This is fixed in MySQL 5.5.55.
* Fix some issues with charset handling during connectMax2017-05-021-16/+52
| | | | | | | * hostname and file paths are places where libmysqlclient ultimately only passes the string to an OS library so we should use whatever charset the OS expects, not mysql * Even though _makeRawMySQLConnectionWithEncoding:isMasterConnection: takes an explicit charset argument most of the conversion logic simply used whatever charset the existing connection currently has, which is not neccesarily the one the new connection should use * Add some remarks about the charset handling with passwords and mysql_error() * Charsets do not apply to sqlstate.
* * Turn `-[SPMySQLConnection checkConnectionIfNecessary]` into a public ↵Max2017-03-091-29/+31
| | | | | | method, since it is actually the preferable way to `-[SPMySQLConnection checkConnection]` (which forces network IO in a new thread each time) * Change `-[SPDatabaseStructure queryDbStructureWithUserInfo:]` doing a forced connection check inside a tight loop (#2306)
* Add possible socket locations for MariaDB via MacPorts.Sebastian Volland2016-08-301-3/+5
| | | | Also rename Darwinports to MacPorts in comments.
* Fix one erroneous method callMax2016-07-211-1/+1
| | | | Not sure if that may has been causing issues for some users...
* * Change a while() to do while; to help code analysisMax2016-02-181-1/+4
| | | | * Add log message (possibly related to #2258)
* Add another fallback for charset detection (which might improve ↵Max2016-02-061-1/+18
| | | | compatibility with Sphinx)
* Try to fix what could be the cause of #2353 ("Attempted to connect a ↵Max2016-01-151-1/+12
| | | | connection that is not disconnected")
* Add more debug info for "Attempted to connect a connection that is not ↵Max2016-01-131-3/+24
| | | | disconnected" crash (#2353)
* Another attempt at the 0x338 crash (#2258)Max2016-01-131-1/+1
|
* * Add a wrapper method for 3 repeatetly used callsMax2015-10-301-5/+2
|
* * Lock connection during disconnect to prevent some race conditionsMax2015-10-301-10/+20
| | | | | * Always use the server version name provided by mysql_get_server_info() as that should me more reliable * Use mysql_get_server_version() for version comparisons. Less code, official API and closer to what mysql does
* * Remove some ivars that are only used as local varsMax2015-10-261-2/+0
| | | | * Also I take back what I said about 4d97cbd4df1ebb451d89d6c4e12dd7c622d00b84 and say it will happen now *duckundweg*
* Remove a bit duplicate codeMax2015-09-301-5/+4
|
* Added fallback code for server version identification.Max2015-08-071-5/+5
| | | | | Good news: Sequel Pro can now connect to sphinxql server. Bad news: It will treat it like a MySQL 2 server (or whatever version of Sphinx is running)
* * Expand the debugging code from prev. commitMax2015-08-061-0/+7
| | | | * Also Sequel Pro will now crash on the "Attempted to connect a connection that is not disconnected" issue. That is sadly necessary to get a stack trace of ALL threads as for exceptions Feedback Reporter only gives us the current thread.
* Add code to disable mysql protocol compression (no UI) to connect to Amazon ↵Max2015-07-301-5/+21
| | | | Aurora (see #2122)
* Fix an issue on 10.7+ introduced in ce33534Max2015-07-121-1/+1
| | | | This removes a IMHO useless makeFirstResponder: call. In all cases where [NSApp mainWindow] == usedSheet (< 10.7) the call right above it would already handle it. On the other hand if [NSApp mainWindow] != usedSheet (10.7+) the call would fail anyways because in that case editTextView is not even a subview of the main window.
* SPMySQL: Count having just connected as 'connection used'Max2015-06-071-1/+1
|
* Allow to set SSL cipher list in SPMySQLMax2015-03-211-1/+8
|
* Replace some NSDictionaries with literalsMax2014-12-131-14/+14
| | | | | | * [NSDictionary dictionary] → @{} * [NSDictionary dictionaryWithObject:forKey:] can safely be replaced. object==nil would have already thrown a NPE in the past. * Also replaced some (hopefully safe) NSArray initializers (ie. their objects should always exist).
* Add support for SQLSTATEMax2014-03-051-0/+4
| | | | This commit adds the backend code to get the mysql SQLSTATE error code (to be used when displaying errors).
* Update URL in source file header to point to GitHub.Stuart Connolly2014-01-261-1/+1
|
* Remove SVN property placeholder.Stuart Connolly2014-01-261-2/+0
|
* - Clean up some connection cancellation/close-during-connect edges as a ↵rowanbeentje2012-10-141-2/+2
| | | | | | | result of r3894, attempting to improve some exceptions during aborted connections - Name threads created in SPMySQL.framework
* - In the SPMySQL.framework, separate framework-triggered connections and ↵rowanbeentje2012-10-141-104/+134
| | | | | | | | | disconnections from external actions, and use that separation to perform safer disconnects - When closing a database document, add a new notification, and use that to resolve retain cycles affecting connection processes - Improve connection controller disconnection when the document is closed, fixing crashes, by building on those two features (addresses Issue #1396) - Use some of the new functionality to improve SSH and MySQL connection cancellation, making both cancelable in the interface and making both respond much more quickly
* Improve connection handling and recovery in general, and specifically to ↵rowanbeentje2012-08-181-8/+12
| | | | | | | | | | | address Issue #877: - On servers with very short timeouts set the wait_timeout for the session as well as the interactive_timeout to prevent the connection from dropping frequently - Improve recovery from connection errors, correctly restoring the connection if appropriate and possible - Allow reconnections to occur recursively by altering the internal tracking mechanism - Fix some edge cases where the connection would remain locked incorrectly - Improve error messaging for the "MySQL Server has gone away" network case
* Improve connection keepalive, disconnect, and connection loss after ↵rowanbeentje2012-05-151-7/+31
| | | | | | | | | | | reviewing crash logs and testing a number of situations: - Improve stability of closing connections after a connection loss - Minimise prompting a user for connection state restore if closing windows/tabs - Allow cancellation of keepalive ping threads to prevent crashes after deallocation of parent - Manually handle ping thread state struct memory to avoid cross-thread deallocation issues - Improve disconnection speed and resilience
* - Fix incorrect reconnection detection in the new SPMySQL reconnection code ↵rowanbeentje2012-05-121-0/+1
| | | | paths, improving general connection robustness in recent builds
* - Fix a build warning caused by r3649 changesrowanbeentje2012-05-101-1/+1
| | | | | - Improve debug to catch a structure connection issue
* Rework connection loss handling in SPMySQL, particularly to improve ↵rowanbeentje2012-05-081-172/+231
| | | | | | | | | | | | background loss of connections: - Attempt to fix a condition causing a reconnection loop by fixing the order of connection state check and a query variable - If a connection is lost in the background, only attempt a single reconnect instead of requiring user intervention at once - Add a new connection state to handle background disconnects - If the connection has been lost in the background but is about to be used, reconnect it automatically (informing the user of loss if appropriate) - Don't attempt background reconnections if the connection has not been used for some time (Also update localisable strings, and tweak navigator controller connection usage)
* - Correctly call mysql_library_init() on application start, and ↵rowanbeentje2012-04-181-0/+61
| | | | mysql_thread_init() and mysql_thread_end() on each thread as appropriate. This will improve observed MySQL stability, especially in certain circumstances such as LOAD DATA INFILE.
* - Fix SPMySQL warnings about delegate and proxy methods mixing synthesized ↵rowanbeentje2012-03-291-2/+1
| | | | | | | getters and manually overridden setters - Fix autoincrement ID retrieval in SPMySQL, addressing issues previewing rows when the setting for "Reload Table After: Adding a row" is not being used
* - Correctly nest reconnection attempts to preserve previous connection ↵rowanbeentje2012-03-281-2/+7
| | | | settings in SPMySQL when connections time out, addressing Issue #1309
* SPMySQL integration bugfixes:rowanbeentje2012-03-141-1/+1
| | | | | | | - Fix a bug where the socket path would not be autodetected if an empty string was supplied - Fix a bug fetching primary key column names for tables - Fix a bug building database structures on MySQL 3.x servers
* Final feature work on the SPMySQL branch before merging:rowanbeentje2012-03-141-8/+8
| | | | | | | | - Add a ping keepalive managing object to prevent retain cycles from the NSTimer - Add -[SPMySQLConnection copy] support - Refactor Hans-Jörg Bibiko's database structure retrieval, moving it out of the MySQL framework and building it around a copy of the connection. This reduces the amount of connections-over-time used by Sequel Pro to two constant connections (addressing Issue #1097) and improves robustness. - Use the database structure retrieval connection for faster query cancellation without an extra connection required, if possible
* Initial commit of the new SPMySQL Framework, which is added to the project ↵rowanbeentje2012-02-201-0/+834
and ready for use but not yet integrated. This new framework should provide much of the functionality required from MCPKit and is based around its interface for relatively easy integration. The largest missing component is Hans' structure code which I believe is better placed outside the framework. From the Readme file: The SPMySQL Framework is intended to provide a stable MySQL connection framework, with the ability to run text-based queries and rapidly retrieve result sets with conversion from MySQL data types to Cocoa objects. SPMySQL.framework has an interface loosely based around that provided by MCPKit by Serge Cohen and Bertrand Mansion (http://mysql-cocoa.sourceforge.net/), and in particular the heavily modified Sequel Pro version (http://www.sequelpro.com/). It is a full rewrite of the original framework, although it includes code from patches implementing the following Sequel Pro functionality, largely contributed by Hans-Jörg Bibiko, Stuart Connolly, Jakob Egger, and Rowan Beentje: - Connection locking (Jakob et al) - Ping & keepalive (Rowan et al) - Query cancellation (Rowan et al) - Delegate setup (Stuart et al) - SSL support (Rowan et al) - Connection checking (Rowan et al) - Version state (Stuart et al) - Maximum packet size control (Hans et al) - Result multithreading and streaming (Rowan et al) - Improved encoding support & switching (Rowan et al) - Database structure; moved to inside the app (Hans et al) - Query reattempts and error-handling approach (Rowan et al) - Geometry result class (Hans et al) - Connection proxy (Stuart et al)