aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m
Commit message (Collapse)AuthorAgeFilesLines
* Warning: this branch commit is largely untested, and known to throw ↵rowanbeentje2012-02-231-3402/+0
| | | | | | | | | | | | exceptions as database structure retrieval is currently missing! Further work on SPMySQLFramework integration: - Improve SPMySQL framework build settings including correct ppc builds and a Distribution configuration for the build distributions to match - Add new convenience querying and result methods to the framework - Amend Sequel Pro source to use the new SPMySQL.framework methods everywhere, replacing MCPKit methods where they differ and improving some functions - Remove MCPKit from the source - Fix a number of warnings on Release-style builds
* - Make SPConnectionController a NSConnectionView subclass so that retain ↵rowanbeentje2012-01-211-1/+1
| | | | cycles caused by manually loading libs with bindings to File's Owner are automatically handled, fixing leaks of SPConnectionController and items it retain including any MCPConnection; this will fix issues with MCPConnections attempting to reconnect but no longer having an associated SPDatabaseDocument
* - Add Zend Server CE compatibility to the default socket search list, path ↵rowanbeentje2012-01-051-0/+1
| | | | as given in Issue #1251
* - Fix an issue in MCPConnection causing connection locking if the ↵rowanbeentje2011-10-281-1/+17
| | | | connection has an active query and is performing actions such as encoding conversions
* * Fixes a minor bug where the server time zone would not be detected correctlydmoagx2011-10-071-1/+2
|
* - Improve time zone checking to account for NULL timezones, which should ↵rowanbeentje2011-09-121-3/+3
| | | | address Issue #1181
* - Improve interactive_timeout handling, ensuring a minimum timeout of five ↵rowanbeentje2011-08-081-0/+9
| | | | | | | minutes to improve keepalive behaviour. This improves on r3369 and should complete Issue #877. - Fix memory leak added in r3382
* Fix encoding issues, particularly giving errors when selecting tables and ↵rowanbeentje2011-08-071-112/+109
| | | | | | | | | | | displaying NULLs within tables when the connection encoding is incorrectly detected (Issue #1100): - No longer rely on a combination of mysql_options(..., MYSQL_SET_CHARSET_NAME, ...utf8...) and mysql_character_set_name() to detect the connection encoding; this incorrectly misses init_connect commands; instead use SHOW_VARIABLES a$ - Combine initial version check/timezone check/encoding check on startup, reducing connection queries and thus improving connection speed - Add support for abbreviated MySQL timezone definitions - Combine MCPKit's -connect and -connectWithLogin:password:host:port:socket: methods to reduce code duplication and fix argument handling for the latter method
* - Ensure the CLIENT_INTERACTIVE is correctly set for MySQL connections, ↵rowanbeentje2011-07-271-1/+1
| | | | addressing Issue #1132 and improving #877
* - Copy some NSStringAdditions to MCPStringAdditions to improve framework ↵rowanbeentje2011-06-191-2/+1
| | | | separation/standaloneness
* - Ensure the connection delegate is nil on initialisationrowanbeentje2011-06-191-1/+2
|
* - After reviewing crash logs, improve query cancellation for increased ↵rowanbeentje2011-05-301-3/+14
| | | | stability (mostly in the kill query/thread failure path) and improve disconnection for increased stability
* - Fix compiler warnings for MCPKit - largely typecast relatedrowanbeentje2011-03-021-51/+53
| | | | | | | | | - Fix further compiler warnings, including a couple of bugs - Disable the -wselector warnings (Multiple definition types for selector) as they're currently unsupported in LLVM - Disable the -wconversion warnings (Prototype conversion) warnings as we usually can't affect protocol declaration - Disable the -wstrict-selector-match (Strict selector matching) due to too many false positives
* - Fix problems correctly resetting state when a query affects no rows on ↵rowanbeentje2011-01-141-4/+5
| | | | | | | creating new tables; this could be responsible for -release errors in SPDataStorage, as well as out-of-bounds errors in SPDataStorage or SPTableContent. - Fix incorrect reporting of affected rows in MCPKit due to the use of meta/status queries; only track affected rows for framework-usage queries (already largely implemented in previous revisions)
* * Recognize "performance_schema" as system DB (added in 5.5)dmoagx2010-12-181-1/+2
|
* - Fix a race condition in conditions where the network has dropped, ↵rowanbeentje2010-12-071-0/+20
| | | | preventing possible MySQL library crashes
* - Tweak connection/reconnection to use locking, to prevent race condition ↵rowanbeentje2010-11-121-1/+7
| | | | issues when reconnecting after a network loss causing a drop in connection and proxy at the same time.
* - Alter connection details to be sent over UTF8 instead of Latin1 - this ↵rowanbeentje2010-11-101-16/+33
| | | | | | | | improves handling of special characters in passwords, improving Issue #890 - Improve code in (the unused) [MCPConnection connectWithLogin:password:host:socket:] to match latest updates in the rest of the framework - Fix creation of new users
* - Improve query disconnection/reconnection while pings or queries are still ↵rowanbeentje2010-11-031-3/+28
| | | | active or cleaning up
* • CSV Import Field Mapper SheetBibiko2010-10-231-1/+1
| | | | | - added the possibility to apply any sql function while importing set via "Add value or expression" sheet eg concat('$2', '$1', length('$3')) whereby $1 $2 $3 are the placeholder for the csv file columns 1 2 3 [first column starts with 1] • fixed ' escaping issue in MCPConnection
* Split MCPConnection's delegate methods into it's own protocol.stuconnolly2010-10-201-1/+22
|
* - Make the initial maximum packet fetch fail silently if it fails, ↵rowanbeentje2010-09-301-10/+4
| | | | defaulting to the default MySQL max packet size (1MB). This improves compatibility with MySQL-like systems like sphinx, addressing Issue #844.
* Consolidate and improve ping code:rowanbeentje2010-09-251-164/+134
| | | | | | | | - Foreground and keepalive pings now use the same code, which has been tidied and improved - Global variables are no longer incorrectly shared across multiple instances - If a ping thread blocks in a state where pthread_cancel no longer functions, the connection is assumed to have failed (network issues etc) This should further improve MySQL crashes linked to pings, and will hopefully address Issue #830. Also update localizable strings
* - A further attempt to improve MySQL library crashes by improving threaded ↵rowanbeentje2010-09-201-1/+33
| | | | | | | pings. This returns to an old approach by attempting to use interrupt signals to force a hung network read to close; however, the signal is now sent by the watchdog thread in a thread-safe fashion to specifically target the locking thread. If this approach works we'll probably consolidate the ping code to use it throughout. - Update localizable strings
* - Clean up warnings when building with GCCrowanbeentje2010-09-181-6/+6
|
* - Fix crashes triggered by connection unlocking after disconnection; this ↵rowanbeentje2010-09-181-2/+2
| | | | addresses http://spbug.com/l/1269 and possibly improves the vio_delete crashes
* - Consolidate structure and content row editing cancellation code into a ↵rowanbeentje2010-09-161-1/+0
| | | | | | | | | | single function in each class - Tweak NSTableView subclasses to catch presses of the Escape key and ask the class to abort row editing. This makes Esc key behaviour much more consistent, and allows cancelling/reverting edits made via the mouse (eg checkboxes, dropdowns, enums), or after the cell editing has finished but the row is still selected. - Remove debug - Update localisable strings
* - Implement support for MySQL over SSL for both TCP/IP and Socket ↵rowanbeentje2010-09-131-5/+87
| | | | | | | | | | connection modes. - Upgrade the MySQL binaries to version 5.1.50 (was 5.1.46) - Enable SSL support in the MySQL libraries (this leads to a large increase in library size, unfortunately) - Enable more optimisations in the MySQL libraries (especially --enable-assembler for faster in-library string processing and --with-mysqld-ldflags=-all-static) This completes support for Issue #27.
* Update background keepalive pings:rowanbeentje2010-09-031-11/+33
| | | | | | | - Fully lock the connection for background pings; this may slow down queries after connection disuse (when the keepalive is still active/blocked), but strengens thread safety to hopefully fix vio_delete crashes - Fix pthread_cancel use; previously pthread_cancel after a keepalive may have resulted in cancelling unrelated threads where the thread ID was reused This should increase stability and improve program consistency.
* - Add connection checks before uses of mysql_hex_string and ↵rowanbeentje2010-08-311-16/+51
| | | | mysql_real_escape_string (which require an active connection). This addresses http://spbug.com/l/54 .
* - Attempt more status checking before closing the MySQL connection, in an ↵rowanbeentje2010-08-301-3/+3
| | | | | | | attempt to further address http://spbug.com/l/13 - Update localisable strings
* - Improve background thread reconnect interaction with the interface; if ↵rowanbeentje2010-08-291-3/+10
| | | | the application is in a modal state, the background thread waits. This improves interface behaviour on multiple SSH disconnections after sleep/wake (finishing Issue #798) and also disconnections while the interface is modally locked (eg editing text/blobs).
* Encoding changes and improvements, particularly to increase compatibility ↵rowanbeentje2010-08-251-56/+168
| | | | | | | | | | | with extended characters in MySQL identifiers (names of dbs/tables/cols): - Move encoding queries and control into MCPKit, with newly cleaned-up methods, and switch a number of locations to using the new code. - Use UTF8 connections for many identifier-based queries (selecting and listing databases, tables, stored procs, table information). This fixes selection and creation of table and database names containing extended characters, also fixing exceptions and errors. - Improve UTF8 over Latin1 to correctly set the client character set encoding as well, fixing custom queries and edits; remove custom code in SPTableContent achieving the same thing in a single location. - Fix database encoding detection routines - Update localisable strings
* • made SP more robust against issues which are caused by different table ↵Bibiko2010-08-151-0/+4
| | | | name encodings
* • fixed: display tables and views correctly in auto-completion list and in ↵Bibiko2010-08-151-1/+1
| | | | the Navigator
* - Add support for automatically converting \r and \r\n linebreaks in query ↵rowanbeentje2010-07-291-0/+52
| | | | | | | | syntax to \n. This addresses Issue #652. - Clean up SPSQLParser, and use a few more CFString methods to avoid obj-c messaging in loops - When importing SQL using autodetect, perform a manual SET NAMES if possible to cope with poorly-exported files.
* - Clean up SPDataImport, removing unused methods and cleaning up order and ↵rowanbeentje2010-07-191-0/+13
| | | | | | | | | methods - Improve error handling when the connecting dies during import (previous the sheet would stay open) - Fix localised strings for error messages (label and text the wrong way round) - Improve comments
* - Clean up automatic reconnection coderowanbeentje2010-07-141-26/+49
| | | | | | - Allow keepalive pings to perform automatic reconnections after a few consecutive failures - Fix a number of keepalive ping bugs, including compatibility with the new threaded connection methods and reconnection timing issues causing keepalive pings to not fire correctly
* Improve handling of network drops, including a new automatic reconnection ↵rowanbeentje2010-07-131-7/+70
| | | | | | | | | | | | | attempt, as well as improved handling of networks not present. This addresses Issue #657. In MCPKit: - Disable MySQL automatic reconnection, and add our own reconnection code for greater consistency - If no network is available, delay reconnects by a short period to allow the network to come back up - Improved handling of proxy disconnects In SPSSHTunnel: - Improved handling of SSH tunnel disconnects, improving automatic reconnection via MCPKit and fixing potential memory/logic tramping. Also remove the "Retry" button from the Disconnected dialog, leaving only the choices "Reconnect" or "Disconnect".
* - Add default socket locations for Mac OS X Server and XAMPP to default ↵rowanbeentje2010-07-081-4/+6
| | | | | | | socket search paths - Reorder socket search paths to favour OS X locations
* Improved calling of stored procedures:jakob2010-06-301-2/+30
| | | | | | | - added the CLIENT_MULTI_RESULTS flag to the connection flags - automatically discard all remaining results when unlocking the connection This is not a perfect solution, but will improve usability a lot for those who often call stored procedures. Sequel Pro still doesn't support multiple results -- it will show only the first and silently discard all the remaining ones.
* - Improve MySQL 3 & MySQL 4 query cancellation and disconnection. This ↵rowanbeentje2010-06-161-44/+47
| | | | fixes a number of issues including http://spbug.com/l/13
* - Fix comment retrieval issues for <4.1 when retrieving db structure - ↵rowanbeentje2010-06-141-1/+6
| | | | addresses crashes http://spbug.com/l/540 and http://spbug.com/l/106
* - Ensure start/end query notifications are sent on the main thread to avoid ↵rowanbeentje2010-06-011-3/+4
| | | | | | | the interface being updated from the wrong thread on listeners - Add a "Support Files" folder to MCPKit, containing NSNotificationAdditions to support main thread notifications from within MCPKit
* Rename TablesList to SPTablesList.stuconnolly2010-05-271-1/+1
|
* Review queryDbStructureWithUserInfo:rowanbeentje2010-05-151-166/+127
| | | | | | | | - Remove extra call when changing databases, avoiding double calls - Fix an error if the document has had no encoding set yet (addresses http://spbug.com/l/200) - Tweak db struture querying to work on MySQL 3 and 4.0 - Rework function to remove duplicated logic, and to address a number of valueForUndefinedKey: exceptions logged via the bug tracker
* - Check return status when capturing query error message strings - this ↵rowanbeentje2010-05-091-2/+4
| | | | addresses http://spbug.com/l/250
* Rework alert sheets:rowanbeentje2010-05-091-5/+13
| | | | | | | - Change MCPConnection.m to no longer use a reference to tableWindow to attach sheets - instead use a delate error display method if available - Rework TableSource and TableContent sheetDidEnd methods into per-task methods rather than overloading contextInfo - Rework SPAlertSheets to perform actions on the main thread, with the loss of (unused) support for a didDismissSelector. This addresses a number of crashes logged by the crash reporter
* This changeset implements renaming and duplicating databases on a server. ↵drx7772010-04-281-11/+30
| | | | | | | | | | | | | | | | | | | Details as follows: * altered MCPConnection listTablesFromDB:like: to return NSArray * altered MCPConnection listFieldsFromTable:like: to use backtick quoted strings for table and fieldnames * added MCPConnection listTablesFromDB for a complete table list * added SPStringAdditions.h to various files to prevent warnings * added sheets for duplicate/rename DB in DBView.xib * added duplicate/rename menu items to MainMenu.xib * added outlets in TableDocument: databaseNewSheet databaseRenameSheet databaseCopyNameField databaseRenameNameField copyOnlyStructureButton copyDatabaseButton renameDatabaseButton * added methods in TableDocument: getConnection, copyDatabase, renameDatabase, _copyDatabase, _renameDatabase * added OCMock Framework for object mocking in tests * added group Others/DatabaseActions
* Add extra connection checking at multiple stages of getting the server's ↵stuconnolly2010-04-271-5/+7
| | | | process list. Fixes http://spbug.com/l/152.