aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb
Commit message (Collapse)AuthorAgeFilesLines
* Replace `type_cast` case statement with delegationSean Griffin2014-05-201-12/+0
| | | | | | | | All subclasses of column were now delegating `type_cast` to their injected type object. We can remove the overriding methods, and generalize it on the `Column` class itself. This also enabled us to remove several column classes completely, as they no longer had any meaningful behavior of their own.
* Add a type object to Column constructorSean Griffin2014-05-171-2/+3
| | | | | | Part of #15134. In order to perform typecasting polymorphically, we need to add another argument to the constructor. The order was chosen to match the `oid_type` on `PostgreSQLColumn`.
* cache scope building on associationsAaron Patterson2014-04-141-4/+0
| | | | SQL statements for querying associations are now cached
* working against arel/collector branchAaron Patterson2014-04-091-2/+2
|
* Merge branch 'master' into adequaterecordAaron Patterson2014-04-071-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (122 commits) Rails.application should be set inside before_configuration hook remove check for present? from delete_all Remove useless begin..end Build the reverse_order on its proper method. Use connection-specific bytea escaping Ignore order when doing count. make enums distinct per class Remove unused `subclass_controller_with_flash_type_bar` var from flash test. fix CollectionProxy delete_all documentation Added OS X specific commands to installation guide [ci skip] Recommended using homebrew for installing MySQL and PostgreSQL Fix setup of adding _flash_types test. Use SVG version of travis build status badge [skip ci] W3C CSP document moved to gihub.io URL [ci skip] sprockets-rails was released Fix the test defining the models in the right place Add CHANGELOG entry for #11650 [ci skip] Declare the assets dependency Use sass-rails 4.0.3 Make possible to use sprockets-rails 2.1 add missing parentheses to validates_with documentation [skip ci] ...
| * Clarify 'database does not exist' message and implementation.Jeremy Kemper2014-04-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | * Clarify what the situation is and what to do. * Advise loading schema using `rake db:setup` instead of migrating. * Use a rescue in the initializer rather than extending the error message in-place. * Preserve the original backtrace of other errors by using `raise` rather than raising again with `raise error`. References 0ec45cd15d0a2f5aebc75e23d841b6c12f3ba763
* | Merge branch 'master' into adequaterecordAaron Patterson2014-03-131-0/+8
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (108 commits) make tests pass on Ruby 2.2 Use Sqlite3 adapter in examples use the body proxy to freeze headers just ask the response for the commit status, we do not need to ask the jar only write the jar if the response isn't committed Fix a grammatical error in the i18n guide [ci skip] use method_defined? to check whether or not a method is defined Enhance docs for update_attribute [ci-skip] Change usec to 0 on tests that compare seconds Unit test for mysql quote time usec Changelog entry for mysql56 microseconds Test microsecond on mysql 5.6 MySQL 5.6 and later supports microsecond precision in datetime. [ci skip] Add documentation for original_fullpath. Remove mocking on save, when not necessary comment why we are modifying global state. [ci skip] `change_table` supports `citext`. Follow up to #12523. Removed unnecessary command "application" register OID for PostgreSQL citex datatype [Troy Kruthoff & Lachlan Sylvester] Fixes STI when 2+ levels deep. ...
| * MySQL 5.6 and later supports microsecond precision in datetime.Tatsuhiko Miyagawa2014-03-121-0/+8
| | | | | | | | | | You might want to branch it to include this only for 5.6, but passing these values to < 5.6 doesn't cause issues either.
* | Merge branch 'master' into adequaterecordAaron Patterson2014-02-171-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (311 commits) Add a missing changelog entry for #13981 and #14035 Revert "Fixed plugin_generator test" implements new option :month_format_string for date select helpers [Closes #13618] add factory methods for empty alias trackers guarantee a list in the alias tracker so we can remove a conditional stop exposing table_joins make most parameters to the AliasTracker required make a singleton for AssociationScope pass the association and connection to the scope method pass the tracker down the stack and construct it in the scope method clean up add_constraints signature remove the reflection delegate remove klass delegator remove railties changes. fixes #14054 remove chain delegate remove scope_chain delegate Add verb to sanitization note fix path shown in mailer's templates updated Travis build status image url fix guide active_support_core_extensions. add Note to String#indent [ci skip] ... Conflicts: activerecord/lib/active_record/associations/join_dependency.rb activerecord/test/cases/associations/association_scope_test.rb
| * Fix regression on `.select_*` methods.Arthur Neves2014-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was a common pattern: ``` query = author.posts.select(:title) connection.select_one(query) ``` However `.select` returns a ActiveRecord::AssociationRelation, which has the bind information, so we can use that to get the right sql query. Also fix select_rows on postgress and sqlite3 that were not using the binds [fixes #7538] [fixes #12017] [related #13731] [related #12056]
* | run the damn tests @tenderloveAaron Patterson2014-01-171-1/+1
| |
* | change query strategy based on adapterAaron Patterson2014-01-161-0/+4
|/
* Raise NoDatabaseError when db does not existschneems2013-12-241-0/+6
| | | Building on the work of #13427 this PR adds a helpful error message to the adapters: mysql, mysql2, and sqlite3
* 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
* Revert "Do not dup the binds when visiting the AST"Rafael Mendonça França + Kassio Borges2013-08-311-1/+1
| | | | | | This reverts commit 71ff7d9c6592b93e2c810a1f464943dd7bd02c7f. Reason: I need to check with @jeremy if we can do this.
* Do not dup the binds when visiting the ASTRafael Mendonça França2013-08-311-1/+1
| | | | | | | The visitor have to consume the bind parameters to make the statements work when the prepared statement option is disabled. Fixes #12023
* chmod -xAkira Matsuda2013-08-121-0/+0
|
* Set field encoding to client_encoding for mysql adapter.Koichi Sasada2013-08-081-0/+4
|
* Uses mysql2 0.3.13 or laterkennyj2013-07-231-1/+1
|
* Defines the return type of select / select_all method.kennyj2013-07-231-2/+1
|
* regression test + mysql2 adapter raises correct error if conn is closed.Yves Senn2013-06-151-3/+5
|
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2013-03-301-1/+1
|\ | | | | | | | | | | | | | | | | 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-1/+1
| |
* | respect auto_increment in rename_column for mysqlVipul A M2013-03-271-2/+2
| |
* | sets limit 191 for schema_migrations#version in mysql2 if the encoding is ↵Xavier Noria2013-03-171-0/+9
|/ | | | | | "utf8mb4" Please, see rationale in the included CHANGELOG patch.
* Don't rely on Hash key's orderingVitor Baptista2013-01-161-1/+3
| | | | | | | | | | | | | | | | | | | If we set encoding latin1 for a PostgreSQL database, it calls PostgreSQLAdapter::create_database with options that have, among other things: { 'encoding' => 'latin1' } Then, we use reverse_merge(:encoding => "utf8") to setup the default encoding. In the end, the hash looks like: { :encoding => 'utf8', 'encoding' => 'latin1' } The call to options.symbolize_keys calls to_sym on each_key of this Hash. It usually means that the encoding passed overwrites the default utf8, but it's not guaranteed. So, we shouldn't rely on it. The same was happening in ActiveRecord::ConnectionHandling.
* Session variables for mysql, mysql2, and postgresql adapters can be setAaron Stone2012-12-081-21/+1
| | | | | | | | | 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.
* Migration of docs to 1.9 hash syntaxAvnerCohen2012-10-231-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-0/+2
|
* Merge pull request #5244 from fotos/myqsl2_wait_timeoutRafael Mendonça França2012-05-251-1/+1
|\ | | | | | | Maximum wait_timeout on Windows is 2147483
| * Maximum wait_timeout on Windows is 2147483Fotos Georgiadis2012-03-021-1/+1
| |
* | Add config option, rdoc, tests for mysql(2) STRICT_ALL_TABLES mode.Michael Pearson2012-05-051-2/+4
| |
* | Default to 'strict mode' in MySQLMichael Pearson2012-05-051-0/+6
| |
* | update mysql for new exec_insert signatureDoug Cole2012-03-311-1/+1
|/
* prepared statements can be disabledAaron Patterson2012-02-211-15/+5
|
* tag bind params with a bind param objectAaron Patterson2012-02-201-1/+1
|
* Alias reconnect! to reset! for Mysql2 adapter since they have sameWaseem Ahmad2012-02-121-5/+1
| | | | behavior.
* 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.
* I herd you like modules.Jon Leighton2011-12-241-2/+2
|
* implements automatic EXPLAIN logging for slow queriesXavier Noria2011-12-021-0/+78
|
* Bump Mysql2!Arun Agrawal2011-11-221-1/+1
|
* Only use LOWER for mysql case insensitive uniqueness check when column has a ↵Joseph Palermo2011-10-091-2/+2
| | | | case sensitive collation.
* Extract simplified_type into the abstract classJon Leighton2011-08-291-15/+3
|
* Create an AbstractMysqlAdapter to abstract the common code between ↵Jon Leighton2011-08-291-528/+56
| | | | 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
|