aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
Commit message (Collapse)AuthorAgeFilesLines
* Remove invalid commentRafael Mendonça França2013-09-111-4/+0
| | | | This is not valid anymore after 08477a651648ba4417ded128aa37b9ae0dcbc9ce
* Check if the SQL is not a prepared statementRafael Mendonça França2013-09-111-1/+1
| | | | | | | | | When the adapter is with prepared statement disabled and the binds array is not empty the connection adapter will try to set the binds values and will fail. Now we are checking if the adapter has the prepared statement disabled. Fixes #12023
* chmod -xAkira Matsuda2013-08-121-0/+0
|
* Set field encoding to client_encoding for mysql adapter.Koichi Sasada2013-08-081-0/+8
|
* Free result_metadata directly instead of freeing 2nd, redundant call.Peter Kovacs2013-08-051-1/+1
| | | `result_metadata` returns a new object each time it is called, so calling `result_metadata.free` is essentially a noop. Instead call `free` directly on the metadata when we're done with it.
* Revert "Merge pull request #11120 from awilliams/ar_mysql2_boolean_quoting"Yves Senn2013-07-171-0/+6
| | | | | This reverts commit cb1d07e43926bcec95cb8b4a663ca9889173395a, reversing changes made to 754a373e301d2df0b12a11083405252722bc8366.
* Unifies mysql and mysql2 casting of booleansawilliams2013-07-161-6/+0
| | | | | Using the mysql2 adapter, boolean values were sometimes being incorrectly cast to 't' or 'f'. This changes the cast to match the mysql adapter behavior, ie 1 and 0.
* tiny types should only be integers when the length is <= 1. fixes #10620Aaron Patterson2013-05-151-3/+9
|
* fix typosVipul A M2013-04-211-1/+1
|
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2013-03-301-2/+2
|\ | | | | | | | | | | | | | | | | Conflicts: activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb activerecord/test/cases/adapter_test.rb guides/source/testing.md [ci skip]
| * nodoc AR::ConnectionHandling for adapters [ci skip]Francesco Rodriguez2013-03-151-2/+2
| |
* | respect auto_increment in rename_column for mysqlVipul A M2013-03-271-2/+2
|/
* Do not type cast all the database url values.Rafael Mendonça França2013-02-241-1/+1
| | | | | | We should only type cast when we need to use. Related to 4b005fb371c2e7af80df7da63be94509b1db038c
* Session variables for mysql, mysql2, and postgresql adapters can be setAaron Stone2012-12-081-12/+5
| | | | | | | | | in the new 'variables:' hash in each database config section in database.yml. The key-value pairs of this hash will be sent in a 'SET key = value, ...' query on new database connections. The configure_connection methods from mysql and mysql2 into are consolidated into the abstract_mysql base class.
* Be a bit less conservative with mysql in adapterCarlos Antonio da Silva2012-11-191-1/+1
|
* Bump mysql gem version to the newly 2.9.0, fix build.Carlos Antonio da Silva2012-11-171-1/+1
|
* The default value of a text/blob in mysql strict mode should be nilJon Leighton2012-10-191-4/+2
| | | | | | | | | In non-strict mode it is '', but if someone is in strict mode then we should honour the strict semantics. Also, this removes the need for a completely horrible hack in dirty.rb. Closes #7780
* Ensure disconnecting or reconnecting resets the transaction stateJon Leighton2012-09-151-1/+2
|
* Remove expired comment. This method is used from other place.kennyj2012-09-111-2/+0
|
* Refactor AR::Result or inherits. Because we have redundant codes aboutkennyj2012-08-221-8/+1
|
* teaching the mysql adapter how to typecast strings returned from the databaseAaron Patterson2012-07-131-2/+132
|
* Fixing texts; down to three failing tests.Jeremy Cole2012-07-131-14/+23
| | | | | Conflicts: activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
* Only use prepared statements when bind variables are presentJeremy Cole2012-07-131-34/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prepared statements (prepare/execute/close) were being used unnecessarily when no bind variables were present, and disabling prepared statement using prepared_statements:false was principally broken. While bind variables were correctly substituted with prepared_statements:false, the prepared statement interface was still used, costing an extra two round trips per query. In addition to making this behavioral change, I also cleaned up the internals of exec_stmt and exec_without_stmt so that they behave the same (calling log and constructing the ActiveRecord::Result in the same way). Moving the check for binds.empty? to exec_query also will mean that several code paths explicitly calling exec_without_stmt could be cleaned up to once again call exec_query instead. I have also left the check for binds.empty? in exec_stmt, since it is not a private method and could be called directly with an empty binds array. For the sake of clarity in this patch, I have not made those changes. = The previous behavior = When issuing a Foo.find(1) with prepared_statements:true, the bind variable is present in the prepared query, and execute shows a value passed: Connect root@localhost on rails_test Query SET SQL_AUTO_IS_NULL=0 Statistics Query SHOW FULL FIELDS FROM `foos` Query SHOW TABLES LIKE 'foos' Query SHOW CREATE TABLE `foos` Prepare SELECT `foos`.* FROM `foos` WHERE `foos`.`id` = ? LIMIT 1 Execute SELECT `foos`.* FROM `foos` WHERE `foos`.`id` = 1 LIMIT 1 Close stmt Quit When issuing a Foo.find(1) with prepared_statements:false, the bind variable has already been removed and substituted with the value, but the prepared statement interface is used anyway: Connect root@localhost on rails_test Query SET SQL_AUTO_IS_NULL=0 Statistics Query SHOW FULL FIELDS FROM `foos` Query SHOW TABLES LIKE 'foos' Query SHOW CREATE TABLE `foos` Prepare SELECT `foos`.* FROM `foos` WHERE `foos`.`id` = 1 LIMIT 1 Execute SELECT `foos`.* FROM `foos` WHERE `foos`.`id` = 1 LIMIT 1 Close stmt Quit = With this patch applied = When issuing a Foo.find(1) with prepared_statements:true, the bind variable is present in the prepared query, and execute shows a value passed: Connect root@localhost on rails_test Query SET SQL_AUTO_IS_NULL=0 Statistics Query SHOW FULL FIELDS FROM `foos` Query SHOW TABLES LIKE 'foos' Query SHOW CREATE TABLE `foos` Prepare SELECT `foos`.* FROM `foos` WHERE `foos`.`id` = ? LIMIT 1 Execute SELECT `foos`.* FROM `foos` WHERE `foos`.`id` = 1 LIMIT 1 Close stmt Quit When issuing a Foo.find(1) with prepared_statements:false, the bind variable has been removed and substituted with the value, and the query interface is used instead of the prepared statement interface: Connect root@localhost on rails_test Query SET SQL_AUTO_IS_NULL=0 Statistics Query SHOW FULL FIELDS FROM `foos` Query SHOW TABLES LIKE 'foos' Query SHOW CREATE TABLE `foos` Query SELECT `foos`.* FROM `foos` WHERE `foos`.`id` = 1 LIMIT 1 Quit
* Add config option, rdoc, tests for mysql(2) STRICT_ALL_TABLES mode.Michael Pearson2012-05-051-2/+5
|
* Default to 'strict mode' in MySQLMichael Pearson2012-05-051-0/+5
|
* use Process.pid rather than $$Aaron Patterson2012-02-161-1/+1
|
* made the result set object act more like an arrayAaron Patterson2012-01-311-1/+1
|
* Support establishing connection on ActiveRecord::Model.Jon Leighton2011-12-281-1/+1
| | | | | This is the 'top level' connection, inherited by any models that include ActiveRecord::Model or inherit from ActiveRecord::Base.
* remove checks for encodings availabilitySergey Nartimov2011-12-251-46/+42
|
* I herd you like modules.Jon Leighton2011-12-241-2/+2
|
* Only use LOWER for mysql case insensitive uniqueness check when column has a ↵Joseph Palermo2011-10-091-2/+2
| | | | case sensitive collation.
* LRU cache in mysql and sqlite are now per-process caches.Aaron Patterson2011-09-071-11/+16
|
* Database adapters use a statement pool.Aaron Patterson2011-09-061-1/+2
| | | | | | Database adapters use a statement pool for limiting the number of open prepared statments on the database. The limit defaults to 1000, but can be adjusted in your database config by changing 'statement_limit'.
* adding a statement pool for mysql and sqlite3Aaron Patterson2011-09-061-4/+29
|
* Move the bulk alter table code into the abstract mysql adapter, hence it is ↵Jon Leighton2011-08-291-47/+0
| | | | supported for mysql2 as well now.
* Extract simplified_type into the abstract classJon Leighton2011-08-291-7/+3
|
* Create an AbstractMysqlAdapter to abstract the common code between ↵Jon Leighton2011-08-291-569/+98
| | | | MysqlAdapter and Mysql2Adapter.
* prevent sql injection attacks by escaping quotes in column namesAaron Patterson2011-08-161-1/+1
|
* Use new SelectManager#source methodJon Leighton2011-08-151-1/+1
|
* Use new SelectManager#projections= methodJon Leighton2011-08-151-1/+1
|
* use update.key instead of update.ast.key. make better use of select manager.Jon Leighton2011-08-151-12/+8
|
* Use a SelectCore rather than a full SelectManagerJon Leighton2011-08-151-2/+3
|
* Refactor building the update managerJon Leighton2011-08-151-3/+2
|
* Support for multi-table updates with limits, offsets and ordersJon Leighton2011-08-151-1/+22
|
* Support updates with joins. Fixes #522.Jon Leighton2011-08-151-0/+4
|
* Make it the responsibility of the connection to hold onto an ARel visitor ↵Jon Leighton2011-08-081-0/+4
| | | | for generating SQL. This improves the code architecture generally, and solves some problems with marshalling. Adapter authors please take note: you now need to define an Adapter.visitor_for method, but it degrades gracefully with a deprecation warning for now.
* Remove unused 'quoted_column_names' variable.Sebastian Martinez2011-06-081-1/+1
|
* No need to override for just calling superAkira Matsuda2011-05-291-4/+0
|
* Merge branch 'master' of github.com:rails/railsXavier Noria2011-05-251-18/+0
|\
| * removed deprecated methods, and related tests, from ActiveRecordJosh Kalderimis2011-05-251-18/+0
| |