aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #9204 from ranjaykrishna/col-probAaron Patterson2013-02-121-0/+3
|\ | | | | schema dumper tests now conducted by ActiveRecord::Base.Connection
| * checking in the abstractions for valid type checking:Ranjay Krishna2013-02-121-0/+3
| |
* | active_record: Quote numeric values compared to string columns.Dylan Smith2013-02-071-2/+0
|/
* small refactoring, added blob_or_text_colum? in AbstractMysqlAdapterAngelo Capilleri2012-12-281-2/+6
|
* Fixes for PR [#8267]Marc-Andre Lafortune2012-12-221-3/+6
| | | | | | | | * Fix Migration#reversible by not using `transaction`. * Adapt mysql adapter to updated api for remove_column * Update test after aedcd683684d08eaf30623a4b48ce31a31426372
* Session variables for mysql, mysql2, and postgresql adapters can be setAaron Stone2012-12-081-0/+39
| | | | | | | | | 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.
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-11-031-2/+2
|\ | | | | | | | | | | | | Conflicts: actionpack/lib/action_controller/metal/mime_responds.rb activerecord/lib/active_record/attribute_methods.rb guides/source/working_with_javascript_in_rails.md
| * Migration of docs to 1.9 hash syntaxAvnerCohen2012-10-231-2/+2
| |
* | Use the MySQL varbinary type when appropriate in migrations.Victor Costan2012-10-271-0/+7
|/
* The default value of a text/blob in mysql strict mode should be nilJon Leighton2012-10-191-8/+10
| | | | | | | | | 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
* Revert "Use flat_map { } instead of map {}.flatten"Santiago Pastorino2012-10-051-2/+2
| | | | | | | | | | | This reverts commit abf8de85519141496a6773310964ec03f6106f3f. We should take a deeper look to those cases flat_map doesn't do deep flattening. irb(main):002:0> [[[1,3], [1,2]]].map{|i| i}.flatten => [1, 3, 1, 2] irb(main):003:0> [[[1,3], [1,2]]].flat_map{|i| i} => [[1, 3], [1, 2]]
* Use flat_map { } instead of map {}.flattenSantiago Pastorino2012-10-051-2/+2
|
* Support for partial inserts.Jon Leighton2012-09-281-0/+8
| | | | | | | | | | | When inserting new records, only the fields which have been changed from the defaults will actually be included in the INSERT statement. The other fields will be populated by the database. This is more efficient, and also means that it will be safe to remove database columns without getting subsequent errors in running app processes (so long as the code in those processes doesn't contain any references to the removed column).
* Support for specifying transaction isolation levelJon Leighton2012-09-211-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If your database supports setting the isolation level for a transaction, you can set it like so: Post.transaction(isolation: :serializable) do # ... end Valid isolation levels are: * `:read_uncommitted` * `:read_committed` * `:repeatable_read` * `:serializable` You should consult the documentation for your database to understand the semantics of these different levels: * http://www.postgresql.org/docs/9.1/static/transaction-iso.html * https://dev.mysql.com/doc/refman/5.0/en/set-transaction.html An `ActiveRecord::TransactionIsolationError` will be raised if: * The adapter does not support setting the isolation level * You are joining an existing open transaction * You are creating a nested (savepoint) transaction The mysql, mysql2 and postgresql adapters support setting the transaction isolation level. However, support is disabled for mysql versions below 5, because they are affected by a bug (http://bugs.mysql.com/bug.php?id=39170) which means the isolation level gets persisted outside the transaction.
* load active_support/core_ext/object/blank in active_support/railsXavier Noria2012-08-021-1/+0
|
* Fixing texts; down to three failing tests.Jeremy Cole2012-07-131-1/+1
| | | | | Conflicts: activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
* fix: limit of enum columns of mysqlYamada Masaki2012-06-281-0/+2
|
* Avoid unnecessary catching of Exception instead of StandardError.Dylan Smith2012-06-171-3/+3
|
* Fix logs name consistency.kennyj2012-05-191-4/+4
|
* missplelling error in abstract_mysql_adapterAngelo Capilleri2012-05-121-1/+1
|
* be sure to currectly fetch PK name from MySQL even if the PK has some custom ↵Akira Matsuda2012-04-191-1/+1
| | | | option
* Fix delete_all when chained with joins.Rafael Mendonça França2012-04-101-11/+13
| | | | Closes #5202 and #919
* Merge pull request #4843 from seamusabshere/patch-1Xavier Noria2012-03-281-1/+1
|\ | | | | Possibly clearer way of getting rid of ` and "
| * thanks to @jurriaanSeamus Abshere2012-02-141-1/+1
| |
| * Possibly clearer way of getting rid of ` and " Seamus Abshere2012-02-011-1/+1
| | | | | | | | | | | | | | | | Incidentally it's also faster... >> a = 'hello "id` world'; Benchmark.realtime { 500_000.times { a.tr('`"', "") } } => 0.7388770580291748 >> a = 'hello "id` world'; Benchmark.realtime { 500_000.times { a.gsub(/[`"]/, "") } } => 1.7843739986419678
* | Fix GH #3163. Should quote database on mysql/mysql2.kennyj2012-03-051-1/+1
| |
* | Fix type_to_sql with text and limit on mysql/mysql2. Fix GH #3931.kennyj2012-02-261-9/+20
| |
* | prepared statements can be disabledAaron Patterson2012-02-211-1/+11
| |
* | more ruby 2.0 respond_to? changesAaron Patterson2012-02-211-1/+1
| |
* | Remove useless argument in #columns.Sebastian Martinez2012-02-021-1/+1
|/
* Fix GH #4754. Remove double-quote when using ANSI_QUOTESkennyj2012-01-311-1/+1
|
* Handle nil in add_index :length option in MySQLPaul Sadauskas2012-01-241-1/+1
| | | | | | | | | | | | | | | | | Our schema.rb is being generated with an `add_index` line similar to this: add_index "foo", ["foo", "bar"], :name => "xxx", :length => {"foo"=>8, "bar=>nil} This is the same as it was on Rails 3.1.3, however, now when that schema.rb is evaluated, its generating bad SQL in MySQL: Mysql::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 1: CREATE UNIQUE INDEX `xxx` ON `foo` (`foo`(8), `bar`()) This commit adds a check for nil on the length attribute to prevent the empty parens from being output.
* Revert naive O(1) table_exists? implementation.Jon Leighton2011-12-131-5/+8
| | | | | | | | | | It was a bad idea to rescue exceptions here. This can interfere with transaction rollbacks which seems to be the cause of current CI failure. Instead, each adapter should implement its own DB-specific O(1) implementation, and we fall back on the generic, slower, implementation otherwise.
* Use show create table.kennyj2011-12-031-3/+8
|
* implements automatic EXPLAIN logging for slow queriesXavier Noria2011-12-021-74/+0
|
* removing deprecated methodsAaron Patterson2011-11-191-4/+0
|
* adding visitors to the respective adaptersAaron Patterson2011-11-191-0/+1
|
* Use `show index from`. We could fix `pk_and_sequence_for` method's ↵kennyj2011-11-191-18/+2
| | | | performance problem (GH #3678)
* Only used detailed schema introspection when doing a schema dump.Christos Zisopoulos2011-11-181-0/+7
| | | Fixes #3678
* Join method uses empty string by default, so remove itAaron Patterson2011-11-161-2/+2
|
* adds trailing +s to the output of EXPLAIN for MySQLXavier Noria2011-11-071-3/+2
|
* implements AR::Relation#explainXavier Noria2011-11-051-0/+75
| | | | | | | | | | | | | | | | | | | This is a first implementation, EXPLAIN is highly dependent on the database and I have made some compromises. On one hand, the method allows you to run the most common EXPLAIN and that's it. If you want EXPLAIN ANALYZE in PostgreSQL you need to do it by hand. On the other hand, I've tried to construct a string as close as possible to the ones built by the respective shells. The rationale is that IMO the user should feel at home with the output and recognize it at first sight. Per database. I don't know whether this implementation is going to work well. Let's see whether people like it.
* Merge pull request #3525 from kennyj/fix_3440-1Jon Leighton2011-11-051-2/+11
|\ | | | | Fixed an issue id false option is ignored on mysql/mysql2 (fix #3440)
| * Fixed an issue id false option is ignored on mysql/mysql2 (fix #3440)kennyj2011-11-061-2/+11
| |
* | AR changes to support creating ordered (asc, desc) indexesVlad Jebelev2011-11-041-9/+27
|/
* Only use LOWER for mysql case insensitive uniqueness check when column has a ↵Joseph Palermo2011-10-091-4/+23
| | | | case sensitive collation.
* Move the bulk alter table code into the abstract mysql adapter, hence it is ↵Jon Leighton2011-08-291-0/+42
| | | | supported for mysql2 as well now.
* Extract simplified_type into the abstract classJon Leighton2011-08-291-1/+18
|
* Create an AbstractMysqlAdapter to abstract the common code between ↵Jon Leighton2011-08-291-0/+552
MysqlAdapter and Mysql2Adapter.